3

I have a new laptop with SSD + HDD. I already managed to set up a dual boot with Windows 10 preinstalled and Ubuntu 17.10. Ubuntu root, home and swap directories are all on the SSD. In addition I took 500GB from the HDD and created a partition for my data (I called it /mnt).

Now I want to make the operating system store music, downloads, documents, pictures and videos on the HDD data partition, while maintaining /home on the SSD.

I know it has to do with fstab, so I found the file and a way to edit it, but what am I supposed to do now? The general information is not clear enough for me.

Here is my 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).
#
#                
# / was on /dev/sdb6 during installation
UUID=cbdf87b9-ddf0-4242-a6b3-12ea1f13c653 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sdb1 during installation
UUID=7E53-EFDB  /boot/efi       vfat    umask=0077      0       1
# /home was on /dev/sdb7 during installation
UUID=a78d2329-659f-4d6e-a7e3-c54f08dc5bdb /home           ext4    defaults        0       2
# /mnt was on /dev/sda2 during installation
UUID=193e6f14-a677-4f3e-9373-06f6d12c12f0 /mnt            ext4    defaults        0       2
# swap was on /dev/sdb5 during installation
UUID=e8fe7608-591e-40b2-ab28-603b058c87f9 none            swap    sw              0       0

Can someone guide me step by step?

1

1 Answer 1

6

Best not to use /mnt, but create a new /mnt/data or just /data. You may want other mounts in /mnt and those would remove the data partitions (I have done that in testing a /mnt of something).

After you copy all your data folders like Music to the partition on your other drive. Unmount your temporary mount if it is just temporary.

NOTE: The mount point can be anywhere. If it's in your /home or /media folders it will show up under "Places". If it's directly off "/" or /mnt it will not. I prefer /mnt so I do not see it other than thru the links.

sudo mkdir /mnt/data
sudo chown $USER:$USER /mnt/data
sudo chmod -R a+rwX /mnt/data

Note: The big "X" will also not make files executable unless they were executable to begin with. find your UUID, entry below shows example with UUID, must be yours

sudo blkid

Edit fstab with your UUID, use ext4 or depending on format:

sudo -H gedit /etc/fstab

UUID=a55e6335-616f-4b10-9923-e963559f2b05 /mnt/data ext4 relatime 0 2

Verify entry is ok, if no errors it is, if manually mounted as above unmount first:

sudo mount -a

from home (cd ~ if not at home) so default location of link is in /home/$USER cannot have duplicate entries, so move current to temporary location, repeat for each folder you want to move.

mv Music oldMusic

Music is then also the folder in the partition mounted as /mnt/data

ln -s /mnt/data/Music

Or link all folders with one command:

for i in echo /mnt/data/*;do ln -s $i; done

You can delete oldMusic after you confirm everything is ok.

it then should be this with l as first char for link.

fred@Z170N:~$ ll
lrwxrwxrwx  1 fred fred     15 Jun 10  2017 Music -> /mnt/data/Music/
3
  • Thank you for your detailed answer oldfred. It is way too complicated for me. What is /mnt? Is it more than just a name/label (like /donut)? How can I change it? I am confused with "mount-point". I have the normal home folders (on ssd) like music. Is this supposed to be the mount point. Or do i have to create a new folder on the hdd and that is the mount point? Why is my hdd now copywritten?? I copied the data of my old laptop there, now I can only read.
    – lefuz
    Mar 15, 2018 at 16:45
  • I changed something in fstab. I tried to mount a folder there from hdd. Without UUID, just /dev/sda2/pictures. I am not sure if it is double mounted now, because of additional /mnt (also /dev/sda2). I wanted to try it, now Ubuntu won`t boot at all.... I´m feeling like a baby trying to drive a car. That´s the shit with Linux for inexperienced users... there is a ton of advice and information, but not enough easy step by step solutions (IKEA-like).... Can I save my system somehow???
    – lefuz
    Mar 15, 2018 at 16:45
  • If you edit fstab, you have to run the sudo mount -a as posted above to make sure there are no errors before rebooting. These are the defaults for file structure: en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard Windows just has c: or D: etc.Post the link to the Create BootInfo summary report. Is part of Boot-Repair: help.ubuntu.com/community/Boot-Info
    – oldfred
    Mar 20, 2018 at 0:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .