Question How do I move only the home directory's data directory to a different partition?

Feb 18, 2019
4
0
10
0
I installed linux mint 19 cinnamon on ssd, but because I have less capacity, I use HDD and SSD together.
Please tell me how to move only the data directory such as home directory download, document, desktop, music etc. to hdd.
I wrote this sentence in a Google translation, I'm sorry if I used rude expressions
 
You can do two things: Move whole /home directory to another volume / partition, or just your home directory. Second option would be easier: from shell prompt, "sudo nano /etc/passwd", locate your record, and change home folder from "/home/myself" to "/anotherhome/myself". Before that, copy your entire data to the new folder. Log out, login in, and you should be done.

Note: I don't know what language you're translating from, but Google did a pretty good job.
 

ex_bubblehead

Glorious
Moderator
You can do two things: Move whole /home directory to another volume / partition, or just your home directory. Second option would be easier: from shell prompt, "sudo nano /etc/passwd", locate your record, and change home folder from "/home/myself" to "/anotherhome/myself". Before that, copy your entire data to the new folder. Log out, login in, and you should be done.

Note: I don't know what language you're translating from, but Google did a pretty good job.
Even easier than that. Move the contents of the /home directory to the new disc then mount that at /home. That's the way *NIX was designed to do it.
 
Feb 18, 2019
4
0
10
0
Thank you for your reply.
I want to move only the data directory to hdd leaving only the program directory of / home directory in ssd. In windows 10 it was easy.Can you do it using a symbolic link?
Or is there a better way? 
It is not wise to move all home directories to hdd.(It is said that it is not advisable to move all home directories to hdd.) Why→https: //forums.tomshardware.com/threads/move-user-folder-from-ssd-to-hdd.2046956/
(In reality though doing this takes away half the benefit of an SSD drive, which is faster boot and loading of programs.)
 
I've already explained how to do it using symbolling links. Let's assume your SSD is /dev/sda (mounted on /), and your HDD is /dev/sdb, (mounted on /bighdd), your login name is "Robert", and your begemoth data is in /home/Robert/hugedata. So, your existing home folder is /home/Robert, and you want to move parts of it to /bighdd/Robert. First, copy (don't move) contents of /home/Robert/hugedata to /boghdd/Robert/hugedata
Code:
$ cp -R ~/hugedata /bighdd/Robert/hugedata
Then, rename the folder (before you delete it)
Code:
mv ~/hugedata ~/hugedata.sav
Finally, create the symbolic link
Code:
ln -s /bighdd/Robert/hugedata hugedata
 
Feb 18, 2019
4
0
10
0
I've already explained how to do it using symbolling links. Let's assume your SSD is /dev/sda (mounted on /), and your HDD is /dev/sdb, (mounted on /bighdd), your login name is "Robert", and your begemoth data is in /home/Robert/hugedata. So, your existing home folder is /home/Robert, and you want to move parts of it to /bighdd/Robert. First, copy (don't move) contents of /home/Robert/hugedata to /boghdd/Robert/hugedata
Code:
$ cp -R ~/hugedata /bighdd/Robert/hugedata
Then, rename the folder (before you delete it)
Code:
mv ~/hugedata ~/hugedata.sav
Finally, create the symbolic link
Code:
ln -s /bighdd/Robert/hugedata hugedata
I will try it from now:)
 
Mar 10, 2019
65
7
45
1
It is not wise to move all home directories to hdd.(It is said that it is not advisable to move all home directories to hdd.) Why→https: //forums.tomshardware.com/threads/move-user-folder-from-ssd-to-hdd.2046956/
While this may be true in windows, it is patently false with Linux. Don't take windows advice and try to apply it to Linux. It just doesn't work very well at all.

Login as root via a console session, with no other user name logged-in.
Move the entire contents of the /home directory over to the drive you want it on.
Edit /etc/fstab to mount the drive partition under the /home directory.
You're done, and your system experience will be seamless despite the move.

One change is all that's needed, instead of littering your filesystem with symbolic links that have to be un-linked and re-linked if you make changes in the future. Aside from that, the contents of /etc/fstab documents the system configuration for you. I doubt that you're going to maintain a system configuration document to keep track of all the symbolic links you might create doing something like this.

Linux has its origins in the UNIX world, and carries its multiuser traits over quite faithfully. While having the /home, /tmp, and /var (as well as other) directories serving as mount points for partitions on physically separate hard drives is usually done at the time of installation, it is a trivial matter to do these kinds of things post install, and that is by design.

BTW: Most programs are installed in /bin, /sbin, or /opt; along with a scattering of directories in /usr. User data files, configuration settings, and vectors to installed programs live in /home; so you aren't going to take a noticeable hit on execution speed by plopping the entirety of /home on a mechanical drive.

If you have a swap partition on a separate HDA, on a different controller channel in a system that is prone to using swap regularly, you enhance the overall system performance.
 
Last edited:
Reactions: ex_bubblehead

ASK THE COMMUNITY