Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have formatted my hard disks so that /home sits in one separate disk. Now that disk has become faulty. I am wondering whether it is possible to replace only that disk and make a new /home partion on a new disk, so that I can avoid a complete reinstall of the OS? (I know that almost all my user data will be lost)

share|improve this question

1 Answer 1

up vote 7 down vote accepted

Answer is yes, you don't need to re-install OS. You can create a new partition (block device like /dev/sdb2) and use it for /home. You can also copy the data in old /home over if you have a good backup or the old home is still readable.

In your case, it seems that the old /home (disk) became faulty. You want to use a new partition or new disk for /home. It is fine and you don't need to re-install the OS.

Steps in brief (recommend doing this using a LIVE CD, you don't HAVE TO though):

  1. create partition for /home
  2. create file system (e.g. ext4) => mkfs.ext4 /dev/sdb2
  3. mount it as /home => for example => mount -t ext4 /dev/sdb2 /home
  4. mount your old home if it is still mountable, e.g. mount -t fs_type /dev/sdaX /mnt/old_home otherwise you'll have to restore data from a good backup
  5. Use rsync to copy data, e.g. from a backup mounted as /backup/home rsync -axHAX --progress --verbose /backup/home/ /home
  6. Remember to edit your /etc/fstab and update the block device/FS for new /home

Reboot and you should be good to go;-)

share|improve this answer
2  
You might want to run the rsync command with sudo to preserve ownership information too. –  Jeremy Kerr Nov 15 '12 at 3:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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