official rpios bookworm issue #168

Open
opened 2023-10-16 15:22:35 +02:00 by ProblemChild4901 · 147 comments
ProblemChild4901 commented 2023-10-16 15:22:35 +02:00 (Migrated from github.com)

The official rpios bookworm release has changed the mount point /boot to /boot/firmware. The current rpi-clone can back up, but the backup media is not bootable because the cmdline.txt file is not updated with the new PARTUUID.
/boot/cmdline.txt -> /boot/firmware/cmdline.txt
Consider adding lines like this after these variable assignments "cmdline_txt=${clone}/boot/cmdline.txt"

if [ -h $cmdline_txt ] ; then
cmdline_txt=${clone}/boot/firmware/cmdline.txt
fi

This tests if the /boot/cmdline.txt is a link and changes it to the actual file.

The official rpios bookworm release has changed the mount point /boot to /boot/firmware. The current rpi-clone can back up, but the backup media is not bootable because the cmdline.txt file is not updated with the new PARTUUID. /boot/cmdline.txt -> /boot/firmware/cmdline.txt Consider adding lines like this after these variable assignments "cmdline_txt=${clone}/boot/cmdline.txt" if [ -h $cmdline_txt ] ; then cmdline_txt=${clone}/boot/firmware/cmdline.txt fi This tests if the /boot/cmdline.txt is a link and changes it to the actual file.
faethon commented 2023-10-16 21:22:06 +02:00 (Migrated from github.com)

Since I've updated to bookworm as well, looking at potential necessary fixes. I am looking at where to put this test.
Would this be right after line 1733?

Looking at my pi that I updated to bookworm by changing the source.list and apt update / apt upgrade, I found no folder /boot/firmware, my cmdline.txt is in (old) location /boot

Did you do a fresh install?

Since I've updated to bookworm as well, looking at potential necessary fixes. I am looking at where to put this test. Would this be right after line 1733? Looking at my pi that I updated to bookworm by changing the source.list and apt update / apt upgrade, I found no folder /boot/firmware, my cmdline.txt is in (old) location /boot Did you do a fresh install?
ProblemChild4901 commented 2023-10-16 22:13:27 +02:00 (Migrated from github.com)

I did a fresh install of bookworm 64bit.
It seems likely that you will not be affected by the backup media boot issue, but I would test booting a backup to be sure.
I would add the new lines after each occurance of this line:
cmdline_txt=${clone}/boot/cmdline.boot

Lines 1733 1741

With these changes in place, backups of older versions of rpios will not be affected.

Some attention should be given to the area around ((convert_to_partuuid)). I have not tested this but the same three lines could be added after 974.
cmdline_txt=/boot/cmdline.txt

I did a fresh install of bookworm 64bit. It seems likely that you will not be affected by the backup media boot issue, but I would test booting a backup to be sure. I would add the new lines after each occurance of this line: cmdline_txt=${clone}/boot/cmdline.boot Lines 1733 1741 With these changes in place, backups of older versions of rpios will not be affected. Some attention should be given to the area around ((convert_to_partuuid)). I have not tested this but the same three lines could be added after 974. cmdline_txt=/boot/cmdline.txt
faethon commented 2023-10-16 22:42:24 +02:00 (Migrated from github.com)

Thanks, I'll look into this in my setup. For now it does not seem to be needed in my install. But it may be worthwhile for a future fresh install... A pity that rpi-clone does not seem to be maintained for quite some time anymore, and we have to rely on individual changes and updates such as the one pointed out by you.

Thanks, I'll look into this in my setup. For now it does not seem to be needed in my install. But it may be worthwhile for a future fresh install... A pity that rpi-clone does not seem to be maintained for quite some time anymore, and we have to rely on individual changes and updates such as the one pointed out by you.
framps commented 2023-10-17 03:32:28 +02:00 (Migrated from github.com)

I'll create a fix in my fork when I'm back home next week.

I'll create a fix in my fork when I'm back home next week.
JohHenryBlack commented 2023-10-22 13:54:03 +02:00 (Migrated from github.com)

Rebuilt a Raspberry 4-System from scratch yesterday. After work I was surprised to find out that the backups I used to do with rpi-clone would not boot.

So I found your issues-discussion here and changed rpi-clone by only adding:

if [ -h $cmdline_txt ] ; then
cmdline_txt=${clone}/boot/firmware/cmdline.txt
fi

after line 1733.

To use it again in line 1741 will probably not work because you just changed cmdline_txt to point to a file (rather than a link) after line 1733 and check again whether it points to a link (which will always fail?). Line 1741 deals with cmdline.boot and not cmdline.txt? And from my poor understanding of what the code is doing here I think further changes are not needed here. Don't know about other parts of the code where /boot/cmdline.txt is used.

Bottom line: I cloned with just three lines added, it booted fine.

Hope that helps.

Rebuilt a Raspberry 4-System from scratch yesterday. After work I was surprised to find out that the backups I used to do with rpi-clone would not boot. So I found your issues-discussion here and changed rpi-clone by only adding: if [ -h $cmdline_txt ] ; then cmdline_txt=${clone}/boot/firmware/cmdline.txt fi after line 1733. To use it again in line 1741 will probably not work because you just changed cmdline_txt to point to a file (rather than a link) after line 1733 and check again whether it points to a link (which will always fail?). Line 1741 deals with cmdline.boot and not cmdline.txt? And from my poor understanding of what the code is doing here I think further changes are not needed here. Don't know about other parts of the code where /boot/cmdline.txt is used. Bottom line: I cloned with just three lines added, it booted fine. Hope that helps.
framps commented 2023-10-22 20:18:49 +02:00 (Migrated from github.com)

I just created a fix in my fork so rpi-clone creates a bootable clone for bookworm. I tested the fix with a lite 32 bit image only. Would be great if if somebody tests the fix for other images and reports any issues.

EDIT: @zwolfpack s fix below is much better than mine. But realpath is not required for fstab. I created a PR and added the fix in my fork.

~I just created a fix [in my fork](https://raw.githubusercontent.com/framps/rpi-clone/master/rpi-clone) so rpi-clone creates a bootable clone for bookworm. I tested the fix with a lite 32 bit image only. Would be great if if somebody tests the fix for other images and reports any issues.~ EDIT: @zwolfpack s fix below is much better than mine. But realpath is not required for fstab. I created a [PR](https://github.com/billw2/rpi-clone/pull/169) and added the fix in [my fork](https://github.com/framps/rpi-clone).
ProblemChild4901 commented 2023-10-22 20:41:22 +02:00 (Migrated from github.com)

The changes around line 1733 are sufficient to make a normal backup bootable. One of the other two changes are in an area to change fstab and cmdline.txt from device names to PARTUUID: line 974. The other change seems to be when someone has a boot (or now firmware) partition on the SD card while the root partition is on a USB drive.: line 1741.

The changes around line 1733 are sufficient to make a normal backup bootable. One of the other two changes are in an area to change fstab and cmdline.txt from device names to PARTUUID: line 974. The other change seems to be when someone has a boot (or now firmware) partition on the SD card while the root partition is on a USB drive.: line 1741.
zwolfpack commented 2023-10-23 05:23:01 +02:00 (Migrated from github.com)

The issue arises when cmdline.txt is edited via 'sed -i'. That command ends up replacing the symlink /boot/cmdline.txt with the edited content, but the link target in /boot/firmware/cmdline.txt, which is the place that needs changing, isn't changed.

To fix, realpath(1) can be used to resolve the filename to the actual target. Following patch applies this for all instances where 'sed -i' is used.

--- rpi-clone/rpi-clone 2023-10-22 20:01:42.068868892 -0700
+++ rpi-clone-bookworm/rpi-clone        2023-10-22 13:37:47.691962245 -0700
@@ -971,7 +971,7 @@
                cp $fstab_tmp $fstab
                printf "Your original fstab is backed up to $fstab_save\n"

-               cmdline_txt=/boot/cmdline.txt
+               cmdline_txt=`realpath /boot/cmdline.txt`
                cmdline_save=$cmdline_txt.${PGM}-save
                if [ -f $cmdline_txt ] && grep -q "$src_root_dev" $cmdline_txt
                then
@@ -1729,8 +1729,8 @@

 # Fix PARTUUID or device name references in cmdline.txt and fstab
 #
-fstab=${clone}/etc/fstab
-cmdline_txt=${clone}/boot/cmdline.txt
+fstab=`realpath ${clone}/etc/fstab`
+cmdline_txt=`realpath ${clone}/boot/cmdline.txt`

 if [ -f $cmdline_txt ]
 then
@@ -1738,7 +1738,7 @@
        then
                qecho "Leaving SD to USB boot alone."
                cp $cmdline_txt ${clone}/boot/cmdline.boot
-               cmdline_txt=${clone}/boot/cmdline.boot
+               cmdline_txt=`dirname $cmdline_txt`/cmdline.boot
        fi
        if grep -q $src_disk_ID $cmdline_txt
        then

The issue arises when cmdline.txt is edited via 'sed -i'. That command ends up replacing the symlink /boot/cmdline.txt with the edited content, but the link target in /boot/firmware/cmdline.txt, which is the place that needs changing, isn't changed. To fix, realpath(1) can be used to resolve the filename to the actual target. Following patch applies this for all instances where 'sed -i' is used. ``` --- rpi-clone/rpi-clone 2023-10-22 20:01:42.068868892 -0700 +++ rpi-clone-bookworm/rpi-clone 2023-10-22 13:37:47.691962245 -0700 @@ -971,7 +971,7 @@ cp $fstab_tmp $fstab printf "Your original fstab is backed up to $fstab_save\n" - cmdline_txt=/boot/cmdline.txt + cmdline_txt=`realpath /boot/cmdline.txt` cmdline_save=$cmdline_txt.${PGM}-save if [ -f $cmdline_txt ] && grep -q "$src_root_dev" $cmdline_txt then @@ -1729,8 +1729,8 @@ # Fix PARTUUID or device name references in cmdline.txt and fstab # -fstab=${clone}/etc/fstab -cmdline_txt=${clone}/boot/cmdline.txt +fstab=`realpath ${clone}/etc/fstab` +cmdline_txt=`realpath ${clone}/boot/cmdline.txt` if [ -f $cmdline_txt ] then @@ -1738,7 +1738,7 @@ then qecho "Leaving SD to USB boot alone." cp $cmdline_txt ${clone}/boot/cmdline.boot - cmdline_txt=${clone}/boot/cmdline.boot + cmdline_txt=`dirname $cmdline_txt`/cmdline.boot fi if grep -q $src_disk_ID $cmdline_txt then ```
zwolfpack commented 2023-10-24 07:28:30 +02:00 (Migrated from github.com)

I realize that realpath is not required for fstab ... currently. However, a similar problem would arise if /etc/fstab was symlinked. So I though it prudent to fix that as well.

I realize that realpath is not required for fstab ... currently. However, a similar problem would arise if /etc/fstab was symlinked. So I though it prudent to fix that as well.
framps commented 2023-10-24 09:55:01 +02:00 (Migrated from github.com)

However, a similar problem would arise if /etc/fstab was symlinked.

I see your point. But I don't expect /etc/fstab to become symlinked. It's a file as long as Linux exists. That's why I decided to remove realpath for /etc/fstab in my PR.

> However, a similar problem would arise if /etc/fstab was symlinked. I see your point. But I don't expect /etc/fstab to become symlinked. It's a file as long as Linux exists. That's why I decided to remove realpath for /etc/fstab in my PR.
bputtick commented 2023-10-30 00:37:35 +01:00 (Migrated from github.com)

I fixed this by adding --follow-symlinks to the sed command

I fixed this by adding --follow-symlinks to the sed command
jdrch commented 2023-11-13 21:45:00 +01:00 (Migrated from github.com)

I just created a fix in my fork so rpi-clone creates a bootable clone for bookworm. I tested the fix with a lite 32 bit image only. Would be great if if somebody tests the fix for other images and reports any issues.

EDIT: @zwolfpack s fix below is much better than mine. But realpath is not required for fstab. I created a PR and added the fix in my fork.

FWIW it doesn't look like the fork works either with official clean install Bookworm on the Pi 3B+. I tried it just now and the Pi wouldn't get past power on.

> ~I just created a fix [in my fork](https://raw.githubusercontent.com/framps/rpi-clone/master/rpi-clone) so rpi-clone creates a bootable clone for bookworm. I tested the fix with a lite 32 bit image only. Would be great if if somebody tests the fix for other images and reports any issues.~ > > EDIT: @zwolfpack s fix below is much better than mine. But realpath is not required for fstab. I created a [PR](https://github.com/billw2/rpi-clone/pull/169) and added the fix in [my fork](https://github.com/framps/rpi-clone). FWIW it doesn't look like the fork works either with official clean install Bookworm on the Pi 3B+. I tried it just now and the Pi wouldn't get past power on.
framps commented 2023-11-13 21:57:33 +01:00 (Migrated from github.com)

😢 Unfortunately rpi-clone misses an important feature to help if there are any issues - a debug log 😢

Would be great to have a debug log of your restore in order to help you. Maybe somebody adds the missing debug feature in rpi-clone 😉

:cry: Unfortunately rpi-clone misses an important feature to help if there are any issues - a debug log :cry: Would be great to have a debug log of your restore in order to help you. Maybe somebody adds the missing debug feature in rpi-clone :wink:
jdrch commented 2023-11-13 22:05:46 +01:00 (Migrated from github.com)

😢 Unfortunately rpi-clone misses an important feature to help if there are any issues - a debug log 😢

Would be great to have a debug log of your restore in order to help you. Maybe somebody adds the missing debug feature in rpi-clone 😉

No worries. I have an Pi 4B on hand so I'm using the SD card copier utility instead. Still not as handy for backups, but it'll work well enough to migrate from one microSD card to another. Here's hoping that doesn't fail.

> 😢 Unfortunately rpi-clone misses an important feature to help if there are any issues - a debug log 😢 > > Would be great to have a debug log of your restore in order to help you. Maybe somebody adds the missing debug feature in rpi-clone 😉 No worries. I have an Pi 4B on hand so I'm using the SD card copier utility instead. Still not as handy for backups, but it'll work well enough to migrate from one microSD card to another. Here's hoping that doesn't fail.
framps commented 2023-11-13 22:09:23 +01:00 (Migrated from github.com)

I use raspiBackup to backup my Raspberries. Just give it a try 😉

I use raspiBackup to backup my Raspberries. Just give it a try :wink:
jdrch commented 2023-11-13 22:13:01 +01:00 (Migrated from github.com)

I'll look into that, thanks!

I'll look into that, thanks!
framps commented 2023-11-13 22:14:05 +01:00 (Migrated from github.com)

raspiBackup has a debug log 😄 - just in case you have any issues

raspiBackup has a debug log :smile: - just in case you have any issues
albe62 commented 2023-12-10 20:22:41 +01:00 (Migrated from github.com)

Hi, I tried everything in this post but my cloned card doesn't boot. I run rpi-clone on a pi4 (waiting for pi5 arrival) with Pi OS "bookworm" 64 bit. Nothing to do, I have to give-up. The clone with GUI official script works, as usual.

Hi, I tried everything in this post but my cloned card doesn't boot. I run rpi-clone on a pi4 (waiting for pi5 arrival) with Pi OS "bookworm" 64 bit. Nothing to do, I have to give-up. The clone with GUI official script works, as usual.
TaiPhamD commented 2023-12-15 06:49:52 +01:00 (Migrated from github.com)
Syncing file systems (can take a long time)
Syncing mounted partitions:
  Mounting /dev/sda2 on /mnt/clone
  => rsync // /mnt/clone with-root-excludes ...
  Mounting /dev/sda1 on /mnt/clone/boot/firmware
  => rsync /boot/firmware/ /mnt/clone/boot/firmware  ...

Editing /mnt/clone/boot/cmdline.txt PARTUUID to use 59dc1bbf
Editing /mnt/clone/etc/fstab PARTUUID to use 59dc1bbf

as others pointed out it did do the correct edit but just didn't store it at the right target folder. It stored it in /mnt/clone/boot/cmdline.txt instead of /mnt/clone/boot/firmware/cmdline.txt . I was able to manually put in the USB drive and set the right partition value in the firmware folder and it works.

``` Syncing file systems (can take a long time) Syncing mounted partitions: Mounting /dev/sda2 on /mnt/clone => rsync // /mnt/clone with-root-excludes ... Mounting /dev/sda1 on /mnt/clone/boot/firmware => rsync /boot/firmware/ /mnt/clone/boot/firmware ... Editing /mnt/clone/boot/cmdline.txt PARTUUID to use 59dc1bbf Editing /mnt/clone/etc/fstab PARTUUID to use 59dc1bbf ``` as others pointed out it did do the correct edit but just didn't store it at the right target folder. It stored it in /mnt/clone/boot/cmdline.txt instead of /mnt/clone/boot/firmware/cmdline.txt . I was able to manually put in the USB drive and set the right partition value in the firmware folder and it works.
HRA42 commented 2023-12-24 01:45:24 +01:00 (Migrated from github.com)

@framps thanks, your version works without issue!

@framps thanks, your version works without issue!
fjpdevries commented 2023-12-24 01:45:50 +01:00 (Migrated from github.com)

In verband met de feestdagen ben ik tot en met vrijdag 29 december 2023 afwezig en zal mijn email beperkt kunnen lezen en beantwoorden.

Ik wens u het allerbeste voor 2024 en fijne feestdagen!

Met vriendelijke groet,
FSE Turnstiles b.v.
Jos de Vries

PS: Neem voor urgente storingen contact met ons op door een email te sturen naar @.***

In verband met de feestdagen ben ik tot en met vrijdag 29 december 2023 afwezig en zal mijn email beperkt kunnen lezen en beantwoorden. Ik wens u het allerbeste voor 2024 en fijne feestdagen! Met vriendelijke groet, FSE Turnstiles b.v. Jos de Vries PS: Neem voor urgente storingen contact met ons op door een email te sturen naar ***@***.***
jdrch commented 2023-12-24 05:05:38 +01:00 (Migrated from github.com)

@framps thanks, your version works without issue!

On which Raspberry Pi OS version?

> @framps thanks, your version works without issue! On which Raspberry Pi OS version?
HRA42 commented 2023-12-25 16:28:05 +01:00 (Migrated from github.com)

@framps thanks, your version works without issue!

On which Raspberry Pi OS version?

Debian 1:6.1.63-1+rpt1 (2023-11-24) aarch64 with Kernel: pi5 6.1.0-rpi7-rpi-2712

> > @framps thanks, your version works without issue! > > On which Raspberry Pi OS version? Debian 1:6.1.63-1+rpt1 (2023-11-24) aarch64 with Kernel: pi5 6.1.0-rpi7-rpi-2712
fmarzocca commented 2023-12-27 12:31:06 +01:00 (Migrated from github.com)

which is the final patch to apply to rpi-clone on a Rasp 3B+ (32bit) bookworm? I am getting confused...

which is the final patch to apply to rpi-clone on a Rasp 3B+ (32bit) bookworm? I am getting confused...
framps commented 2023-12-27 13:00:51 +01:00 (Migrated from github.com)
1) Fix the current code according https://github.com/billw2/rpi-clone/issues/168#issuecomment-1784275165 2) Apply the patch listed in https://github.com/billw2/rpi-clone/issues/168#issuecomment-1774370841 or use rpi-clone from [my fork](https://github.com/framps/rpi-clone)
fmarzocca commented 2023-12-27 13:01:09 +01:00 (Migrated from github.com)

I have used @framps fork on my bookworm, and this is the results I am getting on boot partition:

ll /media/BOOT/
ls: cannot access '/media/BOOT/'$'\001''░m░╝╕'$'\035''≡.\≡ ': Input/output error
ls: cannot access '/media/BOOT/T± s4≡G:.ä± ': Input/output error
ls: cannot access '/media/BOOT/'$'\001''αy░▄Φ'$'\035''≡.|± ': Input/output error
ls: cannot access '/media/BOOT/╨± r.'$'\001''░m': Input/output error
ls: cannot access '/media/BOOT/▓"'$'\003''∩'$'\002''>'$'\002''.üá'$'\003': Input/output error
total 17124409
-rwxr-xr-x 1 pab  pab   218099713 Jan  4  1980 ''$'\001''.░'
drwxr-xr-x 8 pab  pab        4608 Jan  1  1970  .
drwxr-xr-x 5 root root       4096 Dec 27 12:58  ..
-rwxr-xr-x 1 pab  pab       29243 Dec 23 10:54  bcm2708-rpi-b.dtb
-rwxr-xr-x 1 pab  pab       29562 Dec 23 10:54  bcm2708-rpi-b-plus.dtb
-rwxr-xr-x 1 pab  pab       28986 Dec 23 10:54  bcm2708-rpi-cm.dtb
-rwxr-xr-x 1 pab  pab       28868 Dec 23 10:54  bcm2708-rpi-zero.dtb
-rwxr-xr-x 1 pab  pab       30739 Dec 23 10:54  bcm2708-rpi-zero-w.dtb
-rwxr-xr-x 1 pab  pab       31210 Dec 23 10:54  bcm2709-rpi-2-b.dtb
-rwxr-xr-x 1 pab  pab       31359 Dec 23 10:54  bcm2710-rpi-2-b.dtb
-rwxr-xr-x 1 pab  pab       33555 Dec 23 10:54  bcm2710-rpi-3-b.dtb
-rwxr-xr-x 1 pab  pab       31254 Dec 23 10:54  bcm2710-rpi-cm3.dtb
-rwxr-xr-x 1 pab  pab       32524 Dec 23 10:54  bcm2710-rpi-zero-2-w.dtb
-rwxr-xr-x 1 pab  pab       54707 Dec 23 10:54  bcm2711-rpi-4-b.dtb
-rwxr-xr-x 1 pab  pab       52476 Dec 23 10:49  bootcode.bin
-rwxr-xr-x 1 pab  pab       52476 Dec 23 10:49  bootcode.bin
-rwxr-xr-x 1 pab  pab  1611801893 Jan  5  2010 '°='$'\002''.'$'\a''Ç'$'\005'
-rwxr-xr-x 1 pab  pab        4096 Feb 12  2019  ._cmdline.txt
-rwxr-xr-x 1 pab  pab         142 Nov 19  2019  cmdline.txt
-rwxr-xr-x 1 pab  pab        4096 Feb 12  2019  ._config.txt
-rwxr-xr-x 1 pab  pab        1756 Dec 23 10:56  config.txt
-rwxr-xr-x 1 pab  pab        1739 Jul 10 10:56  config.txt.bak
-r-xr-xr-x 1 pab  pab  4294961157 Aug  1  1980 ''$'\001''░d.'$'\002''└#'
-rwxr-xr-x 1 pab  pab   520388128 Jan  4  2096 'e.'$'\004''└ '
-rwxr-xr-x 1 pab  pab        3180 Dec 23 10:49  fixup4cd.dat
-rwxr-xr-x 1 pab  pab        3180 Dec 23 10:49  fixup4cd.dat
-rwxr-xr-x 1 pab  pab        5412 Dec 23 10:49  fixup4.dat
-rwxr-xr-x 1 pab  pab        5412 Dec 23 10:49  fixup4.dat
-rwxr-xr-x 1 pab  pab        8397 Dec 23 10:49  fixup4db.dat
-rwxr-xr-x 1 pab  pab        8397 Dec 23 10:49  fixup4db.dat
-rwxr-xr-x 1 pab  pab        8399 Dec 23 10:49  fixup4x.dat
-rwxr-xr-x 1 pab  pab        8399 Dec 23 10:49  fixup4x.dat
-rwxr-xr-x 1 pab  pab        3180 Dec 23 10:49  fixup_cd.dat
-rwxr-xr-x 1 pab  pab        7269 Dec 23 10:49  fixup.dat
-rwxr-xr-x 1 pab  pab        7269 Dec 23 10:49  fixup.dat
-rwxr-xr-x 1 pab  pab       10242 Dec 23 10:49  fixup_db.dat
-rwxr-xr-x 1 pab  pab       10244 Dec 23 10:49  fixup_x.dat
-rwxr-xr-x 1 pab  pab    11317382 Feb  8  2076 ''$'\031''@*@'$'\a''`.'$'\006''î'$'\004'
-rwxr-xr-x 1 pab  pab         145 Nov 13  2018  issue.txt
-rwxr-xr-x 1 pab  pab        1594 Dec 23 10:49  LICENCE.broadcom
-rwxr-xr-x 1 pab  pab        1594 Dec 23 10:49  LICENCE.broadcom
-rwxr-xr-x 1 pab  pab       18974 Nov 13  2018  LICENSE.oracle
d????????? ? ?    ?             ?            ? ''$'\001''░m░╝╕'$'\035''≡.\≡ '
d????????? ? ?    ?             ?            ? '╨± r.'$'\001''░m'
drwxr-xr-x 4 pab  pab         512 Sep 21  2019  .Spotlight-V100
-rwxr-xr-x 1 pab  pab      808060 Dec 23 10:49  start4cd.elf
-rwxr-xr-x 1 pab  pab     3751752 Dec 23 10:49  start4db.elf
-rwxr-xr-x 1 pab  pab     2254944 Dec 23 10:49  start4.elf
-rwxr-xr-x 1 pab  pab     3002536 Dec 23 10:49  start4x.elf
-rwxr-xr-x 1 pab  pab      808060 Dec 23 10:49  start_cd.elf
-rwxr-xr-x 1 pab  pab     4823624 Dec 23 10:49  start_db.elf
-rwxr-xr-x 1 pab  pab     2979264 Dec 23 10:49  start.elf
-rwxr-xr-x 1 pab  pab     3726216 Dec 23 10:49  start_x.elf
d????????? ? ?    ?             ?            ?  T± s4≡G:.ä± 
-rwxr-xr-x 1 pab  pab  3221651719 Mar 16  2043 ''$'\002''.'$'\a''ü'$'\006'
d????????? ? ?    ?             ?            ? '▓"'$'\003''∩'$'\002''>'$'\002''.üá'$'\003'
-rwxr-xr-x 1 pab  pab         164 Mar 17  2019  wpa_supplicant.conf_Salty
d????????? ? ?    ?             ?            ? ''$'\001''αy░▄Φ'$'\035''≡.|± '
-rwxr-xr-x 1 pab  pab         172 Jan  1  2067 'σ▒≥'$'\016''╚.'$'\004'
-rwxr-xr-x 1 pab  pab  3892428806 Feb  1  2043 ''$'\003''Φ8.'$'\a''ü'$'\006'
-rwxr-xr-x 1 pab  pab   520388128 Jan  4  2096 ''$'\004''Φ'$'\b''É ~'$'\004\037''.'$'\004''φ'$'\b'
-rwxr-xr-x 1 pab  pab  3221586184 Mar 16  2043 ''$'\004\037\003''Φ   '$'\177''.'$'\b''ü'$'\006'
pab@pab:~ $ 
I have used @framps fork on my bookworm, and this is the results I am getting on boot partition: ``` ll /media/BOOT/ ls: cannot access '/media/BOOT/'$'\001''░m░╝╕'$'\035''≡.\≡ ': Input/output error ls: cannot access '/media/BOOT/T± s4≡G:.ä± ': Input/output error ls: cannot access '/media/BOOT/'$'\001''αy░▄Φ'$'\035''≡.|± ': Input/output error ls: cannot access '/media/BOOT/╨± r.'$'\001''░m': Input/output error ls: cannot access '/media/BOOT/▓"'$'\003''∩'$'\002''>'$'\002''.üá'$'\003': Input/output error total 17124409 -rwxr-xr-x 1 pab pab 218099713 Jan 4 1980 ''$'\001''.░' drwxr-xr-x 8 pab pab 4608 Jan 1 1970 . drwxr-xr-x 5 root root 4096 Dec 27 12:58 .. -rwxr-xr-x 1 pab pab 29243 Dec 23 10:54 bcm2708-rpi-b.dtb -rwxr-xr-x 1 pab pab 29562 Dec 23 10:54 bcm2708-rpi-b-plus.dtb -rwxr-xr-x 1 pab pab 28986 Dec 23 10:54 bcm2708-rpi-cm.dtb -rwxr-xr-x 1 pab pab 28868 Dec 23 10:54 bcm2708-rpi-zero.dtb -rwxr-xr-x 1 pab pab 30739 Dec 23 10:54 bcm2708-rpi-zero-w.dtb -rwxr-xr-x 1 pab pab 31210 Dec 23 10:54 bcm2709-rpi-2-b.dtb -rwxr-xr-x 1 pab pab 31359 Dec 23 10:54 bcm2710-rpi-2-b.dtb -rwxr-xr-x 1 pab pab 33555 Dec 23 10:54 bcm2710-rpi-3-b.dtb -rwxr-xr-x 1 pab pab 31254 Dec 23 10:54 bcm2710-rpi-cm3.dtb -rwxr-xr-x 1 pab pab 32524 Dec 23 10:54 bcm2710-rpi-zero-2-w.dtb -rwxr-xr-x 1 pab pab 54707 Dec 23 10:54 bcm2711-rpi-4-b.dtb -rwxr-xr-x 1 pab pab 52476 Dec 23 10:49 bootcode.bin -rwxr-xr-x 1 pab pab 52476 Dec 23 10:49 bootcode.bin -rwxr-xr-x 1 pab pab 1611801893 Jan 5 2010 '°='$'\002''.'$'\a''Ç'$'\005' -rwxr-xr-x 1 pab pab 4096 Feb 12 2019 ._cmdline.txt -rwxr-xr-x 1 pab pab 142 Nov 19 2019 cmdline.txt -rwxr-xr-x 1 pab pab 4096 Feb 12 2019 ._config.txt -rwxr-xr-x 1 pab pab 1756 Dec 23 10:56 config.txt -rwxr-xr-x 1 pab pab 1739 Jul 10 10:56 config.txt.bak -r-xr-xr-x 1 pab pab 4294961157 Aug 1 1980 ''$'\001''░d.'$'\002''└#' -rwxr-xr-x 1 pab pab 520388128 Jan 4 2096 'e.'$'\004''└ ' -rwxr-xr-x 1 pab pab 3180 Dec 23 10:49 fixup4cd.dat -rwxr-xr-x 1 pab pab 3180 Dec 23 10:49 fixup4cd.dat -rwxr-xr-x 1 pab pab 5412 Dec 23 10:49 fixup4.dat -rwxr-xr-x 1 pab pab 5412 Dec 23 10:49 fixup4.dat -rwxr-xr-x 1 pab pab 8397 Dec 23 10:49 fixup4db.dat -rwxr-xr-x 1 pab pab 8397 Dec 23 10:49 fixup4db.dat -rwxr-xr-x 1 pab pab 8399 Dec 23 10:49 fixup4x.dat -rwxr-xr-x 1 pab pab 8399 Dec 23 10:49 fixup4x.dat -rwxr-xr-x 1 pab pab 3180 Dec 23 10:49 fixup_cd.dat -rwxr-xr-x 1 pab pab 7269 Dec 23 10:49 fixup.dat -rwxr-xr-x 1 pab pab 7269 Dec 23 10:49 fixup.dat -rwxr-xr-x 1 pab pab 10242 Dec 23 10:49 fixup_db.dat -rwxr-xr-x 1 pab pab 10244 Dec 23 10:49 fixup_x.dat -rwxr-xr-x 1 pab pab 11317382 Feb 8 2076 ''$'\031''@*@'$'\a''`.'$'\006''î'$'\004' -rwxr-xr-x 1 pab pab 145 Nov 13 2018 issue.txt -rwxr-xr-x 1 pab pab 1594 Dec 23 10:49 LICENCE.broadcom -rwxr-xr-x 1 pab pab 1594 Dec 23 10:49 LICENCE.broadcom -rwxr-xr-x 1 pab pab 18974 Nov 13 2018 LICENSE.oracle d????????? ? ? ? ? ? ''$'\001''░m░╝╕'$'\035''≡.\≡ ' d????????? ? ? ? ? ? '╨± r.'$'\001''░m' drwxr-xr-x 4 pab pab 512 Sep 21 2019 .Spotlight-V100 -rwxr-xr-x 1 pab pab 808060 Dec 23 10:49 start4cd.elf -rwxr-xr-x 1 pab pab 3751752 Dec 23 10:49 start4db.elf -rwxr-xr-x 1 pab pab 2254944 Dec 23 10:49 start4.elf -rwxr-xr-x 1 pab pab 3002536 Dec 23 10:49 start4x.elf -rwxr-xr-x 1 pab pab 808060 Dec 23 10:49 start_cd.elf -rwxr-xr-x 1 pab pab 4823624 Dec 23 10:49 start_db.elf -rwxr-xr-x 1 pab pab 2979264 Dec 23 10:49 start.elf -rwxr-xr-x 1 pab pab 3726216 Dec 23 10:49 start_x.elf d????????? ? ? ? ? ? T± s4≡G:.ä±  -rwxr-xr-x 1 pab pab 3221651719 Mar 16 2043 ''$'\002''.'$'\a''ü'$'\006' d????????? ? ? ? ? ? '▓"'$'\003''∩'$'\002''>'$'\002''.üá'$'\003' -rwxr-xr-x 1 pab pab 164 Mar 17 2019 wpa_supplicant.conf_Salty d????????? ? ? ? ? ? ''$'\001''αy░▄Φ'$'\035''≡.|± ' -rwxr-xr-x 1 pab pab 172 Jan 1 2067 'σ▒≥'$'\016''╚.'$'\004' -rwxr-xr-x 1 pab pab 3892428806 Feb 1 2043 ''$'\003''Φ8.'$'\a''ü'$'\006' -rwxr-xr-x 1 pab pab 520388128 Jan 4 2096 ''$'\004''Φ'$'\b''É ~'$'\004\037''.'$'\004''φ'$'\b' -rwxr-xr-x 1 pab pab 3221586184 Mar 16 2043 ''$'\004\037\003''Φ   '$'\177''.'$'\b''ü'$'\006' pab@pab:~ $ ```
framps commented 2023-12-27 13:04:27 +01:00 (Migrated from github.com)

Looks like your SD card is broken.

Looks like your SD card is broken.
fmarzocca commented 2023-12-27 13:30:30 +01:00 (Migrated from github.com)

Looks like your SD card is broken.

It seems very unlikely, as it worked every day before the upgrade... I will check and maybe reformat it.

> Looks like your SD card is broken. It seems very unlikely, as it worked every day before the upgrade... I will check and maybe reformat it.
fmarzocca commented 2023-12-27 13:39:42 +01:00 (Migrated from github.com)

during rsync I am getting these errors:

rsync: [receiver] mkstemp "/mnt/clone/boot/firmware/.bcm2712-rpi-5-b.dtb.SlzdW6" failed: Read-only file system (30)
rsync: [receiver] mkstemp "/mnt/clone/boot/firmware/.cmdline.txt.g9a4Sq" failed: Read-only file system (30)
rsync: [receiver] mkstemp "/mnt/clone/boot/firmware/.config.txt.QA8F5F" failed: Read-only file system (30)
rsync: [receiver] mkstemp "/mnt/clone/boot/firmware/.config.txt.bak.fK9cPg" failed: Read-only file system (30)
rsync: [receiver] mkstemp "/mnt/clone/boot/firmware/.fixup_cd.dat.DoHYL7" failed: Read-only file system (30)
rsync: [receiver] mkstemp "/mnt/clone/boot/firmware/.fixup_db.dat.IfOnvM" failed: Read-only file system (30)
rsync: [receiver] mkstemp "/mnt/clone/boot/firmware/.initramfs7.btIE0Q" failed: Read-only file system (30)
rsync: [receiver] mkstemp "/mnt/clone/boot/firmware/.issue.txt.Q6vgxm" failed: Read-only file system (30)
rsync: [receiver] mkstemp "/mnt/clone/boot/firmware/.kernel7.img.hWtAb9" failed: Read-only file system (30)
rsync: [receiver] mkstemp "/mnt/clone/boot/firmware/.start.elf.i72DIe" failed: Read-only file system (30)
rsync: [receiver] mkstemp "/mnt/clone/boot/firmware/.start_cd.elf.nY5NIh" failed: Read-only file system (30)
rsync: [receiver] mkstemp "/mnt/clone/boot/firmware/.start_db.elf.WnMyIt" failed: Read-only file system (30)
rsync: [receiver] mkstemp "/mnt/clone/boot/firmware/.start_x.elf.WR0DqO" failed: Read-only file system (30)
during rsync I am getting these errors: ``` rsync: [receiver] mkstemp "/mnt/clone/boot/firmware/.bcm2712-rpi-5-b.dtb.SlzdW6" failed: Read-only file system (30) rsync: [receiver] mkstemp "/mnt/clone/boot/firmware/.cmdline.txt.g9a4Sq" failed: Read-only file system (30) rsync: [receiver] mkstemp "/mnt/clone/boot/firmware/.config.txt.QA8F5F" failed: Read-only file system (30) rsync: [receiver] mkstemp "/mnt/clone/boot/firmware/.config.txt.bak.fK9cPg" failed: Read-only file system (30) rsync: [receiver] mkstemp "/mnt/clone/boot/firmware/.fixup_cd.dat.DoHYL7" failed: Read-only file system (30) rsync: [receiver] mkstemp "/mnt/clone/boot/firmware/.fixup_db.dat.IfOnvM" failed: Read-only file system (30) rsync: [receiver] mkstemp "/mnt/clone/boot/firmware/.initramfs7.btIE0Q" failed: Read-only file system (30) rsync: [receiver] mkstemp "/mnt/clone/boot/firmware/.issue.txt.Q6vgxm" failed: Read-only file system (30) rsync: [receiver] mkstemp "/mnt/clone/boot/firmware/.kernel7.img.hWtAb9" failed: Read-only file system (30) rsync: [receiver] mkstemp "/mnt/clone/boot/firmware/.start.elf.i72DIe" failed: Read-only file system (30) rsync: [receiver] mkstemp "/mnt/clone/boot/firmware/.start_cd.elf.nY5NIh" failed: Read-only file system (30) rsync: [receiver] mkstemp "/mnt/clone/boot/firmware/.start_db.elf.WnMyIt" failed: Read-only file system (30) rsync: [receiver] mkstemp "/mnt/clone/boot/firmware/.start_x.elf.WR0DqO" failed: Read-only file system (30) ```
framps commented 2023-12-27 13:42:00 +01:00 (Migrated from github.com)

Your SD card is broken. I suggest to use a brand new SD card.

Your SD card is broken. I suggest to use a brand new SD card.
fmarzocca commented 2023-12-27 13:43:56 +01:00 (Migrated from github.com)

Your SD card is broken. I suggest to use a brand new SD card.

I suspect a problem in the USB->SD adapter. The SD is quite new.

> Your SD card is broken. I suggest to use a brand new SD card. I suspect a problem in the USB->SD adapter. The SD is quite new.
fmarzocca commented 2023-12-27 14:38:09 +01:00 (Migrated from github.com)

2. my fork

Replaced SD. It is working, thanks.
So, should I just use your fork or is there any other patch/change to apply? Should I have to add --follow-symlinks to each sed command?

> 2\. my fork Replaced SD. It is working, thanks. So, should I just use your fork or is there any other patch/change to apply? Should I have to add `--follow-symlinks `to each `sed` command?
framps commented 2023-12-27 14:59:45 +01:00 (Migrated from github.com)

Just use my fork and your'e fine 😉

Just use my fork and your'e fine :wink:
fmarzocca commented 2023-12-29 11:34:39 +01:00 (Migrated from github.com)

@framps
I am using your fork on a Raspi 3B+ 32.bit:

PRETTY_NAME="Raspbian GNU/Linux 12 (bookworm)"
NAME="Raspbian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

I had a look in the cloned fstab, and I have found a PARTUUID different than the one in the cloned cmdline.txt.
This is from cloned fstab:

PARTUUID=93a7c455-01  /boot/firmware           vfat    defaults,flush    0       2
PARTUUID=93a7c455-02  /               ext4    defaults,noatime  0       1

and this from cloned cmdline.txt:
root=PARTUUID=b4a2e918-02

The PARTUUID in cmdline.txt of the running system is: b4a2e918-02

It doesn't seem to be correct...

@framps I am using your fork on a Raspi 3B+ 32.bit: ``` PRETTY_NAME="Raspbian GNU/Linux 12 (bookworm)" NAME="Raspbian GNU/Linux" VERSION_ID="12" VERSION="12 (bookworm)" VERSION_CODENAME=bookworm ID=raspbian ID_LIKE=debian HOME_URL="http://www.raspbian.org/" SUPPORT_URL="http://www.raspbian.org/RaspbianForums" BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs" ``` I had a look in the cloned fstab, and I have found a PARTUUID different than the one in the cloned cmdline.txt. This is from cloned fstab: ``` PARTUUID=93a7c455-01 /boot/firmware vfat defaults,flush 0 2 PARTUUID=93a7c455-02 / ext4 defaults,noatime 0 1 ``` and this from cloned cmdline.txt: `root=PARTUUID=b4a2e918-02` The PARTUUID in cmdline.txt of the running system is: `b4a2e918-02` It doesn't seem to be correct...
fmarzocca commented 2023-12-29 11:40:15 +01:00 (Migrated from github.com)

@framps

This is the /boot folder in the running system. There is no symlink to /boot/firmware/cmdline.txt, but the systems boots fine:

ll /boot
total 17569
drwxr-xr-x  3 root root     4096 Dec 23 10:55 .
drwxr-xr-x 19 root root     4096 Dec 27 14:27 ..
-rw-r--r--  1 root root   205495 Nov 24 17:11 config-6.1.0-rpi7-rpi-v7
drwxr-xr-x  4 root root     4608 Jan  1  1970 firmware
-rw-r--r--  1 root root 10738708 Dec 23 10:54 initrd.img-6.1.0-rpi7-rpi-v7
lrwxrwxrwx  1 root root       17 Dec 23 10:49 overlays -> firmware/overlays
-rw-r--r--  1 root root       83 Nov 24 17:11 System.map-6.1.0-rpi7-rpi-v7
-rw-r--r--  1 root root  7023344 Nov 24 17:11 vmlinuz-6.1.0-rpi7-rpi-v7

This is not a clean installation, but an upgrade from bullseye

@framps This is the /boot folder in the running system. There is no symlink to /boot/firmware/cmdline.txt, but the systems boots fine: ``` ll /boot total 17569 drwxr-xr-x 3 root root 4096 Dec 23 10:55 . drwxr-xr-x 19 root root 4096 Dec 27 14:27 .. -rw-r--r-- 1 root root 205495 Nov 24 17:11 config-6.1.0-rpi7-rpi-v7 drwxr-xr-x 4 root root 4608 Jan 1 1970 firmware -rw-r--r-- 1 root root 10738708 Dec 23 10:54 initrd.img-6.1.0-rpi7-rpi-v7 lrwxrwxrwx 1 root root 17 Dec 23 10:49 overlays -> firmware/overlays -rw-r--r-- 1 root root 83 Nov 24 17:11 System.map-6.1.0-rpi7-rpi-v7 -rw-r--r-- 1 root root 7023344 Nov 24 17:11 vmlinuz-6.1.0-rpi7-rpi-v7 ``` This is not a clean installation, but an upgrade from bullseye
framps commented 2023-12-29 12:11:16 +01:00 (Migrated from github.com)

This is not a clean installation, but an upgrade from bullseye

I never upgrade my RPis and it's also not recommended by the foundation. Looks like there is some issue with the upgrade.

> This is not a clean installation, but an upgrade from bullseye I never upgrade my RPis and it's also not recommended by the foundation. Looks like there is some issue with the upgrade.
fmarzocca commented 2023-12-29 12:14:09 +01:00 (Migrated from github.com)

I cannot do a clean install as it will be a major PITA. On my Raspi there is a NodeRed installation and many additional services all configured, so it is not a matter of just make a $HOME backup. Tenths of files in /etc are involved.

I will investigate on this

I cannot do a clean install as it will be a major PITA. On my Raspi there is a NodeRed installation and many additional services all configured, so it is not a matter of just make a $HOME backup. Tenths of files in /etc are involved. I will investigate on this
fmarzocca commented 2023-12-29 12:28:55 +01:00 (Migrated from github.com)

By adding the symlinks in /boot:

sudo ln -s /boot/firmware/cmdline.txt /boot/cmdline.txt
sudo ln -s /boot/firmware/config.txt /boot/config.txt

rpi-clone has edited the "real" cmdline.txt, not the one in the clone!!

During rpi-clone execution, I see these messages:


Editing /boot/firmware/cmdline.txt PARTUUID to use 93a7c455
Editing /mnt/clone/etc/fstab PARTUUID to use 93a7c455

As you can see, rpi-clone is not editing /mnt/clone/boot/firmware/cmdline.txt, but directly the original /boot/firmware/cmdline.txt!!

By adding the symlinks in /boot: ``` sudo ln -s /boot/firmware/cmdline.txt /boot/cmdline.txt sudo ln -s /boot/firmware/config.txt /boot/config.txt ``` rpi-clone has edited the "real" cmdline.txt, not the one in the clone!! During rpi-clone execution, I see these messages: ``` Editing /boot/firmware/cmdline.txt PARTUUID to use 93a7c455 Editing /mnt/clone/etc/fstab PARTUUID to use 93a7c455 ``` As you can see, rpi-clone is not editing `/mnt/clone/boot/firmware/cmdline.txt`, but directly the original` /boot/firmware/cmdline.txt!`!
framps commented 2023-12-29 13:39:42 +01:00 (Migrated from github.com)

I just executed rpi-clone from my fork on a bookworm system which was installed with the rpi-imager and not upgraded. Everything works as expected.
It's your upgraded bookworm which causes rpi-clone to fail for some reasons.

pi@raspberrypi-bookworm64-lite-cm4:~/github.com/framps/rpi-clone $ sudo ./rpi-clone -f sda

Booted disk: nvme0n1 128.0GB               Destination disk: sda 64.1GB
---------------------------------------------------------------------------
Part               Size    FS     Label           Part   Size    FS     Label   
1 /boot/firmware   512.0M  fat32  --              1      512.0M  fat32  --      
2 root             118.7G  ext4   rootfs          2       59.2G  ext4   rootfs  
---------------------------------------------------------------------------
== Initialize: IMAGE partition table - forced by option ==
1 /boot/firmware      (72.0M used)   : MKFS  SYNC to sda1
2 root                (5.7G used)    : RESIZE  MKFS  SYNC to sda2
---------------------------------------------------------------------------
Run setup script       : no.
Verbose mode           : no.
-----------------------:
** WARNING **          : All destination disk sda data will be overwritten!
-----------------------:

Initialize and clone to the destination disk sda?  (yes/no): y
Optional destination ext type file system label (16 chars max): 

Initializing
  Imaging past partition 1 start.
  => dd if=/dev/nvme0n1 of=/dev/sda bs=1M count=8 ...
  Resizing destination disk last partition ...
    Resize success.
  Changing destination Disk ID ...
  => mkfs -t vfat -F 32  /dev/sda1 ...
  => mkfs -t ext4  /dev/sda2 ...

Syncing file systems (can take a long time)
Syncing mounted partitions:
  Mounting /dev/sda2 on /mnt/clone
mount: (hint) your fstab has been modified, but systemd still uses
       the old version; use 'systemctl daemon-reload' to reload.
  => rsync // /mnt/clone with-root-excludes ...
  Mounting /dev/sda1 on /mnt/clone/boot/firmware
mount: (hint) your fstab has been modified, but systemd still uses
       the old version; use 'systemctl daemon-reload' to reload.
  => rsync /boot/firmware/ /mnt/clone/boot/firmware  ...

Editing /mnt/clone/boot/firmware/cmdline.txt PARTUUID to use d576eb82
Editing /mnt/clone/etc/fstab PARTUUID to use d576eb82
===============================
Done with clone to /dev/sda
   Start - 13:22:31    End - 13:30:47    Elapsed Time - 8:16

Cloned partitions are mounted on /mnt/clone for inspection or customizing.

Hit Enter when ready to unmount the /dev/sda partitions ...

  unmounting /mnt/clone/boot/firmware
  unmounting /mnt/clone
===============================
I just executed rpi-clone from my fork on a bookworm system which was installed with the rpi-imager and **not** upgraded. Everything works as expected. It's your upgraded bookworm which causes rpi-clone to fail for some reasons. ``` pi@raspberrypi-bookworm64-lite-cm4:~/github.com/framps/rpi-clone $ sudo ./rpi-clone -f sda Booted disk: nvme0n1 128.0GB Destination disk: sda 64.1GB --------------------------------------------------------------------------- Part Size FS Label Part Size FS Label 1 /boot/firmware 512.0M fat32 -- 1 512.0M fat32 -- 2 root 118.7G ext4 rootfs 2 59.2G ext4 rootfs --------------------------------------------------------------------------- == Initialize: IMAGE partition table - forced by option == 1 /boot/firmware (72.0M used) : MKFS SYNC to sda1 2 root (5.7G used) : RESIZE MKFS SYNC to sda2 --------------------------------------------------------------------------- Run setup script : no. Verbose mode : no. -----------------------: ** WARNING ** : All destination disk sda data will be overwritten! -----------------------: Initialize and clone to the destination disk sda? (yes/no): y Optional destination ext type file system label (16 chars max): Initializing Imaging past partition 1 start. => dd if=/dev/nvme0n1 of=/dev/sda bs=1M count=8 ... Resizing destination disk last partition ... Resize success. Changing destination Disk ID ... => mkfs -t vfat -F 32 /dev/sda1 ... => mkfs -t ext4 /dev/sda2 ... Syncing file systems (can take a long time) Syncing mounted partitions: Mounting /dev/sda2 on /mnt/clone mount: (hint) your fstab has been modified, but systemd still uses the old version; use 'systemctl daemon-reload' to reload. => rsync // /mnt/clone with-root-excludes ... Mounting /dev/sda1 on /mnt/clone/boot/firmware mount: (hint) your fstab has been modified, but systemd still uses the old version; use 'systemctl daemon-reload' to reload. => rsync /boot/firmware/ /mnt/clone/boot/firmware ... Editing /mnt/clone/boot/firmware/cmdline.txt PARTUUID to use d576eb82 Editing /mnt/clone/etc/fstab PARTUUID to use d576eb82 =============================== Done with clone to /dev/sda Start - 13:22:31 End - 13:30:47 Elapsed Time - 8:16 Cloned partitions are mounted on /mnt/clone for inspection or customizing. Hit Enter when ready to unmount the /dev/sda partitions ... unmounting /mnt/clone/boot/firmware unmounting /mnt/clone =============================== ```
fmarzocca commented 2023-12-29 13:46:00 +01:00 (Migrated from github.com)

Ok, I will give up with rpi-clone.. Thanks.
But there will be hundreds of users with this problem. Maybe finding a solution to the tool should be the best option.

Ok, I will give up with rpi-clone.. Thanks. But there will be hundreds of users with this problem. Maybe finding a solution to the tool should be the best option.
framps commented 2023-12-29 13:53:11 +01:00 (Migrated from github.com)

But there will be hundreds of users with this problem.

Only people who upgraded to bookworm and I don't think that's done by a lot of people.

Maybe finding a solution to the tool should be the best option.

I agree. Maybe someone is willing to investigate on this. I'll apply the fix in my fork as soon as there is one available.

> But there will be hundreds of users with this problem. Only people who upgraded to bookworm and I don't think that's done by a lot of people. > Maybe finding a solution to the tool should be the best option. I agree. Maybe someone is willing to investigate on this. I'll apply the fix in my fork as soon as there is one available.
framps commented 2023-12-29 13:56:55 +01:00 (Migrated from github.com)

BTW: I wrote a script which syncs the fstab and cmdline.txt with the actual UUIDs of the SD card.

Maybe this mitigates your issue with rpi-clone. Just call this script when rpi-clone finished and it will fix the incorrect UUIDs.

BTW: I wrote a [script](https://github.com/framps/raspberryTools/blob/master/syncUUIDs.sh) which syncs the fstab and cmdline.txt with the actual UUIDs of the SD card. Maybe this mitigates your issue with rpi-clone. Just call this script when rpi-clone finished and it will fix the incorrect UUIDs.
fmarzocca commented 2023-12-29 13:59:05 +01:00 (Migrated from github.com)

BTW: I wrote a script which syncs

Yes, I'll give it a try! Why don't you embed it in your rpi-clone fork?
Does the script takes into consideration the new /boot/firmware mount point?

> BTW: I wrote a [script](https://github.com/framps/raspberryTools/blob/master/syncUUIDs.sh) which syncs Yes, I'll give it a try! Why don't you embed it in your rpi-clone fork? Does the script takes into consideration the new /boot/firmware mount point?
framps commented 2023-12-29 14:03:01 +01:00 (Migrated from github.com)

Does the script takes into consideration the new /boot/firmware mount point?

Yes. See this commit I created this morning.

> Does the script takes into consideration the new /boot/firmware mount point? Yes. See [this commit](https://github.com/framps/raspberryTools/commit/a029e535c3f008fddd03ea284da784486a031c28) I created this morning.
fmarzocca commented 2023-12-29 14:15:02 +01:00 (Migrated from github.com)

I have run rpi-clone with '-x' option to have max verbosity, and this is what I found:

+ fstab=/mnt/clone/etc/fstab
++ realpath /mnt/clone/boot/cmdline.txt                     <---------------------
+ cmdline_txt=/boot/firmware/cmdline.txt                  <---------------------
+ '[' -f /boot/firmware/cmdline.txt ']'
+ (( leave_sd_usb_boot && SD_slot_dst ))
+ grep -q b4a2e918 /boot/firmware/cmdline.txt
+ qecho 'Editing /boot/firmware/cmdline.txt PARTUUID to use 93a7c455'
+ (( !quiet ))
+ echo 'Editing /boot/firmware/cmdline.txt PARTUUID to use 93a7c455'
Editing /boot/firmware/cmdline.txt PARTUUID to use 93a7c455              <---------------------
+ sed -i s/b4a2e918/93a7c455/ /boot/firmware/cmdline.txt
+ (( leave_sd_usb_boot && SD_slot_boot ))
+ grep -q b4a2e918 /mnt/clone/etc/fstab
+ qecho 'Editing /mnt/clone/etc/fstab PARTUUID to use 93a7c455'
+ (( !quiet ))
+ echo 'Editing /mnt/clone/etc/fstab PARTUUID to use 93a7c455'
Editing /mnt/clone/etc/fstab PARTUUID to use 93a7c455
+ sed -i s/b4a2e918/93a7c455/g /mnt/clone/etc/fstab
+ rm -f /mnt/clone/etc/udev/rules.d/70-persistent-net.rules
++ e2label /dev/sda2

As you can see, cmdline_txt is pointing to the active cmdline.txt ! How can that be if the code line is this:
cmdline_txt=$(realpath ${clone}/boot/cmdline.txt)

Look at the lines I have highlighted

I have run rpi-clone with '-x' option to have max verbosity, and this is what I found: ``` + fstab=/mnt/clone/etc/fstab ++ realpath /mnt/clone/boot/cmdline.txt <--------------------- + cmdline_txt=/boot/firmware/cmdline.txt <--------------------- + '[' -f /boot/firmware/cmdline.txt ']' + (( leave_sd_usb_boot && SD_slot_dst )) + grep -q b4a2e918 /boot/firmware/cmdline.txt + qecho 'Editing /boot/firmware/cmdline.txt PARTUUID to use 93a7c455' + (( !quiet )) + echo 'Editing /boot/firmware/cmdline.txt PARTUUID to use 93a7c455' Editing /boot/firmware/cmdline.txt PARTUUID to use 93a7c455 <--------------------- + sed -i s/b4a2e918/93a7c455/ /boot/firmware/cmdline.txt + (( leave_sd_usb_boot && SD_slot_boot )) + grep -q b4a2e918 /mnt/clone/etc/fstab + qecho 'Editing /mnt/clone/etc/fstab PARTUUID to use 93a7c455' + (( !quiet )) + echo 'Editing /mnt/clone/etc/fstab PARTUUID to use 93a7c455' Editing /mnt/clone/etc/fstab PARTUUID to use 93a7c455 + sed -i s/b4a2e918/93a7c455/g /mnt/clone/etc/fstab + rm -f /mnt/clone/etc/udev/rules.d/70-persistent-net.rules ++ e2label /dev/sda2 ``` As you can see, cmdline_txt is pointing to the active cmdline.txt ! How can that be if the code line is this: `cmdline_txt=$(realpath ${clone}/boot/cmdline.txt)` Look at the lines I have highlighted
fmarzocca commented 2023-12-29 14:20:20 +01:00 (Migrated from github.com)

Found.
Line 1730 on rpi-clone should be:

cmdline_txt=${clone}$(realpath /boot/cmdline.txt)

Found. Line 1730 on rpi-clone should be: `cmdline_txt=${clone}$(realpath /boot/cmdline.txt)`
fmarzocca commented 2023-12-29 14:38:25 +01:00 (Migrated from github.com)

With that mod, it is working fine. Correct UUIDs are in the cloned system and no modification occurred in the running system. Can you apply the fix in your code (if you agree)?

(syntax of that line was wrong in any case. It was pointing at the running system folder, as the symlink is pointing there)

With that mod, it is working fine. Correct UUIDs are in the cloned system and no modification occurred in the running system. Can you apply the fix in your code (if you agree)? (syntax of that line was wrong in any case. It was pointing at the running system folder, as the symlink is pointing there)
framps commented 2023-12-29 15:35:57 +01:00 (Migrated from github.com)

That's interesting:

Your upgraded system does not have the link and therefore realpath doesn't point to the linked file on the clone.

On a non upgraded system the link already exists and therefore realpath resolves to the linked file.

I think the other suggested fix to add --follow-symlinks in the sed commands is a better way to go now because it's easier to understand what's going on there.

I'll change the code to use --follow-symlinks and execute a test with a plain bookworm. If everything is OK I'll commit the change in my fork.

That's interesting: Your upgraded system does not have the link and therefore `realpath` doesn't point to the linked file on the clone. On a non upgraded system the link already exists and therefore `realpath` resolves to the linked file. I think the other suggested fix to add `--follow-symlinks` in the sed commands is a better way to go now because it's easier to understand what's going on there. I'll change the code to use `--follow-symlinks` and execute a test with a plain bookworm. If everything is OK I'll commit the change in my fork.
fmarzocca commented 2023-12-29 15:37:29 +01:00 (Migrated from github.com)

I have manually added the symlink. Without it, no changes were done in the cloned cmdline.txt.

Does my proposed line work in any case also on a fresh install?

I have manually added the symlink. Without it, no changes were done in the cloned cmdline.txt. Does my proposed line work in any case also on a fresh install?
fmarzocca commented 2023-12-29 15:40:09 +01:00 (Migrated from github.com)

I believe this syntax is not correct:
cmdline_txt=$(realpath ${clone}/boot/cmdline.txt)

as you are getting the realpath of /mnt/clone/boot/cmdline.txt, which will find the symlink to /boot/firmware/cmdline.txt
my proposed change is getting the realpath from /boot/cmdline.txt (which is /boot/firmware/cmdline.txt) and prepend to it /mnt/clone.

I believe this syntax is not correct: `cmdline_txt=$(realpath ${clone}/boot/cmdline.txt)` as you are getting the realpath of `/mnt/clone/boot/cmdline.txt`, which will find the symlink to `/boot/firmware/cmdline.txt ` my proposed change is getting the realpath from `/boot/cmdline.txt `(which is /`boot/firmware/cmdline.txt`) and prepend to it `/mnt/clone`.
framps commented 2023-12-29 15:41:48 +01:00 (Migrated from github.com)

Does my proposed line work in any case also on a fresh install?

As far as I understand - yes. But I will switch to --follow-symlinks now. See my previous reply.

> Does my proposed line work in any case also on a fresh install? As far as I understand - yes. But I will switch to `--follow-symlinks` now. See my [previous reply](https://github.com/billw2/rpi-clone/issues/168#issuecomment-1872135895).
bputtick commented 2023-12-29 15:55:46 +01:00 (Migrated from github.com)

When cloning a few SD cards in a row I've noticed that /boot/firmware becomes unmounted and then rpi-clone doesn't update the UUID at all, so I had to make sure that it was mounted each time.. I assume rpi-clone is unmounting it ?

When cloning a few SD cards in a row I've noticed that /boot/firmware becomes unmounted and then rpi-clone doesn't update the UUID at all, so I had to make sure that it was mounted each time.. I assume rpi-clone is unmounting it ?
fmarzocca commented 2023-12-29 15:59:57 +01:00 (Migrated from github.com)

@bputtick , AFAIK rpi-clone is not unmounting any current partition! Just the ones it clones to.

@bputtick , AFAIK rpi-clone is not unmounting any current partition! Just the ones it clones to.
bputtick commented 2023-12-29 16:03:11 +01:00 (Migrated from github.com)

@bputtick , AFAIK rpi-clone is not unmounting any current partition! Just the ones it clones to.

Yeh I've not really investigated it, but it happened more than once and I was just cloning, replacing SD card and repeating and nothing else.

Just thought I'd mention it, in case someone else experienced it.

> @bputtick , AFAIK rpi-clone is not unmounting any current partition! Just the ones it clones to. Yeh I've not really investigated it, but it happened more than once and I was just cloning, replacing SD card and repeating and nothing else. Just thought I'd mention it, in case someone else experienced it.
framps commented 2023-12-29 16:05:00 +01:00 (Migrated from github.com)

I just committed the --follow-symlinks change and successfully tested rpi-clone on a fresh install.

I just committed the `--follow-symlinks` change and successfully tested rpi-clone on a fresh install.
bputtick commented 2023-12-29 16:09:41 +01:00 (Migrated from github.com)

I just committed the --follow-symlinks change and successfully tested rpi-clone on a fresh install.

I felt this was the safest fix, at least until they remove the symlink they put in for backwards compatibly

> I just committed the `--follow-symlinks` change and successfully tested rpi-clone on a fresh install. I felt this was the safest fix, at least until they remove the symlink they put in for backwards compatibly
fmarzocca commented 2023-12-29 16:10:34 +01:00 (Migrated from github.com)

I just committed the --follow-symlinks change and successfully tested rpi-clone on a fresh install.

But line 1730 is still there, with wrong syntax...

> I just committed the `--follow-symlinks` change and successfully tested rpi-clone on a fresh install. But line 1730 is still there, with wrong syntax...
fmarzocca commented 2023-12-29 16:18:54 +01:00 (Migrated from github.com)

...and it is still modifying original file!!!

Editing /boot/firmware/cmdline.txt PARTUUID to use 93a7c455
Editing /mnt/clone/etc/fstab PARTUUID to use 93a7c455
...and it is still modifying original file!!! ``` Editing /boot/firmware/cmdline.txt PARTUUID to use 93a7c455 Editing /mnt/clone/etc/fstab PARTUUID to use 93a7c455 ```
fmarzocca commented 2023-12-29 16:23:38 +01:00 (Migrated from github.com)

I have re-instated my correct line 1730, and it is working back again:

Editing /mnt/clone/boot/firmware/cmdline.txt PARTUUID to use 93a7c455
Editing /mnt/clone/etc/fstab PARTUUID to use 93a7c455
I have re-instated my correct line 1730, and it is working back again: ``` Editing /mnt/clone/boot/firmware/cmdline.txt PARTUUID to use 93a7c455 Editing /mnt/clone/etc/fstab PARTUUID to use 93a7c455 ```
framps commented 2023-12-29 16:23:56 +01:00 (Migrated from github.com)

But line 1730 is still there, with wrong syntax...

👍 Good catch. I now added --follow-symlinks in every sed call.

> But line 1730 is still there, with wrong syntax... :+1: Good catch. I now added `--follow-symlinks` in every sed call.
fmarzocca commented 2023-12-29 16:26:05 +01:00 (Migrated from github.com)

but if you "follow symlink" on the cloned partition, it will point to /boot/firmware and NOT to /mnt/clone/boot/firmware

because of this:
lrwxrwxrwx 1 root root 26 Dec 29 13:53 cmdline.txt -> /boot/firmware/cmdline.txt

but if you "follow symlink" on the cloned partition, it will point to `/boot/firmware` and NOT to `/mnt/clone/boot/firmware` because of this: `lrwxrwxrwx 1 root root 26 Dec 29 13:53 cmdline.txt -> /boot/firmware/cmdline.txt`
fmarzocca commented 2023-12-29 16:30:58 +01:00 (Migrated from github.com)

In this line cmdline_txt contains /mnt/clone/boot/cmdline.txt

sed -i --follow-symlinks "s/${src_disk_ID}/${dst_disk_ID}/" "$cmdline_txt"

and when you follow that symlink, it will then point to /boot/firmware/cmdline.txt

Why you didn't just keep your previous version and change that 1730 line?

In this line cmdline_txt contains /mnt/clone/boot/cmdline.txt `sed -i --follow-symlinks "s/${src_disk_ID}/${dst_disk_ID}/" "$cmdline_txt"` and when you follow that symlink, it will then point to `/boot/firmware/cmdline.txt` Why you didn't just keep your previous version and change that 1730 line?
framps commented 2023-12-29 16:32:41 +01:00 (Migrated from github.com)

Ok. So you're saying the --follow-symlink approach does not work for you and thus realpath is the only way to fix your issue?

I unfortunately have no upgraded bookworm in order to test your scenario 😢

Why you didn't just keep your previous version and change that 1730 line?

Looks like I should revert the --follow-symlinks approach ...

Ok. So you're saying the `--follow-symlink` approach does not work for you and thus `realpath` is the only way to fix your issue? I unfortunately have no upgraded bookworm in order to test your scenario :cry: > Why you didn't just keep your previous version and change that 1730 line? Looks like I should revert the `--follow-symlinks` approach ...
fmarzocca commented 2023-12-29 16:34:18 +01:00 (Migrated from github.com)

Looks like I should revert the --follow-symlinks approach ...

Why, if your previous version was working?

> Looks like I should revert the `--follow-symlinks` approach ... Why, if your previous version was working?
fmarzocca commented 2023-12-29 16:35:43 +01:00 (Migrated from github.com)

Can you send me the output of ls -la /boot on a fresh installed bookworm?

Can you send me the output of `ls -la /boot `on a fresh installed bookworm?
fmarzocca commented 2023-12-29 16:45:18 +01:00 (Migrated from github.com)
Editing /mnt/clone/boot/cmdline.txt PARTUUID to use 93a7c455
Editing /mnt/clone/etc/fstab PARTUUID to use 93a7c455

As you can see, it is NOT following to /mnt/clone/boot/firmware

``` Editing /mnt/clone/boot/cmdline.txt PARTUUID to use 93a7c455 Editing /mnt/clone/etc/fstab PARTUUID to use 93a7c455 ``` As you can see, it is NOT following to /mnt/clone/boot/firmware
framps commented 2023-12-29 16:45:35 +01:00 (Migrated from github.com)

Can you send me the output of ls -la /boot on a fresh installed bookworm?

pi@raspberrypi-bookworm64-lite-cm4:~ $ ls -la /boot
total 102028
drwxr-xr-x  4 root root     4096 Dec 28 14:36 .
drwxr-xr-x 19 root root     4096 Dec 29 15:44 ..
lrwxrwxrwx  1 root root       20 Oct 10 05:39 cmdline.txt -> firmware/cmdline.txt
-rw-r--r--  1 root root   230394 Oct 27 16:31 config-6.1.0-rpi6-rpi-2712
-rw-r--r--  1 root root   230383 Oct 27 16:31 config-6.1.0-rpi6-rpi-v8
-rw-r--r--  1 root root   230416 Nov 24 17:11 config-6.1.0-rpi7-rpi-2712
-rw-r--r--  1 root root   230405 Nov 24 17:11 config-6.1.0-rpi7-rpi-v8
lrwxrwxrwx  1 root root       19 Oct 10 05:39 config.txt -> firmware/config.txt
-rw-r--r--  1 pi   pi         94 Dec 14 18:32 deletedKernels.txt
drwxr-xr-x  3 root root     4096 Jan  1  1970 firmware
drwxr-xr-x  3 root root     4096 Jan  1  1970 firmware.bak
-rw-r--r--  1 root root 17125444 Dec 28 14:36 initrd.img-6.1.0-rpi6-rpi-2712
-rw-r--r--  1 root root 17124794 Dec 28 14:36 initrd.img-6.1.0-rpi6-rpi-v8
-rw-r--r--  1 root root 17126006 Dec 28 14:35 initrd.img-6.1.0-rpi7-rpi-2712
-rw-r--r--  1 root root 17124187 Dec 28 14:35 initrd.img-6.1.0-rpi7-rpi-v8
lrwxrwxrwx  1 root root       17 Oct 10 05:38 overlays -> firmware/overlays
-rw-r--r--  1 pi   pi         94 Dec 16 23:40 raspiHandleKernels.krnl
-rw-r--r--  1 root root       83 Oct 27 16:31 System.map-6.1.0-rpi6-rpi-2712
-rw-r--r--  1 root root       83 Oct 27 16:31 System.map-6.1.0-rpi6-rpi-v8
-rw-r--r--  1 root root       83 Nov 24 17:11 System.map-6.1.0-rpi7-rpi-2712
-rw-r--r--  1 root root       83 Nov 24 17:11 System.map-6.1.0-rpi7-rpi-v8
-rw-r--r--  1 root root  8731342 Oct 27 16:31 vmlinuz-6.1.0-rpi6-rpi-2712
-rw-r--r--  1 root root  8729756 Oct 27 16:31 vmlinuz-6.1.0-rpi6-rpi-v8
-rw-r--r--  1 root root  8762266 Nov 24 17:11 vmlinuz-6.1.0-rpi7-rpi-2712
-rw-r--r--  1 root root  8760390 Nov 24 17:11 vmlinuz-6.1.0-rpi7-rpi-v8
> Can you send me the output of `ls -la /boot `on a fresh installed bookworm? ``` pi@raspberrypi-bookworm64-lite-cm4:~ $ ls -la /boot total 102028 drwxr-xr-x 4 root root 4096 Dec 28 14:36 . drwxr-xr-x 19 root root 4096 Dec 29 15:44 .. lrwxrwxrwx 1 root root 20 Oct 10 05:39 cmdline.txt -> firmware/cmdline.txt -rw-r--r-- 1 root root 230394 Oct 27 16:31 config-6.1.0-rpi6-rpi-2712 -rw-r--r-- 1 root root 230383 Oct 27 16:31 config-6.1.0-rpi6-rpi-v8 -rw-r--r-- 1 root root 230416 Nov 24 17:11 config-6.1.0-rpi7-rpi-2712 -rw-r--r-- 1 root root 230405 Nov 24 17:11 config-6.1.0-rpi7-rpi-v8 lrwxrwxrwx 1 root root 19 Oct 10 05:39 config.txt -> firmware/config.txt -rw-r--r-- 1 pi pi 94 Dec 14 18:32 deletedKernels.txt drwxr-xr-x 3 root root 4096 Jan 1 1970 firmware drwxr-xr-x 3 root root 4096 Jan 1 1970 firmware.bak -rw-r--r-- 1 root root 17125444 Dec 28 14:36 initrd.img-6.1.0-rpi6-rpi-2712 -rw-r--r-- 1 root root 17124794 Dec 28 14:36 initrd.img-6.1.0-rpi6-rpi-v8 -rw-r--r-- 1 root root 17126006 Dec 28 14:35 initrd.img-6.1.0-rpi7-rpi-2712 -rw-r--r-- 1 root root 17124187 Dec 28 14:35 initrd.img-6.1.0-rpi7-rpi-v8 lrwxrwxrwx 1 root root 17 Oct 10 05:38 overlays -> firmware/overlays -rw-r--r-- 1 pi pi 94 Dec 16 23:40 raspiHandleKernels.krnl -rw-r--r-- 1 root root 83 Oct 27 16:31 System.map-6.1.0-rpi6-rpi-2712 -rw-r--r-- 1 root root 83 Oct 27 16:31 System.map-6.1.0-rpi6-rpi-v8 -rw-r--r-- 1 root root 83 Nov 24 17:11 System.map-6.1.0-rpi7-rpi-2712 -rw-r--r-- 1 root root 83 Nov 24 17:11 System.map-6.1.0-rpi7-rpi-v8 -rw-r--r-- 1 root root 8731342 Oct 27 16:31 vmlinuz-6.1.0-rpi6-rpi-2712 -rw-r--r-- 1 root root 8729756 Oct 27 16:31 vmlinuz-6.1.0-rpi6-rpi-v8 -rw-r--r-- 1 root root 8762266 Nov 24 17:11 vmlinuz-6.1.0-rpi7-rpi-2712 -rw-r--r-- 1 root root 8760390 Nov 24 17:11 vmlinuz-6.1.0-rpi7-rpi-v8 ```
framps commented 2023-12-29 16:53:35 +01:00 (Migrated from github.com)

As you can see, it is NOT following to /mnt/clone/boot/firmware

In the echo command there is no realpath nor --follow-symlink used. In the corresponding sed command --follow-symlink ist used 😉

If realpath is used the echo command will echo the correct filename and use the correct filename in sed.

So both ways work correctly but for the --symlink case the echo command echos not the final target filename.

> As you can see, it is NOT following to /mnt/clone/boot/firmware In the echo command there is no realpath nor --follow-symlink used. In the corresponding sed command --follow-symlink ist used :wink: If realpath is used the echo command will echo the correct filename and use the correct filename in sed. So both ways work correctly but for the --symlink case the echo command echos not the final target filename.
fmarzocca commented 2023-12-29 16:54:03 +01:00 (Migrated from github.com)

Aaaaaah! That /boot directory!

I fixed my symlinks in /boot. Now it works, thanks!

Aaaaaah! That /boot directory! I fixed my symlinks in `/boot`. Now it works, thanks!
fmarzocca commented 2023-12-29 18:15:14 +01:00 (Migrated from github.com)

@framps Have you reverted it back to realpath??? SHould I have to test everything again?

@framps Have you reverted it back to realpath??? SHould I have to test everything again?
jdrch commented 2023-12-29 20:27:02 +01:00 (Migrated from github.com)

Replaced SD. It is working, thanks.

SD cards fail in weird ways, often not all at once, either.

I think the reason @fmarzocca & @framps are seeing different things is there are a lot of underlying changes in the specific case of the Raspberry Pi OS v11.x to v12.x update that apt doesn't - and some that it can't - account for. I "successfully" updated a 3B+ from 11 to 12 myself, only to run into apt update problems later because packages, dependencies, etc. weren't located in the filesystem where Raspberry Pi OS v12 apt expected them to be. I wound up having to clean install to resolve the issues.

@fmarzocca I don't know the exact reason a clean install won't work for you, but in my case I'd avoided doing so due to an application, UniFi Controller, with dependencies that can't be fulfilled (not by default, at least) by later versions of Raspberry Pi OS. Fortunately, I found instructions online on how to do so with a clean install. You may wind up having to do something similar or - as is possible with UniFi Controller - migrate to a 1st party appliance that has already solved that problem.

> Replaced SD. It is working, thanks. SD cards fail in weird ways, often not all at once, either. I think the reason @fmarzocca & @framps are seeing different things is there are a lot of underlying changes in the *specific* case of the Raspberry Pi OS v11.x to v12.x update that `apt` doesn't - and some that it *can't* - account for. I "successfully" updated a 3B+ from 11 to 12 myself, only to run into `apt update` problems later because packages, dependencies, etc. weren't located in the filesystem where Raspberry Pi OS v12 `apt` expected them to be. I wound up having to clean install to resolve the issues. @fmarzocca I don't know the exact reason a clean install won't work for you, but in my case I'd avoided doing so due to an application, UniFi Controller, with dependencies that can't be fulfilled (not by default, at least) by later versions of Raspberry Pi OS. Fortunately, I found [instructions online](https://pimylifeup.com/rasberry-pi-unifi/) on how to do so with a clean install. You may wind up having to do something similar or - as is possible with UniFi Controller - migrate to a 1st party appliance that has already solved that problem.
fmarzocca commented 2023-12-29 20:41:47 +01:00 (Migrated from github.com)

@fmarzocca I don't know the exact reason a clean install won't work for you,

I didn't say that it won't work, but that it is a major PITA. My server has a complex NodeRed installation (which can be easily backed up, but it also have several (maybe 7 or 8) additional services that have been carefully tuned up during years (i.e.: apcupsd, gammu, email, mosquitto and many others). It is not just a matter of backup the home folder. To do a complete new installation I should save all the settings and stop the server for several days (I don't have full time free) and this will completely stop the domotics. And I am sure I will forgot something. That's why I took the way of an upgrade which - I may be honest - is fully working for ten days without problems. I have fiuxed this last issue with rpi-clone.

> @fmarzocca I don't know the exact reason a clean install won't work for you, I didn't say that it won't work, but that it is a major PITA. My server has a complex NodeRed installation (which can be easily backed up, but it also have several (maybe 7 or 8) additional services that have been carefully tuned up during years (i.e.: apcupsd, gammu, email, mosquitto and many others). It is not just a matter of backup the home folder. To do a complete new installation I should save all the settings and stop the server for several days (I don't have full time free) and this will completely stop the domotics. And I am sure I will forgot something. That's why I took the way of an upgrade which - I may be honest - is fully working for ten days without problems. I have fiuxed this last issue with rpi-clone.
framps commented 2023-12-29 20:43:39 +01:00 (Migrated from github.com)

Have you reverted it back to realpath

Yes. That way the echo displays the symlinked filename.

So now the code uses realpath again with your suggested modification in line 1730 😉

> Have you reverted it back to realpath Yes. That way the echo displays the symlinked filename. So now the code uses realpath again with your suggested modification in line 1730 :wink:
fmarzocca commented 2023-12-29 20:47:10 +01:00 (Migrated from github.com)

I "successfully" updated a 3B+ from 11 to 12 myself,

@jdrch 32-bit or 64-bit?

> I "successfully" updated a 3B+ from 11 to 12 myself, @jdrch 32-bit or 64-bit?
jdrch commented 2023-12-29 21:27:20 +01:00 (Migrated from github.com)

I "successfully" updated a 3B+ from 11 to 12 myself,

@jdrch 32-bit or 64-bit?

32-bit.

All subsequent deployments have been 64-bit.

> > I "successfully" updated a 3B+ from 11 to 12 myself, > > @jdrch 32-bit or 64-bit? 32-bit. All subsequent deployments have been 64-bit.
phillipredshirt commented 2023-12-30 16:47:59 +01:00 (Migrated from github.com)

Following the link from this comment

"I think that's not dependent on the new HW but the SW required by RPi5. As far as I know RPi5 requires bookworm and rpi-clone works with bookworm if you apply the patch listed in https://github.com/billw2/rpi-clone/issues/168."

rpi-clone fails for me when trying on my RPI 5

What is the patch? It seems like this is still in flux.

Following the link from this comment "I think that's not dependent on the new HW but the SW required by RPi5. As far as I know RPi5 requires bookworm and rpi-clone works with bookworm if you apply the patch listed in https://github.com/billw2/rpi-clone/issues/168." rpi-clone fails for me when trying on my RPI 5 What is the patch? It seems like this is still in flux.
fmarzocca commented 2023-12-30 16:59:25 +01:00 (Migrated from github.com)

What is the patch? It seems like this is still in flux.

@phillipredshirt use this fork, it has been patched and working.

> What is the patch? It seems like this is still in flux. @phillipredshirt use [this fork](https://github.com/framps/rpi-clone), it has been patched and working.
phillipredshirt commented 2023-12-30 17:34:10 +01:00 (Migrated from github.com)

It's still not working. During boot I get:

`Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
Begin: Running /scripts/local-premount ... done
Begin: Waiting for root file system ... Begin: Running /scripts/local-block ...done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.

same line about 15 times then

done.
Gave up waiting for root file system device. Common problems .

...
ALERT! PARTUUID=20ffxxxx-02 does not exist. Dropping to a shell!

`

That's the PARTUUID of the SD card.

It's still not working. During boot I get: `Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done. Begin: Running /scripts/local-premount ... done Begin: Waiting for root file system ... Begin: Running /scripts/local-block ...done. Begin: Running /scripts/local-block ... done. Begin: Running /scripts/local-block ... done. Begin: Running /scripts/local-block ... done. same line about 15 times then done. Gave up waiting for root file system device. Common problems . ... ALERT! PARTUUID=20ffxxxx-02 does not exist. Dropping to a shell! ` That's the PARTUUID of the SD card.
phillipredshirt commented 2023-12-30 18:00:24 +01:00 (Migrated from github.com)

@fmarzocca I used the fork and it didn't change anything and then I used the -l switch on the command like this

sudo rpi-clone -l sda

and now I can't boot from the SD card either. It get the same error but points to the PARTUUID of the SSD which isn't plugged in.

So, I kept both the SD card and the SSD and it boots. I think my pi is a little mixed up now.

Edit:

Since it looked like "rpi-clone sda" was failing to update the PARTUUID information on the SSD and "rpi-clone -l sda" modified the SD to point to the PARTUUID of the SSD, I decided to run "rpi-clone sda" one more time. And it worked.

That was weird and a little scary. But my Pi 5 is now running on just my SSD.

Thank you, @fmarzocca

@fmarzocca I used the fork and it didn't change anything and then I used the -l switch on the command like this sudo rpi-clone -l sda and now I can't boot from the SD card either. It get the same error but points to the PARTUUID of the SSD which isn't plugged in. So, I kept both the SD card and the SSD and it boots. I think my pi is a little mixed up now. Edit: Since it looked like "rpi-clone sda" was failing to update the PARTUUID information on the SSD and "rpi-clone -l sda" modified the SD to point to the PARTUUID of the SSD, I decided to run "rpi-clone sda" one more time. And it worked. That was weird and a little scary. But my Pi 5 is now running on just my SSD. Thank you, @fmarzocca
matatata commented 2024-01-02 16:35:46 +01:00 (Migrated from github.com)

Thank you @framps !! It took me some digging to understand what was going wrong. Once I knew I also found this issue here and the fork which worked very well when cloning to usb. I finally could boot it, because the cmdline.txt was updated properly on the usb. Please @billw2 look into the fork or at least make a note in the readme that current bookworm systems have this problem.

Thank you @framps !! It took me some digging to understand what was going wrong. Once I knew I also found this issue here and the fork which worked very well when cloning to usb. I finally could boot it, because the cmdline.txt was updated properly on the usb. Please @billw2 look into the fork or at least make a note in the readme that current bookworm systems have this problem.
jdrch commented 2024-01-02 16:37:07 +01:00 (Migrated from github.com)

Thank you @framps !! It took me some digging to understand what was going wrong. Once I knew I also found this issue here and the fork which worked very well when cloning to usb. I finally could boot it, because the cmdline.txt was updated properly on the usb. Please @billw2 look into the fork or at least make a note in the readme that current bookworm systems have this problem.

Reasonably sure this repo has been abandoned.

> Thank you @framps !! It took me some digging to understand what was going wrong. Once I knew I also found this issue here and the fork which worked very well when cloning to usb. I finally could boot it, because the cmdline.txt was updated properly on the usb. Please @billw2 look into the fork or at least make a note in the readme that current bookworm systems have this problem. Reasonably sure this repo has been abandoned.
teq0 commented 2024-01-09 03:10:47 +01:00 (Migrated from github.com)

Not working with Bookworm at all for me, even with the patch. When I do

sudo rpi-clone sda -v -f

when it boots it ends up saying

Gave up waiting for root file system device...

and sits in a Busybox shell with an initramfs prompt.

Using

sudo rpi-clone sda -v

after booting it ends up like

Trying partition: 0
lba: 8192 oem:  'mkfs.fat' volume: ' NO NAME   '
...
Firmware not found

Tried with 2 different SD cards. What am I doing wrong? This worked fine on another Pi running buster.

Not working with Bookworm at all for me, even with the patch. When I do `sudo rpi-clone sda -v -f` when it boots it ends up saying ``` Gave up waiting for root file system device... ``` and sits in a Busybox shell with an initramfs prompt. Using `sudo rpi-clone sda -v` after booting it ends up like ``` Trying partition: 0 lba: 8192 oem: 'mkfs.fat' volume: ' NO NAME ' ... Firmware not found ``` Tried with 2 different SD cards. What am I doing wrong? This worked fine on another Pi running buster.
teq0 commented 2024-01-09 03:52:20 +01:00 (Migrated from github.com)

Pi 4. And it's the lite image.

Does Raspi Imager change the image based on the machine? I've burned a bunch of Bookworm Lite cards and told it it was for Pi 4 but they run fine in 3 and 3+s.

I'll try cloning Bookworm on a 3 and see what happens.

Pi 4. And it's the lite image. Does Raspi Imager change the image based on the machine? I've burned a bunch of Bookworm Lite cards and told it it was for Pi 4 but they run fine in 3 and 3+s. I'll try cloning Bookworm on a 3 and see what happens.
jdrch commented 2024-01-09 05:28:40 +01:00 (Migrated from github.com)

I think you wind up with 2 different images if you update from 11.x vs. clean install 12.x.

I think you wind up with 2 different images if you update from 11.x vs. clean install 12.x.
framps commented 2024-01-09 18:31:48 +01:00 (Migrated from github.com)

I may be wrong but I guess my fork of rpi-clone fails if Bookworm is not a fresh install but an upgrade from Bullseye. In #174 I helped the guy to check the UUIDs and they didn't match even rpi-clone updated /boot/cmdline.txt. But if /boot/cmdline.txt is a file and no link to /boot/firmware/cmdline.txt rpi-clone updates /boot/cmdline.txt but not /boot/firmware/cmdline.txt. But this file is not used during boot and therefore boot fails because of UUID mismatch.

Maybe somebody who runs an upgraded Bookworm can verify whether my guess is correct?

I may be wrong but I guess my fork of rpi-clone fails if Bookworm is not a fresh install but an upgrade from Bullseye. In #174 I helped the guy to check the UUIDs and they didn't match even rpi-clone updated /boot/cmdline.txt. But if /boot/cmdline.txt is a file and no link to /boot/firmware/cmdline.txt rpi-clone updates /boot/cmdline.txt but not /boot/firmware/cmdline.txt. But this file is not used during boot and therefore boot fails because of UUID mismatch. Maybe somebody who runs an upgraded Bookworm can verify whether my guess is correct?
jdrch commented 2024-01-09 19:19:05 +01:00 (Migrated from github.com)

fails if Bookworm is not a fresh install but an upgrade from Bullseye

This has been my experience too.

Maybe somebody who runs an upgraded Bookworm can verify whether my guess is correct?

The irony of that request is because the 11.x to 12.x upgrade path isn't officially supported, upgraded 12.x installations eventually run into breaking issues, such apt being unable to satisfy dependencies.

In other words, as horrible as it sounds, I don't think supporting upgraded 12.x installations is worthwhile, as it's pretty much impossible to guarantee the config/folder structure/locations the script is operating on.

> fails if Bookworm is not a fresh install but an upgrade from Bullseye This has been my experience too. > Maybe somebody who runs an upgraded Bookworm can verify whether my guess is correct? The irony of that request is because the 11.x to 12.x upgrade path isn't officially supported, upgraded 12.x installations eventually run into breaking issues, such `apt` being unable to satisfy dependencies. In other words, as horrible as it sounds, I don't think supporting upgraded 12.x installations is worthwhile, as it's pretty much impossible to guarantee the config/folder structure/locations the script is operating on.
framps commented 2024-01-09 19:25:18 +01:00 (Migrated from github.com)

11.x to 12.x upgrade path isn't officially supported

That's why I install a fresh OS every time I want to upgrade my systems and I don't have a system handy which was upgraded to verify my guess.

Actually it's not a big deal to check whether /boot/cmdline.txt is a file and create a link to /boot/firmware/cmdline.txt. But I frankly don't like to fix this under the cover in rpi-clone. Maybe it's worth to check and write an error message and nobody blames rpi-clone .

> 11.x to 12.x upgrade path isn't officially supported That's why I install a fresh OS every time I want to upgrade my systems and I don't have a system handy which was upgraded to verify my guess. Actually it's not a big deal to check whether /boot/cmdline.txt is a file and create a link to /boot/firmware/cmdline.txt. But I frankly don't like to fix this under the cover in rpi-clone. Maybe it's worth to check and write an error message and nobody blames rpi-clone .
jdrch commented 2024-01-09 20:01:34 +01:00 (Migrated from github.com)

That's why I install a fresh OS every time I want to upgrade my systems and I don't have a system handy which was upgraded to verify my guess.

Requiring clean installs for major version upgrades is pretty retrograde and anachronistic of the Raspberry Pi Foundation (I'm not blaming @framps, @billw2, or anyone else) in 2024 AD when the vast majority of major OSes, including the one Raspberry Pi OS is based on, support in-place upgrades. Indeed, Debian itself supports 11.x to 12.x upgrades. I know this because I did it just fine with my Debian server.

I appreciate the Foundation warning users of the risks of in-place upgrades, but the fact they aren't supported reflects poorly on the Foundation and the Foundation only.

Maybe it's worth to check and write an error message and nobody blames rpi-clone .

Correct. This is a Raspberry Pi OS, and therefore a Raspberry Pi Foundation problem. Except they don't see it as a problem.

I'd say rpi-clone should probably have an option to toggle between cloning for the following environments:

  1. v12.x, clean installed
  2. all versions up to 11.x

As I said in a previous comment, I don't think it's fair to developers to ask them to support 11.x to higher major version in-place upgrades if the underlying OS itself doesn't support them.

> That's why I install a fresh OS every time I want to upgrade my systems and I don't have a system handy which was upgraded to verify my guess. Requiring clean installs for major version upgrades is pretty retrograde and anachronistic *of the Raspberry Pi Foundation* (I'm not blaming @framps, @billw2, or anyone else) in *2024 AD* when the vast majority of major OSes, including the one Raspberry Pi OS is based on, support in-place upgrades. Indeed, Debian itself supports 11.x to 12.x upgrades. I know this because I did it just fine with my Debian server. I appreciate the Foundation warning users of the risks of in-place upgrades, but the fact they aren't supported reflects poorly on the Foundation and the Foundation only. > Maybe it's worth to check and write an error message and nobody blames rpi-clone . Correct. This is a Raspberry Pi OS, and therefore a Raspberry Pi Foundation problem. Except they don't see it as a problem. I'd say `rpi-clone` should probably have an option to toggle between cloning for the following environments: 1. v12.x, clean installed 2. all versions up to 11.x As I said in a previous comment, I don't think it's fair to developers to ask them to support 11.x to higher major version in-place upgrades if the underlying OS itself doesn't support them.
fmarzocca commented 2024-01-09 21:04:37 +01:00 (Migrated from github.com)

I have upgraded 4 Raspi 3B+ from bullseye to bookworm, and I am happily using @framps' fork, provided to execute (after kernel update) the following:

cd /boot
sudo ln -s firmware/cmdline.txt ./cmdline.txt
sudo ln -s firmware/config.txt ./config.txt
I have upgraded 4 Raspi 3B+ from bullseye to bookworm, and I am happily using @framps' fork, provided to execute (after kernel update) the following: ``` cd /boot sudo ln -s firmware/cmdline.txt ./cmdline.txt sudo ln -s firmware/config.txt ./config.txt ```
framps commented 2024-01-09 21:12:50 +01:00 (Migrated from github.com)

This proves an upgraded OS misses the links which are new to Bookworm and everybody who upgraded has to execute these commands first and then rpi-clone will create a bootable clone.

This proves an upgraded OS misses the links which are new to Bookworm and everybody who upgraded has to execute these commands first and then rpi-clone will create a bootable clone.
fmarzocca commented 2024-01-09 21:14:02 +01:00 (Migrated from github.com)

This proves an upgraded OS misses the links which are new to Bookworm and everybody who upgraded has to execute these commands first and then rpi-clone will create a bootable clone.

Correct.

> This proves an upgraded OS misses the links which are new to Bookworm and everybody who upgraded has to execute these commands first and then rpi-clone will create a bootable clone. Correct.
ProblemChild4901 commented 2024-01-10 15:34:45 +01:00 (Migrated from github.com)

I am suprised this this works. I would have thought that a bullseye to bookworm upgrade would retain the old /boot mountpount, creating the /boot/firmware directory within the /boot filesystem. I was under the impression that vfat filesystems do not support unix symbolic links.

I am suprised this this works. I would have thought that a bullseye to bookworm upgrade would retain the old /boot mountpount, creating the /boot/firmware directory within the /boot filesystem. I was under the impression that vfat filesystems do not support unix symbolic links.
framps commented 2024-01-10 16:08:52 +01:00 (Migrated from github.com)

Keep in mind the boot partition is mounted on Bookworm now at /boot/firmware and /boot is located on the root filesystem which is formatted with ext4 and supports symlinks.

pi@raspberrypi-bookworm64-lite:~ $ ls -la /boot
total 39292
drwxr-xr-x  3 root root     4096 Jan  8 21:33 .
drwxr-xr-x 18 root root     4096 Dec 11 05:55 ..
-rw-r--r--  1 root root       83 Nov 24 17:11 System.map-6.1.0-rpi7-rpi-2712
-rw-r--r--  1 root root       83 Nov 24 17:11 System.map-6.1.0-rpi7-rpi-v8
lrwxrwxrwx  1 root root       20 Dec 11 05:37 cmdline.txt -> firmware/cmdline.txt
-rw-r--r--  1 root root   230416 Nov 24 17:11 config-6.1.0-rpi7-rpi-2712
-rw-r--r--  1 root root   230405 Nov 24 17:11 config-6.1.0-rpi7-rpi-v8
lrwxrwxrwx  1 root root       19 Dec 11 05:37 config.txt -> firmware/config.txt
drwxr-xr-x  3 root root     4096 Jan  1  1970 firmware
-rw-r--r--  1 root root 11108528 Dec 11 05:54 initrd.img-6.1.0-rpi7-rpi-2712
-rw-r--r--  1 root root 11108073 Dec 11 05:54 initrd.img-6.1.0-rpi7-rpi-v8
lrwxrwxrwx  1 root root       18 Dec 11 05:54 issue.txt -> firmware/issue.txt
lrwxrwxrwx  1 root root       17 Dec 11 05:36 overlays -> firmware/overlays
-rw-r--r--  1 root root  8762266 Nov 24 17:11 vmlinuz-6.1.0-rpi7-rpi-2712
-rw-r--r--  1 root root  8760390 Nov 24 17:11 vmlinuz-6.1.0-rpi7-rpi-v8

pi@raspberrypi-bookworm64-lite:~ $ mount | grep mmcblk0p
/dev/mmcblk0p2 on / type ext4 (rw,noatime)
/dev/mmcblk0p1 on /boot/firmware type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
Keep in mind the boot partition is mounted on Bookworm now at /boot/firmware and /boot is located on the root filesystem which is formatted with ext4 and supports symlinks. ``` pi@raspberrypi-bookworm64-lite:~ $ ls -la /boot total 39292 drwxr-xr-x 3 root root 4096 Jan 8 21:33 . drwxr-xr-x 18 root root 4096 Dec 11 05:55 .. -rw-r--r-- 1 root root 83 Nov 24 17:11 System.map-6.1.0-rpi7-rpi-2712 -rw-r--r-- 1 root root 83 Nov 24 17:11 System.map-6.1.0-rpi7-rpi-v8 lrwxrwxrwx 1 root root 20 Dec 11 05:37 cmdline.txt -> firmware/cmdline.txt -rw-r--r-- 1 root root 230416 Nov 24 17:11 config-6.1.0-rpi7-rpi-2712 -rw-r--r-- 1 root root 230405 Nov 24 17:11 config-6.1.0-rpi7-rpi-v8 lrwxrwxrwx 1 root root 19 Dec 11 05:37 config.txt -> firmware/config.txt drwxr-xr-x 3 root root 4096 Jan 1 1970 firmware -rw-r--r-- 1 root root 11108528 Dec 11 05:54 initrd.img-6.1.0-rpi7-rpi-2712 -rw-r--r-- 1 root root 11108073 Dec 11 05:54 initrd.img-6.1.0-rpi7-rpi-v8 lrwxrwxrwx 1 root root 18 Dec 11 05:54 issue.txt -> firmware/issue.txt lrwxrwxrwx 1 root root 17 Dec 11 05:36 overlays -> firmware/overlays -rw-r--r-- 1 root root 8762266 Nov 24 17:11 vmlinuz-6.1.0-rpi7-rpi-2712 -rw-r--r-- 1 root root 8760390 Nov 24 17:11 vmlinuz-6.1.0-rpi7-rpi-v8 pi@raspberrypi-bookworm64-lite:~ $ mount | grep mmcblk0p /dev/mmcblk0p2 on / type ext4 (rw,noatime) /dev/mmcblk0p1 on /boot/firmware type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
ProblemChild4901 commented 2024-01-10 18:47:17 +01:00 (Migrated from github.com)

I see unofficial rpios upgrade bullseye to bookworm instructions that do not mention upgrading to the new kernel or say that is is optional. Upgrading the kernel will remount /boot to /boot/firmware like a new installation of bookworm, but likely will not add the symbolic links. I just upgraded a 32bit lite rpios using the "edit apt sources" method. While the upgrade to bookworm works, I was left with this:

pi@raspberrypi:/boot $ mount |grep mmcblk0
/dev/mmcblk0p2 on / type ext4 (rw,noatime)
/dev/mmcblk0p1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)

pi@raspberrypi:/boot $ df -h / /boot
Filesystem Size Used Avail Use% Mounted on
/dev/root 59G 2.1G 54G 4% /
/dev/mmcblk0p1 255M 51M 205M 20% /boot

pi@raspberrypi:/etc $ cat os-release |head -1
PRETTY_NAME="Raspbian GNU/Linux 12 (bookworm)"

pi@raspberrypi:/etc $ ls -la /boot/config.txt /boot/cmdline.txt
-rwxr-xr-x 1 root root 102 Dec 4 21:57 /boot/cmdline.txt
-rwxr-xr-x 1 root root 2075 Dec 4 21:39 /boot/config.txt

In this specific case, the symbolic links not only are not present, but probably are not requred for rpi-clone to work.

I see unofficial rpios upgrade bullseye to bookworm instructions that do not mention upgrading to the new kernel or say that is is optional. Upgrading the kernel will remount /boot to /boot/firmware like a new installation of bookworm, but likely will not add the symbolic links. I just upgraded a 32bit lite rpios using the "edit apt sources" method. While the upgrade to bookworm works, I was left with this: pi@raspberrypi:/boot $ mount |grep mmcblk0 /dev/mmcblk0p2 on / type ext4 (rw,noatime) /dev/mmcblk0p1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro) pi@raspberrypi:/boot $ df -h / /boot Filesystem Size Used Avail Use% Mounted on /dev/root 59G 2.1G 54G 4% / /dev/mmcblk0p1 255M 51M 205M 20% /boot pi@raspberrypi:/etc $ cat os-release |head -1 PRETTY_NAME="Raspbian GNU/Linux 12 (bookworm)" pi@raspberrypi:/etc $ ls -la /boot/config.txt /boot/cmdline.txt -rwxr-xr-x 1 root root 102 Dec 4 21:57 /boot/cmdline.txt -rwxr-xr-x 1 root root 2075 Dec 4 21:39 /boot/config.txt In this specific case, the symbolic links not only are not present, but probably are not requred for rpi-clone to work.
framps commented 2024-01-10 18:57:34 +01:00 (Migrated from github.com)

Bookworm uses /boot/firmware/cmdline.txt during boot and if you modify /boot/cmdline.txt which is no link to /boot/firmware/cmdline.txt this update will be ignored.

That's the root cause for this issue because rpi-clone fails to update the UUID in /boot/firmware/cmdline.txt but instead updates /boot/cmdline.txt.

Bookworm uses /boot/firmware/cmdline.txt during boot and if you modify /boot/cmdline.txt which is no link to /boot/firmware/cmdline.txt this update will be ignored. That's the root cause for this issue because rpi-clone fails to update the UUID in /boot/firmware/cmdline.txt but instead updates /boot/cmdline.txt.
jdrch commented 2024-01-10 19:03:26 +01:00 (Migrated from github.com)

that do not mention upgrading to the new kernel or say that is is optional

The fact that's the case tells you how broken the in-place upgrade path is.

> that do not mention upgrading to the new kernel or say that is is optional The fact that's the case tells you how broken the in-place upgrade path is.
geerlingguy commented 2024-01-21 20:00:58 +01:00 (Migrated from github.com)

@framps thanks for maintaining your fork / patchset! I've also pulled it into my fork, so hopefully anyone looking for a working tool can grab one of the forks (I had been maintaining my fork for the NVMe support, so since it's referred to a lot I decided to pull in your changes instead of just archiving it... would love to find a way for there to be one 'official' place for the project to reside!

Alternatively, does your rpiBackup tool potentially have room for cloning functionality built in? (Last time I looked, I think you had to do some sort of backup + restore to another drive, which was more complex than a straight clone).

@framps thanks for maintaining your fork / patchset! I've also pulled it into my fork, so hopefully anyone looking for a working tool can grab one of the forks (I had been maintaining my fork for the NVMe support, so since it's referred to a lot I decided to pull in your changes instead of just archiving it... would love to find a way for there to be one 'official' place for the project to reside! Alternatively, does your rpiBackup tool potentially have room for cloning functionality built in? (Last time I looked, I think you had to do some sort of backup + restore to another drive, which was more complex than a straight clone).
framps commented 2024-01-21 21:07:44 +01:00 (Migrated from github.com)

so since it's referred to a lot I decided to pull in your changes instead of just archiving it...

NP. Glad you pulled my changes. Whoever uses rpi-clone should be able to use rpi-clone with Bookworm and future OS releases. Whether it's grabbed from your fork or mine 😃

would love to find a way for there to be one 'official' place for the project to reside!

Agree. Given the fact I maintain raspiBackup I don't volunteer to maintain rpi-clone - even I was asked to do this already.

Alternatively, does your rpiBackup tool potentially have room for cloning functionality built in? (

raspiBackup was designed to create backups - not to clone any systems. Indeed you can clone a system by creating a backup and restore this backup. But that's a workaround and not convenient.

I frankly think most of the guys actually want to create a backup instead of a clone. Maybe I'm wrong ... If there is a strong requirement to get a cloning capability in raspiBackup I'll think about this new feature.

> so since it's referred to a lot I decided to pull in your changes instead of just archiving it... NP. Glad you pulled my changes. Whoever uses rpi-clone should be able to use rpi-clone with Bookworm and future OS releases. Whether it's grabbed from your fork or mine :smiley: > would love to find a way for there to be one 'official' place for the project to reside! Agree. Given the fact I maintain raspiBackup I don't volunteer to maintain rpi-clone - even I was asked to do this already. > Alternatively, does your rpiBackup tool potentially have room for cloning functionality built in? ( raspiBackup was designed to create backups - not to clone any systems. Indeed you can clone a system by creating a backup and restore this backup. But that's a workaround and not convenient. I frankly think most of the guys actually want to create a backup instead of a clone. Maybe I'm wrong ... If there is a strong requirement to get a cloning capability in raspiBackup I'll think about this new feature.
geerlingguy commented 2024-01-21 21:17:53 +01:00 (Migrated from github.com)

@framps heh, I want both! :D

But for me, the cloning is often useful just to test different media on the same Pi without having to re-image (though sometimes imaging fresh is faster anyway).

For most people, I think full backups are all they'd ever need, short of a better mechanism to upgrade major versions (something I still never recommend on any Linux OS!).

@framps heh, I want both! :D But for me, the cloning is often useful just to test different media on the same Pi without having to re-image (though sometimes imaging fresh is faster anyway). For most people, I think full backups are all they'd ever need, short of a better mechanism to upgrade major versions (something I still never recommend on any Linux OS!).
framps commented 2024-01-21 21:40:03 +01:00 (Migrated from github.com)

the cloning is often useful just to test different media on the same Pi

I see your point but that's a special use case you have 😃

Most of the folks using raspiBackup just want to have a backup in case either the SD card fails or something went wrong when they do any upgrades or manually do any config updates and which causes the system fail to boot.

> the cloning is often useful just to test different media on the same Pi I see your point but that's a special use case you have :smiley: Most of the folks using raspiBackup just want to have a backup in case either the SD card fails or something went wrong when they do any upgrades or manually do any config updates and which causes the system fail to boot.
framps commented 2024-01-21 21:45:01 +01:00 (Migrated from github.com)

short of a better mechanism to upgrade major versions (something I still never recommend on any Linux OS!)

Neither do I

> short of a better mechanism to upgrade major versions (something I still never recommend on any Linux OS!) Neither do I
jdrch commented 2024-01-22 05:11:55 +01:00 (Migrated from github.com)

But for me, the cloning is often useful just to test different media on the same Pi without having to re-image (though sometimes imaging fresh is faster anyway).

@geerlingguy I've found the easiest way to do this is to use the SD copier utility on a separate Pi. Most of the time if you're having storage media problems on a Pi it's probably unstable anyway, which complicates using it as a clone source. Now, the latter should be possible, but it's not necessarily ideal.

@framps I appreciate raspibackup in the context of the relative scarcity of dedicated Pi backup and restore tools. That said, if you ask me, an ideal backup tool would be a mix of recording partitions and corresponding UUIDs with something like restic for the actual files. That way you get incremental, rapidly restored backups. My main issue with raspibackup as a solution is it has all the inconveniences of a clone operation without restoration convenience (read: the ability to just slap the target disk into the Pi and boot right away) thereof.

This is why I prefer rpi-clone. It's not perfect or incremental, but at least the restore process is as easy as swapping out physical disks.

> But for me, the cloning is often useful just to test different media on the same Pi without having to re-image (though sometimes imaging fresh is faster anyway). @geerlingguy I've found the easiest way to do this is to use the SD copier utility on a separate Pi. Most of the time if you're having storage media problems on a Pi it's probably unstable anyway, which complicates using it as a clone source. Now, the latter *should* be possible, but it's not necessarily ideal. @framps I appreciate `raspibackup` in the context of the relative scarcity of dedicated Pi backup and restore tools. That said, if you ask me, an ideal backup tool would be a mix of recording partitions and corresponding UUIDs with something like `restic` for the actual files. That way you get incremental, rapidly restored backups. My main issue with `raspibackup `as a solution is it has all the inconveniences of a clone operation without restoration convenience (read: the ability to just slap the target disk into the Pi and boot right away) thereof. This is why I prefer `rpi-clone`. It's not perfect or incremental, but at least the restore process is as easy as swapping out physical disks.
fmarzocca commented 2024-01-22 08:24:07 +01:00 (Migrated from github.com)

I frankly think most of the guys actually want to create a backup instead of a clone. Maybe I'm wrong ... If there is a strong requirement to get a cloning capability in raspiBackup I'll think about this new feature.

I use the Raspi with NodeRed to control a complex Home Automation. In addition to NR there are many other modules installed and configured (i.e.: mosquitto, gammu-sms, etc...). My main target is to get a clone in order to swap the SDs in case of failure and reduce the system downtime to few minutes. This is a security issue for me. A backup won't work that way.

> I frankly think most of the guys actually want to create a backup instead of a clone. Maybe I'm wrong ... If there is a strong requirement to get a cloning capability in raspiBackup I'll think about this new feature. I use the Raspi with NodeRed to control a complex Home Automation. In addition to NR there are many other modules installed and configured (i.e.: mosquitto, gammu-sms, etc...). My main target is to get a clone in order to swap the SDs in case of failure and reduce the system downtime to few minutes. This is a security issue for me. A backup won't work that way.
framps commented 2024-01-22 09:55:02 +01:00 (Migrated from github.com)

My main target is to get a clone in order to swap the SDs in case of failure and reduce the system downtime to few minutes.

I'm now convinced a clone feature makes sense. I just created an issue for this in my repo.

> My main target is to get a clone in order to swap the SDs in case of failure and reduce the system downtime to few minutes. I'm now convinced a clone feature makes sense. I just created an [issue](https://github.com/framps/raspiBackup/issues/730) for this in my repo.
bdwilson commented 2024-01-22 14:15:43 +01:00 (Migrated from github.com)

My main target is to get a clone in order to swap the SDs in case of failure and reduce the system downtime to few minutes.

Isn't that goal achieved with rpi-clone? That is what I'm using it for as well, but it only updates what has changed between runs.

> My main target is to get a clone in order to swap the SDs in case of failure and reduce the system downtime to few minutes. Isn't that goal achieved with rpi-clone? That is what I'm using it for as well, but it only updates what has changed between runs.
fmarzocca commented 2024-01-22 16:53:54 +01:00 (Migrated from github.com)

Isn't that goal achieved with rpi-clone? That is what I'm using it for as well, but it only updates what has changed between runs.

Yes, it is. I was answering to a previous question from @framps, if you look at the quoted text.

> Isn't that goal achieved with rpi-clone? That is what I'm using it for as well, but it only updates what has changed between runs. Yes, it is. I was answering to a previous question from @framps, if you look at the quoted text.
bdwilson commented 2024-01-22 17:55:45 +01:00 (Migrated from github.com)

Yes, it is. I was answering to a previous question from @framps, if you look at the quoted text.

It sounded like the cloning feature was being asked for in rpiBackup, so my comment was more geared towards "if it's already done in rpi-clone, why re-create the cloning function in rpiBackup".

> Yes, it is. I was answering to a previous question from @framps, if you look at the quoted text. It sounded like the cloning feature was being asked for in rpiBackup, so my comment was more geared towards "if it's already done in rpi-clone, why re-create the cloning function in rpiBackup".
psfales commented 2024-01-26 17:39:08 +01:00 (Migrated from github.com)

Another vote of thanks for making the fork available! I had been making periodic "clones" of my new bookworm system, but didn't realize I was not protected because the clones would not actually boot. The clones created with the @framps fork will now boot. Thanks!

Another vote of thanks for making the fork available! I had been making periodic "clones" of my new bookworm system, but didn't realize I was not protected because the clones would not actually boot. The clones created with the @framps fork will now boot. Thanks!
framps commented 2024-01-26 19:14:04 +01:00 (Migrated from github.com)

but didn't realize I was not protected because the clones would not actually boot.

I think a lot of folks will detect this fact when they actually need the clone to boot. Fortunately the clone only has inconsistent UUIDs which break the boot and can be fixed manually.

I helped folks with this boot issue multiple times in the past when they cloned their system manually and didn't use rpi-clone. Finally I wrote syncUUIDs 😃

> but didn't realize I was not protected because the clones would not actually boot. I think a lot of folks will detect this fact when they actually need the clone to boot. Fortunately the clone only has inconsistent UUIDs which break the boot and can be fixed manually. I helped folks with this boot issue multiple times in the past when they cloned their system manually and didn't use rpi-clone. Finally I wrote [syncUUIDs](https://github.com/framps/raspberryTools/blob/master/syncUUIDs.sh) :smiley:
zwolfpack commented 2024-01-29 19:27:57 +01:00 (Migrated from github.com)

An update to package raspberrypi-sys-mods released today (2024-01-29) breaks this again.

In the install transcript,

Setting up raspberrypi-sys-mods (20240123) ...
Replacing transitional /boot/cmdline.txt symlink...
Replacing transitional /boot/config.txt symlink...

Sure enough, /boot/cmdline.txt is no longer a symlink to firmware/cmdline.txt; instead a regular file with contents

DO NOT EDIT THIS FILE

The file you are looking for has moved to /boot/firmware/cmdline.txt

So back to the drawing board for a new fix...

An update to package raspberrypi-sys-mods released today (2024-01-29) breaks this again. In the install transcript, ``` Setting up raspberrypi-sys-mods (20240123) ... Replacing transitional /boot/cmdline.txt symlink... Replacing transitional /boot/config.txt symlink... ``` Sure enough, /boot/cmdline.txt is no longer a symlink to firmware/cmdline.txt; instead a regular file with contents ``` DO NOT EDIT THIS FILE The file you are looking for has moved to /boot/firmware/cmdline.txt ``` So back to the drawing board for a new fix...
framps commented 2024-01-29 20:26:24 +01:00 (Migrated from github.com)

Thank you very much for the update 👍

So back to the drawing board for a new fix...

Not a big deal but nevertheless some code change is required again. I will update my fork to update /boot/firmware/cmdline.txt and not rely on the link from /boot any more.

Thank you very much for the update :+1: > So back to the drawing board for a new fix... Not a big deal but nevertheless some code change is required again. I will update my fork to update /boot/firmware/cmdline.txt and not rely on the link from /boot any more.
geerlingguy commented 2024-01-29 20:59:48 +01:00 (Migrated from github.com)

@framps - Can you either file that as a separate PR here or just link to your commit here and I'll make sure that's also pulled in on my fork too? Thanks!

There's so much documentation (blogs, forum posts, etc.) still pointing to /boot files :O

@framps - Can you either file that as a separate PR here or just link to your commit here and I'll make sure that's also pulled in on my fork too? Thanks! There's so much documentation (blogs, forum posts, etc.) still pointing to `/boot` files :O
framps commented 2024-01-29 21:29:06 +01:00 (Migrated from github.com)

I created a fix in a new branch in my fork and executed some initial tests. Looks good so far. Would be great if this fix is reviewed and tested by other folks before I merge the fix into my main branch.

@geerlingguy

There's so much documentation (blogs, forum posts, etc.) still pointing to /boot files :O

Unfortunately 😢 I frankly don't understand why they don't keep the link. That's from a backward compatibility view a no no.

I created a fix in a [new branch](https://github.com/framps/rpi-clone/tree/bookworm_fix_2) in my fork and executed some initial tests. Looks good so far. Would be great if this fix is reviewed and tested by other folks before I merge the fix into my main branch. @geerlingguy > There's so much documentation (blogs, forum posts, etc.) still pointing to /boot files :O Unfortunately :cry: I frankly don't understand why they don't keep the link. That's from a backward compatibility view a no no.
jdrch commented 2024-01-29 22:03:41 +01:00 (Migrated from github.com)

That's from a backward compatibility view

The Foundation has made it pretty clear from their Bookworm release announcement that backwards compatibility isn't a priority for them.

Competing x86-64 options with higher performance and first party Debian support approaching Raspberry Pi pricing should fix that problem.

> That's from a backward compatibility view The Foundation has made it pretty clear from their Bookworm release announcement that backwards compatibility isn't a priority for them. Competing x86-64 options with higher performance and first party Debian support approaching Raspberry Pi pricing should fix that problem.
framps commented 2024-01-29 22:06:22 +01:00 (Migrated from github.com)

backwards compatibility isn't a priority for them.

Ok. Well - I don't like this decision. But why do they added the link first and then removed this link now?

> backwards compatibility isn't a priority for them. Ok. Well - I don't like this decision. But why do they added the link first and then removed this link now?
jdrch commented 2024-01-29 22:08:54 +01:00 (Migrated from github.com)

why do they added the link first and then removed this link now?

If we're lucky, they may have commented the PR/commit containing the change.

> why do they added the link first and then removed this link now? If we're lucky, they may have commented the PR/commit containing the change.
framps commented 2024-01-29 22:29:19 +01:00 (Migrated from github.com)

Nope. Just read the commit comment

Nope. Just read the [commit comment](https://github.com/RPi-Distro/raspberrypi-sys-mods/blob/bookworm/debian/changelog#L10)
fmarzocca commented 2024-01-30 14:46:40 +01:00 (Migrated from github.com)

Would be great if this fix is reviewed and tested by other folks before I merge the fix into my main branch.

Tested OK.

> Would be great if this fix is reviewed and tested by other folks before I merge the fix into my main branch. Tested OK.
framps commented 2024-01-30 20:49:26 +01:00 (Migrated from github.com)

Just to keep you posted: I created an issue and asked for the rational of this update

@fmarzocca Thank you very much for your verification of my fix. In the meantime I found other ways to fix this issue - just check my latest commit.

But I think it's just fine tuning from a coding perspective. I'll merge the fix into my master branch in one week if there is no feedback any more.

Just to keep you posted: I created [an issue](https://github.com/RPi-Distro/raspberrypi-sys-mods/issues/88#issuecomment-1917750269) and asked for the rational of this update @fmarzocca Thank you very much for your verification of my fix. In the meantime I found other ways to fix this issue - just check my [latest commit](https://github.com/framps/rpi-clone/commit/c8739c91865e07328c09f737758b2ee389a3b4cc). But I think it's just fine tuning from a coding perspective. I'll merge the fix into my master branch in one week if there is no feedback any more.
fmarzocca commented 2024-01-30 20:56:24 +01:00 (Migrated from github.com)

@framps IMHO I prefer if [[ -d /boot/firmware ]];, unless you are expecting them to change the boot dir many times/year!
:-)

@framps IMHO I prefer `if [[ -d /boot/firmware ]];`, unless you are expecting them to change the boot dir many times/year! :-)
zwolfpack commented 2024-01-31 01:03:56 +01:00 (Migrated from github.com)

just check my latest commit.

I took a look at this; couple of comments

  1. I like the idea of extracting from /etc/fstab or mount. You might consider
    awk '{ if ($2 ~ "^/boot") print substr($2, 2)}' /etc/fstab
    or
    mount | awk '{ if ($3 ~ "^/boot") print substr($3, 2)}'
    which are slightly less "punctuation salad" IMO ;-)

  2. On line 988 you have a case inconsistency (cmdLineDir vs. cmdlineDir)

> just check my [latest commit](https://github.com/framps/rpi-clone/commit/c8739c91865e07328c09f737758b2ee389a3b4cc). I took a look at this; couple of comments 1) I like the idea of extracting from /etc/fstab or mount. You might consider `awk '{ if ($2 ~ "^/boot") print substr($2, 2)}' /etc/fstab` or `mount | awk '{ if ($3 ~ "^/boot") print substr($3, 2)}'` which are slightly less "punctuation salad" IMO ;-) 2) On line 988 you have a case inconsistency (cmdLineDir vs. cmdlineDir)
framps commented 2024-01-31 11:11:12 +01:00 (Migrated from github.com)

@zwolfpack I like your awk proposal 👍 and updated the code accordingly.

On line 988 you have a case inconsistency (cmdLineDir vs. cmdlineDir)

Good catch 👍 Fixed right now.

@zwolfpack I like your awk proposal :+1: and [updated the code](https://github.com/framps/rpi-clone/commit/734368ef606fdb8f46f86c81febe7f2f1520b2a0) accordingly. > On line 988 you have a case inconsistency (cmdLineDir vs. cmdlineDir) Good catch :+1: Fixed right now.
ProblemChild4901 commented 2024-01-31 15:40:18 +01:00 (Migrated from github.com)

If you are accepting suggestions, could you update the version line in rpi-clone? And maybe even the attribution comment near the top to indicate your github url?

If you are accepting suggestions, could you update the version line in rpi-clone? And maybe even the attribution comment near the top to indicate your github url?
framps commented 2024-01-31 19:09:38 +01:00 (Migrated from github.com)

@zwolfpack Just to make the awk call more robust: What do you think about

awk '$2 ~ "^\/boot" && $3 == "vfat" { print substr($2, 2); exit}' /etc/fstab
@zwolfpack Just to make the awk call more robust: What do you think about ``` awk '$2 ~ "^\/boot" && $3 == "vfat" { print substr($2, 2); exit}' /etc/fstab ```
framps commented 2024-01-31 19:19:38 +01:00 (Migrated from github.com)

@ProblemChild4901 Done.

@ProblemChild4901 [Done](https://github.com/framps/rpi-clone/commit/b2f731c604df766daf9d45506da294a8a062e3e7).
zwolfpack commented 2024-01-31 19:52:46 +01:00 (Migrated from github.com)

@zwolfpack Just to make the awk call more robust: What do you think about

awk '$2 ~ "^\/boot" && $3 == "vfat" { print substr($2, 2); exit}' /etc/fstab

Good idea to add the exit.

If you want, you could add a check that the line isn't commented out as well
awk '$1 !~ "^#" && $2 ~ "^/boot" && $3 == "vfat" { print substr($2, 2); exit }' /etc/fstab

> @zwolfpack Just to make the awk call more robust: What do you think about > > ``` > awk '$2 ~ "^\/boot" && $3 == "vfat" { print substr($2, 2); exit}' /etc/fstab > ``` Good idea to add the exit. If you want, you could add a check that the line isn't commented out as well `awk '$1 !~ "^#" && $2 ~ "^/boot" && $3 == "vfat" { print substr($2, 2); exit }' /etc/fstab`
framps commented 2024-01-31 21:15:45 +01:00 (Migrated from github.com)

you could add

Added 😉

> you could add [Added](https://github.com/framps/rpi-clone/commit/60c9bbf42ee2dba947f806bbb84d3009751da5aa) :wink:
fmarzocca commented 2024-02-01 13:54:35 +01:00 (Migrated from github.com)

@framps Can we consider stable latest commit? Are you going to merge it in master?

@framps Can we consider stable latest commit? Are you going to merge it in master?
framps commented 2024-02-01 15:15:59 +01:00 (Migrated from github.com)

I just removed the function call and use a variable now. I consider the code stable but will wait until this WE to give some additional time for any other valuable feedback.

I just removed the function call and use a variable now. I consider the code stable but will wait until this WE to give some additional time for any other valuable feedback.
framps commented 2024-02-03 18:23:41 +01:00 (Migrated from github.com)

I just merged the bookworm fix branch into master :-)

I just merged the bookworm fix branch into master :-)
fmarzocca commented 2024-02-03 18:32:59 +01:00 (Migrated from github.com)

Thank you!

Thank you!
fmarzocca commented 2024-02-03 20:21:04 +01:00 (Migrated from github.com)

Maybe you need to update the latest version number in the readme file?

Maybe you need to update the latest version number in the readme file?
framps commented 2024-02-03 20:24:15 +01:00 (Migrated from github.com)

Good catch 👍 Done

Good catch :+1: Done
geerlingguy commented 2024-02-04 03:26:16 +01:00 (Migrated from github.com)

I wish I could redirect my fork to yours — is that possible (outside of just a README change)? Don't want to try maintaining a parallel fork especially since it would be great to increase visibility on your other project.

I wish I could redirect my fork to yours — is that possible (outside of just a README change)? Don't want to try maintaining a parallel fork especially since it would be great to increase visibility on your other project.
fmarzocca commented 2024-02-04 10:13:09 +01:00 (Migrated from github.com)

Good catch 👍 Done

@framps Another one: in readme the installation procedure points to:
$ git clone https://github.com/billw2/rpi-clone.git

You should change the url, otherwise users are always downloading the old one!

> Good catch 👍 Done @framps Another one: in readme the installation procedure points to: `$ git clone https://github.com/billw2/rpi-clone.git` You should change the url, otherwise users are always downloading the old one!
framps commented 2024-02-04 10:42:42 +01:00 (Migrated from github.com)

I wish I could redirect my fork to yours — is that possible (outside of just a README change)?

Sure. But please note: I will neither start working on the issues in this repo nor merge any PRs into my fork. I started to work on my fork just to get rpi-clone to run successfully again on Bookworm. But as far as I can see that's the intention of your fork also: Just to add minor missing features (nvme support) and to keep rpi-clone up and running in current and future RaspbianOS releases.

Don't want to try maintaining a parallel fork

If you want to maintain rpi-clone, work on the PRs and issues just merge my Bookworm fix into your fork and I'll change the all existing links to your fork 😉

Besides that I spent some time and estimated the effort to add clone capability to raspiBackup. It doesn't make sense because raspiBackup is designed to create backups and no clones. You can actually clone a system if you create a backup and then restore the backup to another device. But this makes sense only if you already have a backup. So folks who need clone functionality should use rpi-clone and those who need backup functionality may decide to use raspiBackup.

> I wish I could redirect my fork to yours — is that possible (outside of just a README change)? Sure. But please note: I will neither start working on the issues in this repo nor merge any PRs into my fork. I started to work on my fork just to get rpi-clone to run successfully again on Bookworm. But as far as I can see that's the intention of your fork also: Just to add minor missing features (nvme support) and to keep rpi-clone up and running in current and future RaspbianOS releases. > Don't want to try maintaining a parallel fork If you want to maintain rpi-clone, work on the PRs and issues just merge my Bookworm fix into your fork and I'll change the all existing links to your fork :wink: Besides that I spent some time and estimated the effort to add clone capability to raspiBackup. It doesn't make sense because raspiBackup is designed to create backups and no clones. You can actually clone a system if you create a backup and then restore the backup to another device. But this makes sense only if you already have a backup. So folks who need clone functionality should use rpi-clone and those who need backup functionality may decide to use raspiBackup.
framps commented 2024-02-04 10:50:54 +01:00 (Migrated from github.com)

You should change the url, otherwise users are always downloading the old one!

Good catch. I just updated the link and added an xref to Bills repo.

> You should change the url, otherwise users are always downloading the old one! Good catch. I just updated the link and added an xref to Bills repo.
geerlingguy commented 2024-02-05 20:48:15 +01:00 (Migrated from github.com)

@framps - Thanks; I've pulled your latest commits, and also touched up the top part of the README a little.

If you'd like, I can hold the 'semi-official' fork, I use it enough that I'd at least merge simple PRs to keep things working, and I might optimize the docs a little more too.

@framps - Thanks; I've pulled your latest commits, and also touched up the top part of the README a little. If you'd like, I can hold the 'semi-official' fork, I use it enough that I'd at least merge simple PRs to keep things working, and I might optimize the docs a little more too.
framps commented 2024-02-06 09:42:51 +01:00 (Migrated from github.com)

@geerlingguy Do you want new PRs and issues to be created in your repo or should still everything be created in Bills repo? I think it makes sense to use your repo from now on.

@geerlingguy Do you want new PRs and issues to be created in your repo or should still everything be created in Bills repo? I think it makes sense to use your repo from now on.
geerlingguy commented 2024-02-06 16:17:31 +01:00 (Migrated from github.com)

@framps - Yeah, that might be good to do, I've turned on notifications. And like I've mentioned, the maintenance would be mostly simple things—so if anyone needs attention on something that breaks or the like, please feel free to mention me in a PR!

@framps - Yeah, that might be good to do, I've turned on notifications. And like I've mentioned, the maintenance would be mostly simple things—so if anyone needs attention on something that breaks or the like, please feel free to mention me in a PR!
framps commented 2024-02-10 07:00:30 +01:00 (Migrated from github.com)

It doesn't make sense because raspiBackup is designed to create backups and no clones.

I have just remembered I created a helper script a long time ago called raspiBackupRestore2Image which creates a dd backup image file from the just created backup and stores the backup in the backup directory. You even optionally can reduce the dd backup size with pishrink. It's not a big deal to modify the script to restore the backup on another backup device instead of a dd file.

As of now every helper script of raspiBackup is unsupported - but I know raspiBackupRestore2Image is used a lot of time and works perfectly.

I can imagine a feature request for raspiBackup where the restore capability of a just created backup into a dd file in the backup partition or on a device. Latter will actually be a clone onto another device combined with the creation of a new backup version. That way the primary feature of rpi-clone - clone a system for backup purposes - will be added to raspiBackup.

This feature then will be supported.

Any thoughts on this?

> It doesn't make sense because raspiBackup is designed to create backups and no clones. I have just remembered I created a helper script a long time ago called [raspiBackupRestore2Image](https://github.com/framps/raspiBackup/blob/master/helper/raspiBackupRestore2Image.sh) which creates a dd backup image file from the just created backup and stores the backup in the backup directory. You even optionally can reduce the dd backup size with pishrink. It's not a big deal to modify the script to restore the backup on another backup device instead of a dd file. As of now every helper script of raspiBackup is unsupported - but I know raspiBackupRestore2Image is used a lot of time and works perfectly. I can imagine a feature request for raspiBackup where the restore capability of a just created backup into a dd file in the backup partition or on a device. Latter will actually be a clone onto another device combined with the creation of a new backup version. That way the primary feature of rpi-clone - clone a system for backup purposes - will be added to raspiBackup. This feature then will be supported. Any thoughts on this?
framps commented 2024-03-10 22:55:58 +01:00 (Migrated from github.com)

I spent the last week to create a prototype based on current raspiBackup release which now supports cloning. Details how to install the prototype and how to provide feedback are available here.

I spent the last week to create a prototype based on current raspiBackup release which now supports cloning. Details how to install the prototype and how to provide feedback are available [here](https://github.com/framps/raspiBackup/issues/730).
seamusdemora commented 2024-03-10 23:29:47 +01:00 (Migrated from github.com)

@framps

OK - I'm confused. I was under the impression that this repo (the original rpi-clone) had been (or would be) archived as it was not being maintained. Geerling advertised his fork as a "friendly fork", and I assumed that was accurate.

So, could I ask, "What is the plan?"... will this (original) repo continue on, or are we all supposed to be on board with the geerling repo?

@framps OK - I'm confused. I was under the impression that this repo (the **original** `rpi-clone`) had been (or would be) **archived** as it was not being maintained. Geerling advertised *his fork* as a "friendly fork", and I assumed that was accurate. So, could I ask, "What is the plan?"... will this (original) repo continue on, or are we all supposed to be on board with the geerling repo?
framps commented 2024-03-10 23:44:58 +01:00 (Migrated from github.com)

Jeff fortunately volunteered to take over maintenance of this abandoned repository. Would be great if @billw2 updates this repo and points to Jeffs fork. Not sure whether he still follows his repo.

are we all supposed to be on board with the geerling repo?

If you want to get any updates/fixes on rpi-clone - yes 😉

I was inspired by rpi-clone and added clone support in my prototype of raspiBackup. It's a different backup tool and it's primary purpose is to create backups. I think the clone feature is a very useful additional feature which is missing in raspiBackup and that's why I created the prototype 😉

Jeff fortunately volunteered to take over maintenance of this abandoned repository. Would be great if @billw2 updates this repo and points to Jeffs fork. Not sure whether he still follows his repo. ``` are we all supposed to be on board with the geerling repo? ``` If you want to get any updates/fixes on rpi-clone - yes :wink: I was inspired by rpi-clone and added clone support in my prototype of raspiBackup. It's a different backup tool and it's primary purpose is to create backups. I think the clone feature is a very useful additional feature which is missing in raspiBackup and that's why I created the prototype :wink:
geerlingguy commented 2024-03-11 03:57:55 +01:00 (Migrated from github.com)

Yeah, basically @framps has a great backup tool, with some added cloning functionality. And it has more active development. I'm maintaining a copy of rpi-clone minimally, just to make sure basic cloning functionality continues working on newer Pi OS releases. It is meant only for cloning.

Yeah, basically @framps has a great backup tool, with some added cloning functionality. And it has more active development. I'm maintaining a copy of rpi-clone minimally, just to make sure basic cloning functionality continues working on newer Pi OS releases. It is meant only for cloning.
seamusdemora commented 2024-03-16 00:26:45 +01:00 (Migrated from github.com)

OK - thanks for the input!

BTW, have either of you taken a look at/evaluated the usb-boot tool? Like rpi-clone it's able to copy a "live" image from an RPi to an NVME card - or other media. Just curious if you were aware - or compared - the two.

OK - thanks for the input! BTW, have either of you taken a look at/evaluated the [`usb-boot`](https://forums.raspberrypi.com/viewtopic.php?t=196778) tool? Like `rpi-clone` it's able to copy a "live" image from an RPi to an NVME card - or other media. Just curious if you were aware - or compared - the two.
framps commented 2024-03-17 23:28:59 +01:00 (Migrated from github.com)

Given there is no feedback on the clone feature in raspiBackup I added in a prototype this feature will not make it into next release. It was a nice experience to add this feature but it's unfortunately orthogonal to the design of raspiBackup and therefore the prototype is just a hack and will not make it :-(

Given there is no feedback on the clone feature in raspiBackup I added in a prototype this feature will not make it into next release. It was a nice experience to add this feature but it's unfortunately orthogonal to the design of raspiBackup and therefore the prototype is just a hack and will not make it :-(
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Lerking/rpi-clone#168
No description provided.