Score:0

Is it possible to move the /home directory without reinstalling the whole computer?

sh flag

I have Ubuntu 18.04 on a 50 GB SSD partition (+9.9 GB swap). I also have a mechanical drive with >= 105GB free Ext4 partition in that computer. I'm running out of space on that SSD partition. I'd like to move the entire /home folder to that mech drive. How would I do that?

sudodus avatar
jp flag
The 'standard' way would be to use a separate home partition and specify a separate line in `/etc/fstab` for that purpose: `/home` corresponding to `/` in the line for the root partition in field #2 according to `man fstab`.
sudodus avatar
jp flag
See [this link](https://help.ubuntu.com/community/DiskSpace) for more details how to use several partitions for the system directories.
Tomáš Pečený avatar
sh flag
@sudodus: I assume the use of the Live system. How to correctly copy the contents of the old /home folder to the new partition while preserving the appropriate attributes?
sudodus avatar
jp flag
@TomášPečený, Yes, it is a good idea to use a live system. I would copy with rsync: `sudo rsync -Havn source/ target/`; The trailing slash after the source directory is important. See `man rsync` for more details. Remove the option `n` when you see that the 'dry run' looks good to do the real thing: `sudo rsync -Hav source/ target/`
David avatar
cn flag
I do not think you are running out of memory you are running out of hard disk space.
Tomáš Pečený avatar
sh flag
@sudodus: I don't understand the -Havn or -Hav parameters, I don't see them in the manual.
Tomáš Pečený avatar
sh flag
@sudodus: Please excuse me, I can already see how the parameters are composed
sudodus avatar
jp flag
H - copy hard links as hard links, a - archive (keep time, ownership and permissions), v - verbose (print which files are copied, in dry run, which files to be copied), n - dry run.
Organic Marble avatar
us flag
The procedure is here https://help.ubuntu.com/community/Partitioning/Home/Moving No live USB necessary. I have executed this procedure successfully.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.