I recently got my first Unix Dedicated Sever running CentOS

I just ran df -h and found this:

Filesystem            Size  Used Avail Use% Mounted on
                      2.2T  1.5G  2.1T   1% /

My Server has 2 x 1TB Hard-drives, as you can see they're both mounted onto the root directory.

How do I unmount the secondary Hard-Drive and Re-mount it as /home2 (so it can be used to backup the primary hard-drive daily)

Thanks in advance.


You will need to resize the root filesystem (resize2fs) to 1TB or less, then resize the logical volume (lvresize / lvreduce), and remove the second hard drive from the volume group (pvmove followed by vgreduce). If you're just starting, it could be easier to get the server provider to reinstall the OS.

The Arch Wiki has examples on modifying LVM volumes using the command line: https://wiki.archlinux.org/index.php/LVM#Configuration

  • The link is great, thanks. I keep getting the error that the device is mounted and that "on-line resizing required". And I cannot unmount the "/" because the devices are using it. What can I do? – Moe Feb 19 '12 at 15:03
  • Get the server provider to reinstall :) Or ask for KVM/IP access and a rescue CD to boot from. – lmz Feb 19 '12 at 15:05
  • I ended up getting my host to reload the OS with the partition requirements. Thanks. – Moe Feb 19 '12 at 20:54

This doesn't really answer your question directly, but is probably a better approach if I understand what you're trying to do correctly.

If you intend to use the second hard drive to backup the primary drive everyday, would it not be better to run the hard drives in a RAID-1 configuration? RAID-1 writes the data to both drives simultaneously - you can boot the system, even if all the drives (except 1) fail (so one drive can also be used to "build" another into the array, in-case one dies).

If you do not have a RAID card, this can also be achieved using software RAID, configured during the CentOS installation. This documentation is slightly outdated, but will get the job done: Configuring Software RAID

  • RAID 1 is a good idea to improve reliability, but RAID is not backup. – lmz Feb 19 '12 at 15:33
  • 1
    Yes, but he didn't say what exactly he wanted to backup. If the second drive will be an almost mirror of the first drive, it would probably be better to use RAID anyway. It isn't like the second drive would be detached from the host when not being used to backup, so it doesn't offer any advantages over a RAID implementation (unless it is a partial backup, and the rest of the free space might be used to store other things). – Josh Feb 19 '12 at 15:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.