Linux – How to reconfigure /dev/mapper space

fedoralinux

I'm not understanding the output of /dev/mapper.

Is the 146G allocated for /home taken from the 350G that's allocated for / ?

If they are seperate, how do I reconfigure /home to 46G and / to 450G?

# df -h
Filesystem                                Size  Used Avail Use% Mounted on
devtmpfs                                   32G     0   32G   0% /dev
tmpfs                                      32G     0   32G   0% /dev/shm
tmpfs                                      32G  620K   32G   1% /run
tmpfs                                      32G     0   32G   0% /sys/fs/cgroup
/dev/mapper/fedora-root                   350G  284G   67G  82% /
tmpfs                                      32G  220K   32G   1% /tmp
/dev/sda1                                 477M  120M  328M  27% /boot
/dev/mapper/fedora-home                   146G  1.1G  145G   1% /home
tmpfs                                     6.3G     0  6.3G   0% /run/user/1004

Best Answer

The /dev/mapper/* devices are used for more advanced things like LVM dm-crypt and other advanced block devices. Given the naming of the devices I would bet your system is using LVM, and has a volume group named fedora, and two logical volumes root, and home. You can verify you are using LVM by looking at the output of pvs, vgs, and lvs these list the physical volumes, volume groups, and logical volumes.

Shrinking a logical volume is pretty tricky to do safely. But, since fedora-home is only use 1.1GB of storage you could make a backup of the data from home into another directory under your root filesystem. Then unmount and remove the home logical volume. After that, you could expand the root logical volume and filesystem. If you want, you could also re-create another home logical volume.

When using LVM, you really should only allocate space to volumes as needed. So after making removing, and recreating a small home, and expanding the root volume, you should leave some free space, don't allocate everything to one or the other. Only allocate what you need, that way you could expand either as needed.

As always, before you change things too much it is always a good idea to verify that you have good backups. It is also a good idea to play around with LVM in a test VM or something first. That way are sure the commands you plan on using are the correct ones.