0

I'm a real newbie with Linux and Ubuntu.

I bought an Asus laptop with 2 HDD. An SSD 256Go where I installed Ubuntu and and an HDD 1To.

I just want to move personnal files from my SSD to HDD.

This seems like a very common task but I don't know how to do it.

EDIT

lsblk command

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0    7:0    0  14,5M  1 loop /snap/gnome-logs/45
loop1    7:1    0     4M  1 loop /snap/gnome-calculator/352
loop2    7:2    0    91M  1 loop /snap/core/6350
loop3    7:3    0  34,6M  1 loop /snap/gtk-common-themes/818
loop4    7:4    0  1008K  1 loop /snap/gnome-logs/57
loop5    7:5    0   2,3M  1 loop /snap/gnome-calculator/260
loop6    7:6    0    13M  1 loop /snap/gnome-characters/139
loop7    7:7    0   3,7M  1 loop /snap/gnome-system-monitor/70
loop8    7:8    0    59M  1 loop /snap/notes/4
loop9    7:9    0  35,3M  1 loop /snap/gtk-common-themes/1198
loop10   7:10   0 140,7M  1 loop /snap/gnome-3-26-1604/82
loop11   7:11   0  89,3M  1 loop /snap/core/6673
loop12   7:12   0  53,7M  1 loop /snap/core18/782
loop13   7:13   0  14,8M  1 loop /snap/gnome-characters/206
loop14   7:14   0   3,7M  1 loop /snap/gnome-system-monitor/57
loop15   7:15   0 140,7M  1 loop /snap/gnome-3-26-1604/74
sda      8:0    0 931,5G  0 disk 
└─sda1   8:1    0 931,5G  0 part 
sdb      8:16   0 238,5G  0 disk 
├─sdb1   8:17   0   260M  0 part /boot/efi
├─sdb2   8:18   0    16M  0 part 
├─sdb3   8:19   0 146,3G  0 part 
├─sdb4   8:20   0   800M  0 part 
└─sdb5   8:21   0  91,2G  0 part /

1 Answers1

1

The ssd will have your system files including /home, /home/$USER/ and all your personal files in there. The hdd will be mounted at a mountpoint. I used /discworld as an example and it will look like this (important: everywhere I use "discworld" you need to change it to your mount point):

/
/discworld

Open a terminal and 1st make a backup of your /home/$USER/

sudo chmod -R $USER:$USER /discworld
cd ~ 
tar cvz /home/backup /home/$USER/*
cp ~.config/user-dirs.dirs ~.config/user-dirs.dirs.old
  • That last one is a settings file that points to all your user directories and we will use this.
  • The 2nd one is a backup of your current files. If you have a lot of videos that might be a large file so if you are confident to do without a backup feel free. But it is recommended ;)
  • The chmod will change the permissions of your hdd to your user.
  • Confirm with ls that it will show directories like Pictures, Downloads (they might be in a different language if you do not use English) and you are in the correct place before proceeding.

Before moving your files all over do a ...

gedit ~.config/user-dirs.dirs

and change the directories to this

XDG_DESKTOP_DIR="/discworld/Desktop"
XDG_DOWNLOAD_DIR="/discword/Downloas"
XDG_TEMPLATES_DIR="/discworld/Templates"
XDG_PUBLICSHARE_DIR="/discworld/Public" 
XDG_DOCUMENTS_DIR="/discworld/Documents"
XDG_MUSIC_DIR="/discworld/Music"
XDG_PICTURES_DIR="/discworld/Pictures"
XDG_VIDEOS_DIR="/discworld/Videos"

Save it and then move all your directories to the mount point:

mv -R Documents Music Pictures Templates Videos Desktop Downloads  Public /discworld/ 

On the desktop do a control-f5 or a "organize desktop by name" and it will reload the desktop. In your "files" (Nautilus) you can replace the defaults with the new directories.

If you ever decide to re-install: format / and /home but MOUNT the HDD without a format and it will automatically add the mount point to your fresh installation.

Rinzwind
  • 309,379