2

Following a default minimal installation of 18.04, I now want to move my /home directory to an EXT4 formatted USB flash drive.

By default in 18.04 the /home directory is mounted as part of the / partition.

Is there a clean and safe way to move/reconfigure my /home directory to the USB flash drive, or would it be cleaner/safer to reinstall Ubuntu and configure the /home directory on USB during the install process? Or, is having your /home folder on a separate USB drive ill-advised?

I've looked at many similar questions/answers, but can't find a contemporary clean and clear solution.

Broadsworde
  • 4,132
  • 4
  • 28
  • 45
  • 3
    Don't. Just don't. Just use the normal tools to move your --directories-- to the USB. See ~./config/users-dirs.dirs. Leave home on a fixed disk. If the USB ever errors out and does not mount you are screwed: and need to fix the problem outside your installation :P – Rinzwind Aug 03 '18 at 12:53
  • @Rizwind I appreciate your candor, tx – Broadsworde Aug 03 '18 at 12:56
  • By the way, there is no directory named Home in a regular Linux installation. You may be thinking of /home. – AlexP Aug 03 '18 at 13:20
  • mkusb now has an easy to use option for backing up home directories on a persistent flash drive. I generally use grsync, (GUI rsync), for copying home directory. After you can edit /etc/fstab to add the UUID of the new home partition. The guide timanix shows is good. See also https://askubuntu.com/questions/991189/using-existing-home-directory-from-a-bootable-external-drive – C.S.Cameron Aug 03 '18 at 16:46

1 Answers1

1

Copy home to Portable USB drive

Format flash drive to ext4.

As root use Grsync to copy home/{username} from internal drive to the flash drive. Preserving owner, permissions and group works for me.

enter image description here

Copy or write down UUID of the new partition.

Edit /etc/fstab on the internal drive to add the /home UUID:

UUID={UUID from above} /home   ext4    defaults        0       0

It might be a good idea to use an encrypted home when traveling.

Thanks to ubfan1 for hint

C.S.Cameron
  • 19,519
  • 2
    You can delete the answer for now, and undelete it when ready. – wjandrea Aug 03 '18 at 17:28
  • In the past I have spent days making an answer just to have the thread closed before I could post it. I prefer to reserve a spot if I see :"possible duplicate" in the comments. – C.S.Cameron Aug 03 '18 at 17:48
  • 2
    @C.S.Cameron For the future, if this is not a full complete answer, then you should not post it as an answer just to "reserve a spot". That's not how the system works. – Thomas Ward Aug 03 '18 at 20:37
  • 2
    Thanks @ Thomas Ward: Is there a way to post, delete and resurrect an answer? If I spend the time researching and writing and testing an answer I would like to know that I can publish it. – C.S.Cameron Aug 03 '18 at 21:02
  • @C.S.Cameron That would be a good question for [Meta], I think. – wjandrea Aug 04 '18 at 16:07
  • Thanks a lot @wjandrea: I asked on Meta and have gotten at least one down vote so far, but I feel more coming. – C.S.Cameron Aug 04 '18 at 21:43
  • The advice you gave as a comment on the question might be better incorporated into your answer. (Also, I'm slightly surprised, given that you were apparently keen to answer it, that I'm the first one to upvote the question ;) ) – Zanna Aug 05 '18 at 14:05
  • @Zanna: What part of the comment did I not use? At the time I was hoping to come up with a slightly more exciting answer. I guess there are just not that many people who need to carry home around on a pen drive. Maybe I should load a few screen shots. – C.S.Cameron Aug 05 '18 at 16:38
  • I was thinking of the tantalising suggestion about mkusb :) – Zanna Aug 05 '18 at 16:49
  • Why bother? Sudodus will probably just beat me to it. However you are right, dus home backup and restore makes it easy to back up home, create a home-rw persistent partition and upgrade persistent drives from one version to another. – C.S.Cameron Aug 05 '18 at 16:56