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

Re: Merging full & empty paritions ?



Assume that partitions hdb6 and hdb7 are connected and hdb6 is followed
by hdb7. The following steps can be used to merge these two partitions.

1. Resize partition hdb7 (use parted or resize2fs+fdisk) to 1GB
( (1790624 1K-blocks - 1GB) > 32940 1K-blocks).

2. Create partition hdb8 using the space splitted from the original hdb7.
Make file system on hdb8, for example ext3. Copy all files from hdb7 to
hdb8. Make sure hdb8 has enough space to contain files on hdb7, choose a
correct value in step 1.

3. Delete hdb7, expand hdb6 to occupy hdb7. Resize the file system on hdb6
to cover the enlarged partition. Make directory /usr/local on hdb6, copy
all file on hdb7 (previously named hdb8) to /usr/local.

4. Delete hdb7, expand hdb6. Resize the file system on hdb6.

5. Edit /etc/fstab, delete the line for mounting /usr/local.

The following points should be noted.

1. Make backup if you have important data. In case...

2. It is recommended to use a bootable floppy containing resizing tools.
You can find one on
http://www.tux.org/pub/people/kent-robotti/looplinux/rip/. It's safe to
resize an unmounted file system or partition.

3. Use mount and df to check the result of resizing. "resize2fs" seems can
resize ext3 file system. You should confirm it.

4. An example of copying file from hdb7 to hdb8:
  # mkdir /mnt/hdb7
  # mkdir /mnt/hdb8
  # mount /dev/hdb7 /mnt/hdb7
  # mount /dev/hdb8 /mnt/hdb8
  # find /mnt/hdb7 | cpio -pvmd /mnt/hdb8
  # df
  # umount /mnt/hdb7
  # umount /mnt/hdb8

Hope the above points are useful to you, good luck,

Qian

On Sun, 18 Aug 2002, Adam Bogacki wrote:

>
> Hi, I chose ext3 journalling when installing Woody 3.0 ...
>
> > > Hi,
> > > 	after apt-installing a number of packages I find
> > > myself in the following situation ...
> > >
> > > adam@Tux$ df
> > >
> > >               used (1K blocks) available   use%    mounted on
> > > /dev/hdb6     1921156                0     100%    /usr
> > > /dev/hdb7       32940          1790624       2%    /usr/local
> > >
> > > 	Is there any (non-destructive) way of merging /usr and
> > > /usr/local ?
> > >
> > > Adam Bogacki
> > > adam@bogacki.net
> > > afb3@primus.com.au
> > >
> > >
> > > --
> > > To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
> > > with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> > >
> >
>
>
> --
> To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
>



Reply to: