Re: join 2 contiguous ext3 partitions
On Sat, 2011-07-02 at 00:02 +1000, CaT wrote:
> 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
> step.
>
> 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
> 2.
> - 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
yes. this is mostly what I ended up doing. I elimnated sda7 (data in it
was not really that important).
Then I unmounted both and used gparted to increase sda6 into the sda7
free space. gparted did his job really great. at the end I commented 1
line out in /etc/fstab :)
I considered a union mount but I wasn't feeling very confortable with
the ideia :p
cheers.
thx a lot.
> 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. :)
>
Reply to: