I just installed a second hard drive. Previously my partition scheme was /dev/sda1 contained the boot files, and /dev/sda2 contained everything else. Now /dev/sda is the new hard drive, and /dev/sdb is the old hard drive. I want to use /dev/sda as my /home partition. So, I created the GPT partition table in /dev/sda with gdisk
(single partition), then I formatted /dev/sda1 with mkfs.ext4
, and then I added /dev/sda1 to my fstab as /home, ext4, "defaults", 0, and 2. I rebooted. I should have rebooted at this point, but I did something stupid and mv
ed my only user folder, mszegedy, to /. I then mount
ed /dev/sda1 in /home, and mv
ed mszegedy back to /home. I then rebooted, to find that /home/mszegedy did not exist. I went looking for it, but I couldn't find any of my files or any folder with the name "mszegedy", so I concluded that I had deleted it. /dev/sda1 was mounted in /home. I tried unmounting /dev/sda1 and remounting it, but the result was the same.
The interesting part is when I tried to useradd -m mszegedy
, no directory named "mszegedy" appeared in /home, and when I tried it again, it said that I already existed. Rebooting turned out the same result. What's going on?
/home/mszegedy
should exist. Are you absolutely sure you didn't misremember one of the steps? What is the output ofdf
now, and offdisk -l
? If you runmount --bind / /mnt; ls /mnt/home
, what do you see?