this post was submitted on 07 Nov 2024
27 points (100.0% liked)

Linux

48331 readers
493 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
 

I'm looking to upgrade drives on two of my machines. My server running ubuntu has a 3.5" and will be getting a larger capacity HDD, while my personal computer running endeavor OS will be going from a 2.5" ssd to an nvme drive. (Not sure if it helps giving the drive types, but can't hurt).

I'm fine with a clean install and reinstalling everything, but to save some time I'd of course like to minimize the effort that goes into it (importing settings etc). Any tips/tricks for either? Thanks in advance

top 21 comments
sorted by: hot top controversial new old
[–] stuner@lemmy.world 11 points 2 weeks ago* (last edited 2 weeks ago) (2 children)

If you don't want to reinstall the OS, you can probably use Clonezilla: https://clonezilla.org/show-live-doc-content.php?topic=clonezilla-live/doc/03_Disk_to_disk_clone

Maybe you need to update the drive ids for your bootloader (grub) afterwards, not sure about that.

Edit: Maybe the advanced "-g auto" option does that for you.

[–] syaochan@feddit.it 3 points 2 weeks ago

Clonezilla can also update grub. Last time I upgraded system drive I had to do nothing.

[–] Nednarb44@lemmy.world 3 points 2 weeks ago (1 children)

This is looking like a good option, thanks!

[–] mortimer@lemmy.world 3 points 2 weeks ago* (last edited 2 weeks ago) (1 children)

Try Foxclone. I prefer it over Clonezilla.

https://foxclone.org/

[–] richieadler@lemmy.myserv.one 3 points 2 weeks ago (1 children)
[–] mortimer@lemmy.world 3 points 2 weeks ago (1 children)

I find the UI pretty slick. No confusion over what needs to be done. All the tools are there plus I had to rely on it recently to get one of my machines back up and running. It worked flawlessly and restored everything from the backup images like my system had never been down.

[–] richieadler@lemmy.myserv.one 1 points 2 weeks ago

Good points. I'll have to try it.

[–] savvywolf@pawb.social 7 points 2 weeks ago

When I've needed to transfer data over to a new disk, I've used gparted from a live usb to copy/paste partitions directly. Once that's done, you'll probably need to update /etc/fstab to point to the new drives and run update-grub (assuming you are using grub) to update the bootloader config.

[–] schizo@forum.uncomfortable.business 7 points 2 weeks ago* (last edited 2 weeks ago) (2 children)

dd then resize the fs?

Edit: one caveat here I forgot: if your fstab is using UUIDs, you're going to have to update that, since the new drive won't be the same UUID because, well, it's not the same drive.

[–] Nednarb44@lemmy.world 3 points 2 weeks ago (1 children)

Any help with the acronyms? I'm still pretty new to Linux

[–] schizo@forum.uncomfortable.business 4 points 2 weeks ago (2 children)

two commands: dd and resize2fs, assuming you're using ext4 and not something more exotic.

one makes a block-level copy of one device to another like so: dd if=/dev/source-drive of=/dev/destination-drive

the other is used to resize the filesystem from whatever size it was, to whatever size you tell it (or the whole disk; I'd have to go read a manpage since it's been a bit)

the dd is completely safe, but the resize2fs command can break things, but you'd still have the data on the original drive, so you could always start over if it does - i'd unplug the source drive before you start doing any expansion stuff.

[–] savvywolf@pawb.social 7 points 2 weeks ago

dd is completely safe.

Only if you have the correct args and device names. Make a backup if you want to do it from the command line and aren't feeling 100% confident.

[–] Nednarb44@lemmy.world 1 points 2 weeks ago (1 children)

Thanks, that's really helpful. It can be hard to tell between commands and acronyms in conversation with familiarity

[–] cmnybo@discuss.tchncs.de 2 points 2 weeks ago (1 children)

Be absolutely sure that you get the source and destination drives correct. If you get them backwards, it will nuke your data. There is no confirmations, dd will start as soon as you press enter.

[–] muhyb@programming.dev 1 points 2 weeks ago

Good old disk destroyer.

[–] Drathro@dormi.zone 2 points 2 weeks ago (1 children)

Absolutely this. Relatively quick and clean, no messing with installation or reconfiguration. That is, assuming your data isn't completely corrupted and the old drive doesn't just outright fail during transfer... But if that happens you were screwed to begin with.

[–] Nednarb44@lemmy.world 2 points 2 weeks ago

The old drives are fine, just either too small or too slow, so it sounds like it may be an option

[–] Steamymoomilk@sh.itjust.works 2 points 2 weeks ago* (last edited 2 weeks ago) (1 children)

I dont know if this would be applicable for your use case.

But in gentoo one of the recommended ways to backup your system is rsync. Rsync is single threaded, but keeps all softlinks and hardlinks aswell as accepting an eclude list for directorys you want rsync to ignore. I have recovered from some pretty big dumb dumb moments and have used rsync to build packages on my threadripper and syncing them to lower power devices like my laptop and raspi. And they work pretty well!

If you do decide to go with rsync you can use "rsync -aP (from directory) (to directory)" the "a" stands for archive this keeps all permissons, softlinks and hardlinks. The P stands for a progress bar, so you can see how its going. Another benefit of rsync is you can start copying and stop and start and it will only SYNC over what isnt new or modified. After the files are synced over you need to edit your fstab (its af file where you computer mounts your disks) and grub-mk-config. If not re-install grub

Hope this helps

[–] Nednarb44@lemmy.world 1 points 2 weeks ago

That does help. One of the things on my to do list was setting up a backup system anyway, so maybe I'll play with that. Thanks!

[–] Unyieldingly@lemmy.world 2 points 2 weeks ago

I just do clean installs anymore not a lot to do with Linux as vs Windows, Linux takes me like 30 mins to setup as vs Windows can take hours.

[–] deadbeef79000@lemmy.nz 0 points 2 weeks ago

If you're using LVM, ZFS, or Btrfs then you can use their features and tooling to migrate data from one disk to the other, assuming you're able to connect both at the same time.

I've done this online with btrfs several times now and it's quite painless, admittedly only for self hosted stuff.