Debian/Linux Mint - Copying/moving a system with cp/mv
It is not the recommended method, but it is possible to copy or move a Linux system by just copying the files from one partition to the other using a live boot ISO, and then chroot-mount it to update the boot. I did however find some stuff that is worth to share. So here is a note about copying a Linux system the wrong way: Boot the system with a live boot ISO matching the operating system on the source partition. NOTE: The reason for the recommendation to use a live boot ISO matching the source OS and not any recent live ISO is that there may be incompatibilities with the new ISO and your source OS. For example, I found that Linux Mint 16 cannot read ext4 partitions created by Debian 13.1. Mount the source partition - to /mnt/source for example. Create the new (ext4) partition on the target disk, with cfdisk or gparted. Mount the target partition to somewhere, like /mnt/target Use cp or mv to copy the contents from one partition to the other - sparse files will automatically be created if needed: cp /mnt/source/* /mnt/target/ OR: mv /mnt/source/* /mnt/target/ Check UUID and LABEL for the source partition: blkid Set UUID from the source partition on the target partition: tune2fs -L "<source partition LABEL from blkid>" /dev/<target partition> tune2fs -U "<source partition UUID from blkid>" /dev/<target partition> Run partprobe to refresh partitions, you might get some errors about the live ISO: partprobe Unmount the source and target. Potentially remove the source partition or change the UUID of the source depending on your setup and needs. Mount stuff and then chroot into the target: mount /dev/<target> /mnt For EFI: mkdir -p /mnt/boot/efi mount /dev/<EFI partition> /mnt/boot/efi For all: mount -t proc proc /mnt/proc mount -o bind /dev /mnt/dev mount -o bind /dev/pts /mnt/dev/pts mount -o bind /sys /mnt/sys mount -o bind /run/udev /mnt/run/udev For EFI also do: mount -o bind /sys/firmware/efi/efivars /mnt/sys/firmware/efi/efivars chroot /mnt Now you are in, edit fstab if needed: /etc/fstab Also check this file, which is written by the kernel on boot - not sure how important it is, but df still displayed that the source partition was mounted as / because of it: /etc/mtab Update grub and initramfs: update-grub update-initramfs -c -k all Or reinstall grub: grub-install /dev/<target device without partition number>
Troubleshooting
Here are some errors that I later understood were caused by the fact that I had created the ext4 target partition with a live ISO too new for the source OS. The reason for this was that the newer ext4 had features that the source OS did not support. update-grub: error: unknown filesystem grub-install: Path `/boot/grub' is not readable by GRUB on boot. Installation is impossible. Aborting. I also got errors on this, dmesg gave more details about unsupported features: tune2fs -l /dev/<target partition> ... tune2fs: Filesystem has unsupported read-only feature(s) while trying to open /dev/<target partition> Couldn't find valid filesystem superblock. Another symptom of this is that the system appears to boot, but you are thrown into an (initramfs) prompt without any reason. If you already have copied the source partition to the target partition, then you have to create a new target partition that matches what the source OS needs using an ISO matching the source OS or using the -O option with mkfs.ext4 or tune2fs to disable features. Problem is, you need to know which ones to disable. Here is a list of features from a partition made with Linux Mint 16: has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize And here is one from Debian 13.1: has_journal ext_attr resize_inode dir_index orphan_file filetype extent 64bit flex_bg metadata_csum_seed sparse_super large_file huge_file dir_nlink extra_isize metadata_csum Not available in 13.1: needs_recovery Extra features in 13.1 are: orphan_file 64bit metadata_csum_seed metadata_csum I managed to get into the partition created with Debian 13.1 in Linux Mint 16 doing this: tune2fs -O ^orphan_file /dev/<target partition> tune2fs -O ^metadata_csum_seed /dev/<target partition> tune2fs -O ^metadata_csum /dev/<target partition>
This is a personal note. Last updated: 2025-11-10 23:43:51.



