this post was submitted on 01 Apr 2025
21 points (92.0% liked)

Linux

52749 readers
378 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 want to test debian trixie (13) so i can report bugs and troubleshoot before the release later this year. i thought about simply installing trixie alongside my current bookworm installation, but that won't be my scenario when the time comes, since i've been updating my system instead of reinstalling it since debian jessie (8) and this time it won't be different. how can i clone my current system so i can simulate an update to trixie? do i simply create a new partition and copy my files over, then chroot to it and install grub?

top 11 comments
sorted by: hot top controversial new old
[–] [email protected] 6 points 2 days ago (1 children)

What others wrote except don’t use dd. Use rsync or make a backup with tar. dd will waste time reading unallocated regions of the disk.

[–] [email protected] 1 points 18 hours ago* (last edited 17 hours ago) (1 children)

rsync has a ton of options. any specific setup you'd recommend me?

EDIT: seems like rsync -av src/* dst is working for me

[–] [email protected] 1 points 12 hours ago* (last edited 12 hours ago)

src/* will skip hidden files. You want rsync -avAXUNH src/ dst which copies contents of src into dst. Notice the trailing slash in src/. Without the slash, src is copied into dst so you end up with a src directory in dst. The AXUNH enables preserving more things. You might also add --delete if you’re updating the copy.

PS. I should also mention how I end up with -avAXUNH. Simple:

$ man rsync |grep ' -. *preserve'
       --hard-links, -H         preserve hard links
       --perms, -p              preserve permissions
       --executability, -E      preserve executability
       --acls, -A               preserve ACLs (implies --perms)
       --xattrs, -X             preserve extended attributes
       --owner, -o              preserve owner (super-user only)
       --group, -g              preserve group
       --times, -t              preserve modification times
       --atimes, -U             preserve access (use) times
       --crtimes, -N            preserve create times (newness)

and then include all that. a covers some of those options and those don’t have to be set explicitly:

$ man rsync |grep ' -a ' |head -n1
       --archive, -a            archive mode is -rlptgoD (no -A,-X,-U,-N,-H)
[–] [email protected] 4 points 2 days ago (1 children)

You can do this with the dd command. To prep:

Set up a live boot USB stick with your distro of choice.

Install another SSD/nvme/HDD at least the same size as your bookworm install into your bookworm machine. If that's not an option connect a USB drive that's at least the same size as the drive with your bookworm installation.

Boot into the live USB on the bookworm machine.

Make sure the partition(s) from your bookworm install are unmounted.

Quadruple check the drives/devices for the dd command. Here's the basics of the command:

dd if=/device/where/bookworm/is/installed of=USB/or/second/drive/in/machine bs=8M status=progress

So, if your bookworm install is on /dev/sda, and the USB or secondary is /dev/sdb, then the Cmand would be:

dd if=/dev/sda of=/dev/sdb bs=8M status=progress

[–] [email protected] 6 points 2 days ago

Be careful with disk destroyer!

[–] [email protected] 4 points 2 days ago

I would recommend cloning the entire disk to another disk of equal or greater size before, best procedure is to boot to a USB installation, run Gnome-Disk-Utility, create a disk image onto a second larger disk, then restore that image to a third disk which is equal or greater in terms of capacity to your bookworm disk, then unplug your orignal bookwork disk amd then attempt to boot from that third disk (fingers crossed)

If you're comfortable with the dd command that's another route to take but if you're not paying attention you can very easily wipe your own disk!

[–] [email protected] 1 points 2 days ago

I'm also considering this when it comes time for me to update. I would:

  • Throw a spare SSD or equal or greater size into a USB enclosure
  • Clone my boot drive to it using Clonezilla
  • Remove the original boot drive to avoid UUID collisions
  • Boot off the spare SSD and perform the update
[–] [email protected] 3 points 2 days ago

Using timeshift would be perfect for this. I run sid and use this all the time to restore back to a snapshot on a bad upgrade.

[–] [email protected] 1 points 2 days ago

I just went full nuclear upgrading my Bookworm install to Trixie and then to Unstable

[–] [email protected] 1 points 2 days ago

There are multiple way to de this. The easiest solution would be to une a second disk with same size or bigger and clone the current one onto the new one, using dd or clonezilla

if you have enough size on your dis_ for a second root partition, you can use dd to clone the existing root partition in the new one, edit /etc/fstab on the new one to point to the correct root partition, and us grub-mkconfig if you use grub, use grub-mkconfig to reconfigure it. It should automatically detect the new partition.

[–] [email protected] 1 points 2 days ago* (last edited 2 days ago)

If you have a second clean drive to work with, you can clone it there and just change your boot target in your BIOS. This is the simplest way.

If you're simply concerned about config incompatibilities and finding what will break (not hardware), you could clone down to a VM image and boot that then run the upgrade, and boot it again.

If you're concerned about hardware issues, you could clone down to a liveUSB compatible image (skipping heavy media files) and boot that from an external device and see how it runs.

It's a bit of an early release to test with your daily driver, so it's going to be a nightmare. Just a heads up.