I have two logical volumes, one is mounted as /, the other is mounted as /home.

I want to combine them, because the / volume is constantly running out of space. (Yes, I know what's using all that space; no, I can't remove it.)

I'm willing to take the machine down for a day or two to do it.

OS: Linux xxxxx 2.6.32-279.22.1.el6.x86_64 #1 SMP Wed Feb 6 03:10:46 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux (CentOS)

  • 1
    Why not just grow the / volume, isn't that the point of using LVM?
    – jasonwryan
    Mar 13, 2013 at 19:53
  • 2
    @jasonwryan Why should I need to manually adjust how disk space is allocated? Isn't that the whole point of a filesystem?
    – Nick ODell
    Mar 13, 2013 at 19:56
  • @NickODell No. If one volume is too small to hold the data, then it's just too small. Overall capacity is a factor of volume size, not filesystem size. Logical volumes do make it easier to resize the mounted volumes and to merge disparate storage resources into a single volume, though. With LVM you should be able to do what jasonwryan is suggesting without even rebooting: make sure regular users are logged off (to free /home) umount /home lvreduce it (don't forget -r) re-mount it then do an lvextend on the root filesystem and you're done. If you want to merge you have to do an rsync.
    – Bratchley
    Mar 21, 2013 at 13:10
  • @JoelDavis If I require that all users to log out, is it relevant whether need to I reboot?
    – Nick ODell
    Mar 21, 2013 at 20:44
  • @NickODell Um...yeah? Most linux systems are servers, you should realize that will be people's assumption unless you say otherwise.
    – Bratchley
    Mar 21, 2013 at 23:57

4 Answers 4


I'm done, and the re-partition worked. However, since there are missing areas in both guides, I am going to summarize what I did. Please note that I have replaced my username with zzzz and the name of my computer with xxxxxxx. Also, all commands should be run as root unless otherwise noted.

First, I backed up:

tar -zcvf /media/e14be279-8c11-450a-b52c-1493cff3c632/xxxxxxx-home.tar.gz --exclude=/home/zzzz/Downloads /home

This creates a compressed backup of the /home directory, and puts it on my external drive. (Note that your external drive will have a different path.)

Now, you need to reboot into single-user mode.


When your computer turns on again, you need to look for a screen like this:

Booting Centos 2.6.32-279.22.1.el6.x86_64 in 3 seconds...

Press any key to interrupt that. You should see a screen like this:

grub boot centos Press a, then Space, then type single. Hit enter.

You should see a prompt like this:

 [root@xxxxxxx /] # 

Enter the following commands:

df -h

It should show you Size, Used, and Avail. We're interested in Used.
Write down how much space is in use by your home volume. We'll need that later.

umount /home
e2fsck -f /dev/mapper/vg_xxxxxxx-lv_home

Remember how much space your home volume used? Double that, and give it to this command. For example, I had 15 gigabytes used by my home directory, so I sized it to 30 gigabytes.

resize2fs /dev/mapper/vg_xxxxxxx-lv_home 30G

Warning: This next step is the one that can lose data. Make sure that you put in a size larger than the previous command. Add 5 Gigabytes to be sure.

lvresize -L 35G vg_xxxxxxx/lv_home

Tell the root partition to use all that space we just freed up.

lvresize -l +100%FREE vg_xxxxxxx/lv_root
resize2fs /dev/mapper/vg_xxxxxxx-lv_root

Copy your data to the root partition

mount -t ext4 /dev/mapper/vg_xxxxxxx-lv_home /mnt/home
ls /mnt/home
cp -a /mnt/home/. /home/

(By the way, that -a is important, because otherwise everything will be owned by root, and you don't want that.)
Do a quick check that the data copied correctly:

ls -lR /home

Now we remove the home partition, and tell root to take the new space again.

umount /mnt/home
lvremove /dev/mapper/vg_xxxxxxx-lv_home
lvresize -l +100%FREE vg_xxxxxxx/lv_root
resize2fs /dev/mapper/vg_xxxxxxx-lv_root

At this point, I made a big mistake, one which you can learn from. I rebooted, and when the system came back up, it refused to mount my root partition as read-write because it couldn't mount my /home partition. So, before we reboot, we type

nano /etc/fstab

One of those lines will tell the system to mount the /home partition. Put a # before it. Press Ctrl-O, Enter, Ctrl-X. Now you can reboot.

(Hypothetically, if you were to forget to edit fstab like I did, the command to mount your root partition is mount -n -o remount -t ext2 /dev/vg_xxxxxxxx/lv_root /)

  • love the detail!
    – nmr
    Oct 19, 2015 at 6:51
  • I've run into a similar problem, but I don't have physical access to the machine. Is there a way to do this that doesn't require booting into single-user mode? Feb 5, 2019 at 21:24
  • @FrustratedWithFormsDesigner Theoretically, yes. If you have ssh access, you can back up your /home. Then, as long as you can unmount /home, you can remove it. However, I'm not really qualified to talk you through the process. This is something you should ask a new question about.
    – Nick ODell
    Feb 5, 2019 at 22:41
  • 1
    @NickODell: I did ask a new question: askubuntu.com/questions/1115913/… Feb 6, 2019 at 15:19
  • @FrustratedWithFormsDesigner That's much better advice than I could have given you.
    – Nick ODell
    Feb 6, 2019 at 16:35

WARNING: Backup all critical data before doing anything!

You would need to move all the data from the /home partition to another partition, local partition or external drive or wherever other place you have enough space.

Remove the /home lv and then expand the / (root) lv

Copy the data back to /home directory

Edit 1

The answer above is assuming you don't have enough space in the root partition to place the data in the home partition.

If this is not the case, just mount the home partition somewhere else and copy the data, for example:

umount /home
mount /dev/mapper/lv-home /mnt/home
cp -a /mnt/home/. /home/

Then just remove the home partition and expand the root partition


You can do it without any external storage, running from /, but you will need to unmount /home.

This isn't a particularly risky procedure if you're careful, but nonetheless, the standard advice applies: make backups first, and test them.

I'll use foo for the volume group name, and root and home as the logical volume names. This makes the logical volume paths foo/root and foo/home, and the device paths /dev/mapper/foo-root and /dev/mapper/foo-home. I assume that they are in the same volume group, otherwise this gets more complicated and is dependent on the physical volume layout of the two volume groups.

First, unmount /home and run e2fsck -f /dev/mapper/foo-home. Then shrink the filesystem first, and the logical volume accordingly. Run resize2fs /dev/mapper/foo-home NNNN where NNNN is the number of blocks you want to retain inside the volume (you can use kB or MB or GB instead with the suffix K, M or G). After shrinking the filesystem, shrink the logical volume with lvresize -L MMMM foo/home where MMMM is a number of megabytes (note that the default unit is different from resize2fs, but you can use the same suffixes K, M, G). Be very careful not to shrink the logical volume further than the filesystem — this is the one dangerous step in this procedure.

There is now unused room in the volume group. Run lvresize -l +100%FREE foo/root to make the root volume grab all the free space in the volume group. Then run resize2fs /dev/mapper/foo-root (with no size parameter) to enlarge the filesystem to span the whole logical volume; enlarging can be done while the volume is mounted.

You now have room to copy some files. If you don't have enough room for everything, move as much as you can, then repeat the procedure.

Once you've copied all the files out of /home, you're ready to destroy it. Verify that /home is empty (if you moved the files) or that all the files in /home have been copied to /root (if you copied the files). To destroy the now-unneeded logical volume, run lvremove foo/home. Finally, enlarge the root volume with lvresize -l 0%FREE foo/root and its filesystem with resize2fs /dev/mapper/foo-home.

  • Note: /home refused to unmount until I rebooted into single-user mode.
    – Nick ODell
    Mar 14, 2013 at 1:59
  • Note: It's referred to as vg_(machine name) and lv_home
    – Nick ODell
    Mar 14, 2013 at 2:19
  • Ok, I got it working. There were a few details missing from this guide though, so I'll post my full command history soon.
    – Nick ODell
    Mar 14, 2013 at 3:37

OK, I found myself in exactly the same position. It seems CentOS creates a small root volume by default and fills the remainder of your space with /home. I even tested my setup first in a VM but with the smaller disk CentOS didn't create the home volume. I picked up on this problem before becoming space constrained tho' and also figured how not to have to enter single user mode. As follows:

Get access to the machine, ssh is fine (assuming non-root user).

  1. cd / so you're not in the home directory
  2. sudo -s we'll be root for all of this
  3. lsof /home check that no one is using the home volume, shouldn't be
  4. mv, tar, or similar the contents of home to somewhere else
  5. lvremove centos/home
  6. Edit /etc/fstab and comment out or remove the line for /home
  7. Move the contents of home that you backed up before back into /home - you are now at a safe position, a reboot here should be OK
  8. lvresize -l +100%FREE centos/root
  9. xfs_growfs /dev/centos/root on CentOS 7, others might use resize2fs
  10. df -h have you succeeded?

Hope this makes it easier for someone. It really is quite amazing what you can do live on filesystems these days.

  • It's definitely easier if you don't need to migrate any data. :)
    – Nick ODell
    Apr 18, 2015 at 8:06
  • Damon you're kicka$$! Thanks for making that as standard as possible. 6 years later and CentOS 7.9 default installation by another admin was causing me grief, I normally use Debian and EXT4 with LVM so your last step with xfs_growfs was very convenient and accurate. For those who don't know what type of fs they have "df -T" will tell you.
    – Tmanok
    Sep 9, 2021 at 1:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .