0

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" 
7
  • Do partition 2 and 3 have the same PARTUUIDs? Check with blkid Commented Aug 27 at 20:40
  • @Dirk partitions do not have PARTUUID.; the DiskID is a property of the disk. The PARTUUID format is DiskID-PP, where DiskID is a 32-bit MBR disk signature (stored in the MBR label-id field), and PP is a partition number. Commented Aug 28 at 7:40
  • @Dirk I am not near my RPI at the moment, but i already verified the PARTUUIDs, mmcblk0p2 has 55067321-02 and mmcblk0p3 has 55067321-03 (i can add the output to my question in the evening) Commented Aug 28 at 8:06
  • @Milliways I had a typo, i used "cat /dev/mmcblk0p2 > /dev/mmcblk0p3", i also verified, that i can mount mmcblk0p3 and access the files (also the raspberry is booting to the copy mmcblk0p3 instead of the original mmcblk0p2) Could you please elaborate what you meant with your comment? Commented Aug 28 at 8:09
  • cat will list the contents of its target. It is NOT a file copier. Use cp or better rsync. Frankly it is difficult to know what happens when you overwrite a whole partition; if they are of identical size you MAY have replicated the inode structure so it may appear to work. If you desperately wanted to duplicate a partition you could use dd (with the usual caveats) Commented Aug 28 at 8:58

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.