I am playing with the partitions on my Raspberry Pi. I booted from a stick and created a second partition next to rootfs on the SD card. I copied the whole filesystem using cat /dev/mmcblk0p2 > /dev/mmcblk0p3.
Now when I try to boot from /dev/mmcblk0p2 I always end up with /dev/mmcblk0p3 mounted as /. Is there anything more I need to change?
$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS mmcblk0 179:0 0 14.6G 0 disk ├─mmcblk0p1 179:1 0 512M 0 part /boot/firmware ├─mmcblk0p2 179:2 0 6.9G 0 part └─mmcblk0p3 179:3 0 6.9G 0 part / $ cat /etc/fstab proc /proc proc defaults 0 0 PARTUUID=55067321-01 /boot/firmware vfat defaults 0 2 PARTUUID=55067321-02 / ext4 defaults,noatime 0 1 # a swapfile is not a swap partition, no line here # use dphys-swapfile swap[on|off] for that $ cat /boot/firmware/cmdline.txt console=tty1 root=PARTUUID=55067321-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait $ df -h Filesystem Size Used Avail Use% Mounted on udev 3.9G 0 3.9G 0% /dev tmpfs 807M 14M 793M 2% /run /dev/mmcblk0p3 6.8G 4.9G 1.5G 77% / tmpfs 4.0G 400K 4.0G 1% /dev/shm tmpfs 5.0M 48K 5.0M 1% /run/lock /dev/mmcblk0p1 510M 77M 434M 16% /boot/firmware tmpfs 807M 176K 807M 1% /run/user/1000 $ blkid /dev/mmcblk0p3: LABEL="rootfs" UUID="d6ecfcd5-2703-41bf-9301-10c403b6fb0c" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="55067321-03" /dev/mmcblk0p1: LABEL_FATBOOT="bootfs" LABEL="bootfs" UUID="F737-8E10" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="55067321-01" /dev/mmcblk0p2: LABEL="rootfs" UUID="3926f6b9-b2cc-43c4-83b0-47b011bdf7bf" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="55067321-02"
blkidcatwill list the contents of its target. It is NOT a file copier. Usecpor betterrsync. Frankly it is difficult to know what happens when you overwrite a whole partition; if they are of identical size you MAY have replicated theinodestructure so it may appear to work. If you desperately wanted to duplicate a partition you could usedd(with the usual caveats)