6

I have a desktop PC running Arch Linux that during inital installation only used a 120GB SSD for / and no other partitions. I have just recently added a 500GB HDD that I want to mount as /home to give me added storage, avoid future issues with compiling on an SSD, and help with easier upgrades in the future if I ever change anything but want to retain the same /home.

Prior to this my fstab read:

# <file system> <dir>   <type>  <options>   <dump>  <pass>
/dev/sda1               /           ext4        rw,data=ordered,noatime,nodiratime,discard,erros=remount-ro 0 1

When preparing for the upgrade I copied all of /home to the new partition then renamed /home to /home_old and created a new, empty /home then modified /etc/fstab to read:

# <file system> <dir>   <type>  <options>   <dump>  <pass>
/dev/sda1               /           ext4        rw,data=ordered,noatime,nodiratime,discard,erros=remount-ro 0 1
/dev/sdb1               /home           ext4        rw,nodev,nosuid,erros=remount-ro    0 2

... Which at the time were the correct partition names.

However, I rebooted and it mounted the SSD as / and /home. I tried it with UUIDs and received the same result.

Just for the sake of trying, I switched the two and it fell back to an emergency console at boot time. Again tried with UUIDs with the same result.

If I go back to the old version of /etc/fstab now, it shows the SSD as /dev/sdb1 and the HDD as /dev/sda1 but still mounts the SSD as /, which I find VERY strange.

My question, given the backstory now, is how do I fix this issue and why is it behaving this way so I can understand what's causing this?

EDIT:

As Timothy Martin pointed out in the comments I made a typo in fstab and it turns out that's what caused it. More proof that weird things occur when you make a mistake in your configuration files.

sheepish grin

  • Congratulations on a lucid and clearly written question. The correspondence of hard disks with device names is usually very stable. The behavior you describe does indeed seem odd. I'd start by taking a look at boot logs, specifically dmesg. I'd compare them for different configurations. This isn't very helpful, but nothing else comes to mind at the moment. – Faheem Mitha Mar 22 '16 at 19:01
  • Can you paste the output of lsblk -f into the question? This is as good a way as any of displaying the partitions and filesystems. – Faheem Mitha Mar 22 '16 at 19:11
  • 2
    @FaheemMitha correspondence between device names and hard disks isn't stable (especially with multiple controllers, USB disks, and Firewire disks), that's why UUIDs are used nowadays. – derobert Mar 22 '16 at 19:57
  • Apparently I'm out of date. Can you post how you wrote /etc/fstab using UUIDs? – Faheem Mitha Mar 22 '16 at 20:25
  • 1
    Is the erros= intentional? The only documentation I can find says errors=. – Timothy Martin Mar 22 '16 at 21:33
5

Create a temporary Home folder

blkid

This will display the UID of all the partitions. Record the UUID of the dd

Open a terminal and type the following:

 vi /etc/fstab

and add the following line to the end of the file.

UUID=xxx-xxxxx-xxxxx   /media/home    ext4          nodev,nosuid       0       2

save and exit

Next, create a mount point:

 mkdir /media/home

and reload the updated fstab.

mount -a

we need to remove the existing Home folder to make way for the new Home folder in the 500 GB partition . To do that, type the following commands in the terminal:

cd /
sudo mv /home /home_backup
sudo mkdir /home

Mount the new Home folder

vi /etc/fstab

All you have to do is to change the /media/home to /home . Save and exit the file. reload the fstab file:

mount -a

removing the Home_backup folder

 rm -rf /home_backup
  • I can't figure out what you're doing here. Why edit fstab multiple times? Why are you temporarily mounting something on /media/home? – Gilles 'SO- stop being evil' Mar 22 '16 at 21:36
  • I have gone back and edited my original post to point out my mistake. For future viewers I am marking this as the correct answer as it is correct and would have worked had I not made a stupid mistake. – user66330 Mar 22 '16 at 22:59

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.