Find the answer to your Linux question:
Results 1 to 10 of 10
Can't play some *.flv type movie things because it says there is not enough room in tmp, apparently. Installed Debian Lenny on the software computer VirtualBox. Asked the Debian installer ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie lugoteehalt's Avatar
    Join Date
    Jan 2004
    Posts
    232

    LVM how to remove 1GB from /home and add it to /?


    Can't play some *.flv type movie things because it says there is not enough room in tmp, apparently.

    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??

    Code:
    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
    All power is violence; all power is evil.
    Money As Debt

  2. #2
    Linux Newbie lugoteehalt's Avatar
    Join Date
    Jan 2004
    Posts
    232
    Does it follow that nobody else can use LVM either? Doesn't say much for the whole rationale of the thing.
    All power is violence; all power is evil.
    Money As Debt

  3. #3
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    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.
    Code:
    df -h
    su -
    apt-get clean all
    exit 
    df -h
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  4. #4
    Linux User twoHats's Avatar
    Join Date
    Jan 2005
    Location
    NH, USA
    Posts
    280

    Hard drive

    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
    circa 2006

  5. #5
    Linux Newbie lugoteehalt's Avatar
    Join Date
    Jan 2004
    Posts
    232
    Quote Originally Posted by twoHats View Post
    I know this is probably not what you want to hear, but hard drives are incredibly inexpensive these days...
    It's a virtual hard drive, that's why it's so small. Err, if that follows.

    Thanks both. Had been using apt-get clean, so I'll stick all at the end from now on.
    All power is violence; all power is evil.
    Money As Debt

  6. #6
    Linux Newbie lugoteehalt's Avatar
    Join Date
    Jan 2004
    Posts
    232
    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.
    All power is violence; all power is evil.
    Money As Debt

  7. #7
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    You should use Ubuntu LiveCD to manage LVM. iirc, You have to install system-config-lvm in LiveCD mode.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  8. #8
    Linux Newbie lugoteehalt's Avatar
    Join Date
    Jan 2004
    Posts
    232
    Quote Originally Posted by devils casper View Post
    You should use Ubuntu LiveCD to manage LVM. iirc, You have to install system-config-lvm in LiveCD mode.
    Thanks! The hard drive in question is a virtual hard drive inside VirtualBox. It is not obvious therefore that it is possible to use a live CD.

    I could give it a try but it seems highly improbable it would work.
    All power is violence; all power is evil.
    Money As Debt

  9. #9
    Penguin of trust elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    3,534
    It should work - just mount the cd in the VM before starting it up
    What do we want?
    Time machines!

    When do we want 'em?
    Doesn't really matter does it!?


    The Fifth Continent

  10. #10
    Linux Newbie lugoteehalt's Avatar
    Join Date
    Jan 2004
    Posts
    232
    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.

    Edit:
    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.
    All power is violence; all power is evil.
    Money As Debt

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •