Re: [ext2resize] ext2online
Status: Inactive
Brought to you by:
adilger
From: Andreas D. <ad...@tu...> - 2001-10-17 15:59:19
|
On Oct 17, 2001 16:02 +0200, Jan Hanstede wrote: > I have the following hd configuration: > > Filesystem Size Used Avail Use% Mounted on > /dev/hda1 888M 808M 34M 96% / > /dev/hda2 251M 31k 237M 1% /tmp > /dev/hda4 2.7G 1.4G 1.2G 52% /var > > I would like to increase the hd space on hda1 by eating some free space of > hda4. I want to use ext2online for this purpose. (cause hda1 must stay > mounted). However it don't seem to work. I thought I had to shrink hda4 > first and then grow hda1 with this new free space. But I don't seem to be > able/allowed to shrink hda4. How can I solve this? You need to use something like GNU parted. ext2resize and ext2online only are able to resize the end of the filesystem, and do not do anything with the partition table. GNU parted uses mostly the same code to resize the ext2 filesystem, but it also allows you to move the entire filesystems around and change the partitioning. Another option would be to remove the /tmp filesystem (delete /dev/hda2) and grow /dev/hda1 into this free space. You can also use ext2resize to shrink /var by 260MB+, then shrink /dev/hda4 by some smaller amount and create a new partition at the end of the disk in this new space. You need to reboot at that point to get the kernel to recognize the new partition table, and finally, you grow / to fill the new space at the end of /dev/hda1, and create a new /tmp filesystem in the space at the end of the disk. You will also need to grow /var again to use up the space at the end of /dev/hda4. If you decide to use parted, you cannot do any of this while the filesystem is mounted. However, that isn't a big deal because you need a reboot anyways because the kernel isn't very good at handling partition table changes when any partition of that disk is in use. > By the way I didn't apply any kernel patches cause I didn't see any > reference in the docs/faqs (I just installed some redhat rpms). I asume you > don't need any unless you have an older version 2.2 or something? (I use > > 2.4)? You need to have kernel patches for any online resizing. There are patches for 2.4 kernels in the "patches/" directory. I have added this to the docs for installing ext2resize. Note that ext2online is mosly useful when you have LVM - you can grow the "partition" without needing a reboot, and LVM "partitions" do not need to be contiguous on disk, so it is easy to add space to filesystems while they are mounted. Cheers, Andreas -- Andreas Dilger \ "If a man ate a pound of pasta and a pound of antipasto, \ would they cancel out, leaving him still hungry?" http://www-mddsp.enel.ucalgary.ca/People/adilger/ -- Dogbert |