Don’t Understand How To Re-partition This Setup Or Why It Was Made Like This

Home » CentOS » Don’t Understand How To Re-partition This Setup Or Why It Was Made Like This
CentOS 5 Comments

Hello,

I did df -h on my CentOS 6.4 machine.

$ df -h Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_ysg-lv_root
47G 8.8G 36G 20% /
tmpfs 948M 372K 947M 1% /dev/shm
/dev/sda1 485M 62M 398M 14% /boot
/dev/mapper/vg_ysg-lv_home
4.6G 2.7G 1.7G 63% /home

What I don’t understand is why is /home so tiny and how can I re-partition this without having to nuke and rebuild my machine?

5 thoughts on - Don’t Understand How To Re-partition This Setup Or Why It Was Made Like This

  • You’d have to resize the logical volumes your FS lives on (here:
    vg_ysg-lv_root and vg_ysg-lv_home) and resize the FS as well.

    Can be done booting off a rescue medium w/o any problems. Make sure you do have a complete backup, though.

    HTH,

    Timo

  • Yves S. Garret wrote:
    You can – in fact, that’s what we do here at work… BUT: we have *all*
    home directories NFS mounted, and we do online backups on mounted filesystems that are NOT /. It’s really ugly when /var/log fills up /

    mark

    PS: please don’t top post.

  • I doubt anyone can tell you why /home is so tiny. But depending on the filesystem used, you may be able to resize on the fly, without even needing a reboot. The LVM HOWTO is a bit out of date, but describes the process here:

    http://www.tldp.org/HOWTO/LVM-HOWTO/extendlv.html

    Growing XFS filesystems online is required; they can’t be grown offline. Growing ext4 online should be easy, but I’ve only tested it once in CentOS 6. As Timo notes, you should have a backup before proceeding in any case.

    I believe there are GUI tools to manipulate LVM and filesystems
    (system-config-lvm IIRC), but I haven’t used this tool so can’t give you any helpful guidance.

    You can put everything on one filesystem if you wish. This is mostly a matter of personal taste for many desktop uses (and some server uses).

    –keith

  • what do you get from

    # vgs

    ?

    if there’s VFree, you can lvextend the backing LV behind /home, then grow the file system to use that additional space.

    # lvextend -L +8G vg_ysg/lv_home
    # resize2fs /home

    if there’s no VFree, and you want everything in / you could reboot to single user mode, and do something like…

    # cd /
    # mkdir /home2
    # mv /home/* /home2 # this will take awhile
    # umount /home
    # rmdir /home
    # mv /home2 /home

    and vi /etc/fstab and remove the mount for /home

    now, you can lvremove vg_ysg/lv_home to free up the space it used
    (will probably need a –force), then lvextend the vg_ysg/lv_root volume, and grow /that/ file system to suit.

    note. I typed all that off the top of my head. TRUST NOTHING, VERIFY
    EVERYTHING, UNDERSTAND THE MEANING OF EVERY COMMAND YOU ARE DOING!!!
    Caveat Emptor.

LEAVE A COMMENT