[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: join 2 contiguous ext3 partitions

On Fri, Jul 01, 2011 at 02:45:15PM +0100, Joao Ferreira Gmail wrote:
> Hello,
> can I somehow join 2 ext3 partitions ?
> /dev/sda6      28G   15G   12G  56% /media/armazem
> /dev/sda7      19G  8.2G  9.3G  47% /media/despensa
> they both contain data.

It's fun danger time. :)

They're small. Perhaps compressing onto a usb stick would be a go as a first

Then you have two options:

1. copy and resize
   a. copy data in sda7 to sda6
   b. with fdisk -c -u not the beginning of 6 and end of 7
   c. delete 6 and 7
   d. recreate 6 so that it begins where 6 did and ends where 7 did and save
      - very important to get right. most important is to get the beginning
        exactly the same. if you cannot, quit without saving and go for option
      - ending is less important. don't fret there
   e. if sda is in use, reboot after commening out their entries in /etc/fstab
   f. fsck the fs on 6 (the new 6)
   g. use resize2fs to resize that filesystem
   h. adjust fstab as appropriate
2. format and copy back
   a. do b-e from above
   b. mkfs.ext3 (or 4 if you want) on 6
   c. copy from usb stick
   d. adjust fstab as appropriate

Fun times ahead. :)

  "A search of his car uncovered pornography, a homemade sex aid, women's 
  stockings and a Jack Russell terrier."
    - http://www.dailytelegraph.com.au/news/wacky/indeed/story-e6frev20-1111118083480

Reply to: