this post was submitted on 24 Dec 2023
33 points (94.6% liked)

Linux

48051 readers
747 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

This was I can wipe the drive it's on and install a new OS without losing anything in /home/

you are viewing a single comment's thread
view the rest of the comments
[–] blotz@lemmy.world 24 points 10 months ago* (last edited 10 months ago) (2 children)

Log in as root to avoid trying to make sure no files in /home/ are being read/written to.

Step 1: copy data to new drive. Mount new drive to /mnt/. cp -ra /home/* /mnt/. -a means that all permissions remain the same which will mean that your user can still read them. Check the man page for more details. This command will take a while. Use -v to see progress. You should see a folder with your username appear.

Step 2. Prepare /home for new drive. Move the files to a new folder. This is done to make sure you can still easily go back. mv /home/ /home-bak/ keep your old home dir safe in case a mistake was made. mkdir /home/.

Step 3. Mount your new drive. Mount your drive to /home/ and check if you can login. If everything went correctly, you should be able to just login. Finally you need to update your /etc/fstab to include this new drive. This will make sure your home drive mounts when you start your os. If everything is working, you can delete your home-bak as well.

[–] EdgeRunner@lemmy.dbzer0.com 16 points 10 months ago (1 children)

I dont like the MV home. 😅

My advice :

  • login as root.
  • rsync -av /home, on the new disk.
  • fstab : comment the old home's line, don't delete, and copy it to change the identifier (path or uuid).
  • noob tips, add a new file in the new home.
  • login to check it is ok (with su - user), and check there is the new file.

You can now delete or keep it as a save.

[–] blotz@lemmy.world 9 points 10 months ago (1 children)

the mv home is just renaming the folder so you can mount home in the same space. Rsync is probably better than cp but I didn't want to suggest tools that op doesn't have installed.

[–] EdgeRunner@lemmy.dbzer0.com 10 points 10 months ago

Oh ok I see why no use of rsync. Clever.

I've read your solution, OP, you can go. Good tuto written on mobile.

[–] blotz@lemmy.world 5 points 10 months ago

This is a rough guide written on mobile. its probably best if someone double check some of this stuff before op tries it.