Change Home Folder Location

1⋅ First some warnings, disclaimers, pieces of advice, questions :

⋅ when you copy paste commands outputs, do it « neutral » and complete using 3xaltgr7 as markups :

django@ASGARD:~$ cat /etc/fstab 
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sdb1 during installation
UUID=25c341fb-320d-4a4a-9d64-b08c5fe55540 /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=22faac8b-34aa-4425-98a7-184d0613ccff none            swap    sw              0       0
# DATA
UUID=b19322e6-8a6d-4e24-b87f-4b0155b41963 /media/DATA ext4 defaults 0 2

django@ASGARD:~$

⋅ try not to skip any question :wink:

⋅ sda is your HDD and sdb is your SSD. I’m a bit bugged that sdb shows no partition and by the /boot/efi location. Those might suggest later issues - be aware your current setup may not be perfect as is.

⋅ partitions sda2, sda3, sda4 host a Windows system ( hence probably the sda1 /boot/efi partition ). Do you still need it ?

Those notes only aim at helping your …helper - me, trying to figure out what you have tried / done so far :slight_smile: Anyway, let’s go back to topic.

2⋅ /home is on HDD right now and not on SSD

from your fstab :

# /home was on /dev/sda5 during installation
UUID=2f5311a1-7d88-408c-8c07-c6e904cf259e /home ext4 defaults 0 2

so that probably meant you had a separate /home partition on your previous Ubuntu installation, right ?
You took that « old » /home and mounted it in replacement of the /home folder on your SSD.
The idea is to undo that, to get back to default situation where /home is just a « normal » folder inside your / root system.

a⋅ first do a backup of the hidden files and folders you’d find inside actual /home/your_user on usb-thumb or any external media or any place you have access to but outside /home ( important ).

b⋅ second have at hand reach an ubuntu iso on usb-thumb or dvd from which you could start a live-session. These two points are just safety tips. We should not need them.

c⋅ then modify your /etc/fstab file to disable the /dev/sda5 mount. Easy, just comment its line like this

# /home was on /dev/sda5 during installation
# UUID=2f5311a1-7d88-408c-8c07-c6e904cf259e /home ext4 defaults 0 2

by adding # at the beginning. We will need to modify again that line later.

d⋅ Reboot. You should be able to login to your user session. This should be « empty » like at first time you login and this is purposely expected. If you can’t login, go to h⋅

e⋅ create a mounting point for your « old /home » named DATA in the /media folder
sudo mkdir /media/DATA
Once in use, things found in /media folder will appear in « devices / other places » in your file explorer.

f⋅ let’s modify again fstab to mount your « old /home » in previously created DATA folder by launching from terminal
gedit admin:///etc/fstab
or from inside terminal
sudo nano /etc/fstab
modify and uncomment line regarding /dev/sda5 like this
UUID=2f5311a1-7d88-408c-8c07-c6e904cf259e /media/DATA ext4 defaults 0 2

g⋅ Reboot. Or just run sudo mount -a in terminal ( which will mount what’s in fstab ). If any error message post it here. You should now find in your file explorer DATA and be able to browse it.
ls -la /media/DATA
ls -la /media/DATA/your_user

h⋅ If you can’t login. Boot your pc from ubuntu live session. Browse to your installed system
/media/ubuntu/123abc456qsd789wxc/home/your_user
and copy there the hidden files and folders previously backed-up. You’d need to do this as root user since live session user is not the owner of the destination place.
Once copied - important ! - if you were the first and only user of the installed system do a
sudo chown -R 1000:1000 /media/ubuntu/123abc456qsd789wxc/home/your_user
Of course 123abc456qsd789wxc is to be replaced by what you’d see on your side.

Then reboot and log into your session and go to e⋅

→ here you should have :
⋅ /home on your SSD
⋅ empty folders in /home/your_user ( Desktop, Documents, Pictures and so on )
⋅ DATA automatically present and mounted at boot in your file explorer.

→ ready to play with links ?

1 Like