大网数据广告活动
服务器运维问答

How to reconfigure /dev/mapper space?

· 52CE 我爱测

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 Ava…

问题原文

原帖链接 · bayman · CC BY-SA 3.0

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

已采纳解答

原帖链接 · Zoredache · CC BY-SA 3.0

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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-05-08)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。