Results 1 to 10 of 10
Enjoy an ad free experience by logging in. Not a member yet? Register.
LVM how to remove 1GB from /home and add it to /?
Installed Debian Lenny on the software computer VirtualBox. Asked the Debian installer to use Logical Volume Management. Cannot begin to work out how to remove 1GB of spare space from the home partition and use it to increase the size of the root, /, partition by 1GB. Anybody tell me, it must be quite simple??
lugo@debian:~$ df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/debian-root 2.8G 2.5G 104M 97% / tmpfs 94M 0 94M 0% /lib/init/rw udev 10M 640K 9.4M 7% /dev tmpfs 94M 0 94M 0% /dev/shm /dev/hda1 228M 17M 200M 8% /boot /dev/mapper/debian-home 6.6G 619M 5.6G 10% /home lugo@debian:~$ mount /dev/mapper/debian-root on / type ext3 (rw,errors=remount-ro) tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755) proc on /proc type proc (rw,noexec,nosuid,nodev) sysfs on /sys type sysfs (rw,noexec,nosuid,nodev) procbususb on /proc/bus/usb type usbfs (rw) udev on /dev type tmpfs (rw,mode=0755) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620) /dev/hda1 on /boot type ext2 (rw) /dev/mapper/debian-home on /home type ext3 (rw) # fdisk -l Disk /dev/hda: 10.7 GB, 10737418240 bytes 255 heads, 63 sectors/track, 1305 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x0006277c Device Boot Start End Blocks Id System /dev/hda1 * 1 31 248976 83 Linux /dev/hda2 32 1305 10233405 8e Linux LVM Disk /dev/dm-0: 2969 MB, 2969567232 bytes 255 heads, 63 sectors/track, 361 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x00000000 Disk /dev/dm-0 doesn't contain a valid partition table Disk /dev/dm-1: 390 MB, 390070272 bytes 255 heads, 63 sectors/track, 47 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x00000000 Disk /dev/dm-1 doesn't contain a valid partition table Disk /dev/dm-2: 7117 MB, 7117733888 bytes 255 heads, 63 sectors/track, 865 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x00000000 Disk /dev/dm-2 doesn't contain a valid partition table
Does it follow that nobody else can use LVM either? Doesn't say much for the whole rationale of the thing.
Debian and Ubuntu sources have a utility system-config-lvm for LVM Management. It has Graphical Interface. You can resize Logical Volumes easily.
Do clear cache of package manager regularly? It consumes a lot of space.
df -h su - apt-get clean all exit df -h
I know this is probably not what you want to hear, but hard drives are incredibly inexpensive these days...- Clouds don't crash - Bertrand Meyer
registered Linux user 393557
finally - hw to brag about - but next year it will look pitifully quaint:
Athlon64 X2 3800 - 1G PC3200 - 250G SATA - ati radeon x300
Tried the graphical logical volume management tool system-config-lvm.
First tried reducing the size of /home. It would not do it because, not unaturally /home was in use and so could not be unmounted. So re-booted into single user mode and started X as root. Then it worked, /home could be unmounted, and I shrunk the /home LVM partition by about 1GB.
So there is 1GB of free space in the logical volume or whatever it is called.
But how to add this to / ? How do I create a situation in which I can use a graphical X thing and still be able to unmount the root partition / ? If / is in use it cannot be unmounted and therefore I cannot add the new, free space to it.
Thanks any help.
You should use Ubuntu LiveCD to manage LVM. iirc, You have to install system-config-lvm in LiveCD mode.
It should work - just mount the cd in the VM before starting it upShould you be sitting wondering,
Which Batman is the best,
There's only one true answer my friend,
It's Adam Bloody West!
The Fifth Continent
For the record.
Suceeded eventually. Used Ubuntu live CD, did not work. I grow increasingly worried about Ubuntu, for what it is worth; who are they? So tried ELive, the enlightenment live CD. Managed it with that.
Trying to install system-config-lvm would not work on either live CD. Ended up using lvm and e2fstools, if that is what it is called. Shrank home partition file system by 1G, then shrank home partion by one gig.
Increased / by 1G and then increased its file system to fit.
Well, wasn't that informative.
My original problem: that could not umount / to resize it is a bit odd; the thing is meant to be able to resize it without unmounting it.
LVM .. First reduce the size of the filesystem: resize2fs -p /dev/mapper/home 4G means reduce the size of the filesystem from its current value to 4G, from memory. Then reduce the size of the partition: lvreduce -L4G /dev/mapper/home. Example of resizing a lvm partition to 50G: server1:~# lvextend -L50G /dev/fileserver/share Extending logical volume share to 50.00 GB Logical volume share successfully resized e2fsck -f /dev/fileserver/share Now expand filesystem to fill the 'partition', and your done. resize2fs /dev/fileserver/share You have to variously unmont things, but not always.
Last edited by lugoteehalt; 07-16-2010 at 04:51 AM.