0

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?

Tomáš Pečený
  • 1,407
  • 7
  • 19
  • 45
  • 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 Mar 30 '23 at 14:56
  • See this link for more details how to use several partitions for the system directories. – sudodus Mar 30 '23 at 15:03
  • @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? – Tomáš Pečený Mar 30 '23 at 15:18
  • @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/ – sudodus Mar 30 '23 at 15:21
  • I do not think you are running out of memory you are running out of hard disk space. – David Mar 30 '23 at 16:14
  • @sudodus: I don't understand the -Havn or -Hav parameters, I don't see them in the manual. – Tomáš Pečený Mar 30 '23 at 16:34
  • 1
    @sudodus: Please excuse me, I can already see how the parameters are composed – Tomáš Pečený Mar 30 '23 at 16:39
  • 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. – sudodus Mar 30 '23 at 16:40
  • The procedure is here https://help.ubuntu.com/community/Partitioning/Home/Moving No live USB necessary. I have executed this procedure successfully. – Organic Marble Mar 30 '23 at 18:25

0 Answers0