dthporro
Posts: 1
Joined: Sun Jul 25, 2021 11:40 am

won't boot after clone

Sun Jul 25, 2021 11:46 am

hi, i've made a lot of research and can't find solution to this problem.

i need to switch from ocz vertex 2 ssd (50g) to emtec x150 (240g) ssd, got both discs connected (usb) to my windows laptop, downloaded acronis partition asistant and cloned discs.

when i plug emtec disc to rpi, it won't boot, just stops booting at some point detecting usb devices... don't know whats wrong, if i plug old disc again it boots perfects. what am i missing? any ideas?

thank u!

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 6396
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: won't boot after clone

Sun Jul 25, 2021 3:22 pm

dthporro wrote:
Sun Jul 25, 2021 11:46 am
hi, i've made a lot of research and can't find solution to this problem.

i need to switch from ocz vertex 2 ssd (50g) to emtec x150 (240g) ssd, got both discs connected (usb) to my windows laptop, downloaded acronis partition asistant and cloned discs.

when i plug emtec disc to rpi, it won't boot, just stops booting at some point detecting usb devices... don't know whats wrong, if i plug old disc again it boots perfects. what am i missing? any ideas?

thank u!
Are you running Raspberry PIOS or another O.S. on the Pi (which model?) ? If Raspberry PIOS could said Pi run with both SSD's connected (via USB-to-SATA interfaces?). Finally, if the SSD's + interfaces both work on the Pi at the same time why not try Raspberry PIOS's built "SD Card Copier" The (booted) O.S. to be copied does not have to reside on an SD card as the copier requests both the "From" and "To" device ids.
FWIW, some cloning examples below:
http://www.cpmspectrepi.uk/raspberry_pi ... OnP4B.html
http://www.cpmspectrepi.uk/raspberry_pi ... _SDXC_Card
posting.php?mode=quote&f=28&p=1893042
Trev.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B, B+, and a A+) but Buster on the P3B+, P4B's & P400. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

RonR
Posts: 2388
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: won't boot after clone

Sun Jul 25, 2021 8:16 pm

dthporro wrote:
Sun Jul 25, 2021 11:46 am
i need to switch from ocz vertex 2 ssd (50g) to emtec x150 (240g) ssd

If you are running Raspberry Pi OS, usb-boot will copy your ocz vertex 2 ssd to your emtec x150 ssd.

lastat77
Posts: 14
Joined: Wed Jan 22, 2020 10:23 pm

Re: won't boot after clone

Sat Jul 31, 2021 9:36 pm

Have a similar issue. Possibly the same really.

I have two USB drives. They are identical.One is empty, the other is used to boot the RPI4.

I used dd to make a back up of the bootable USB.

I then used dd to copy the image to the other USB drive.

Old drive still boots.

New clone will not boot.

Tried multiple times.

With SD cards as source and destination, it works.

With USB, no boot on destination.

Ideas?

RonR
Posts: 2388
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: won't boot after clone

Sat Jul 31, 2021 9:41 pm

lastat77 wrote:
Sat Jul 31, 2021 9:36 pm
I used dd to make a back up of the bootable USB.

I then used dd to copy the image to the other USB drive.

Old drive still boots.

New clone will not boot.

Did you try using usb-boot instead of dd to copy the working USB device (when your running from it) to the new one?

lastat77
Posts: 14
Joined: Wed Jan 22, 2020 10:23 pm

Re: won't boot after clone

Mon Aug 02, 2021 2:58 am

The pi4 is already booting from USB natively I just want to clone the USB that already boots.

Is there no reliable way to make a literal clone of a bootable USB?

Isn't your script just using dd anyway? IF there are post processing steps being taken in that scrip, what are they and can I not simply do those too?

Although I do want to clone to usb, I first want to store the backup on another device. So going USB to USB is less than ideal I that the USB clone isn't a great way to stop backups.
Last edited by lastat77 on Mon Aug 02, 2021 3:11 am, edited 1 time in total.

RonR
Posts: 2388
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: won't boot after clone

Mon Aug 02, 2021 3:06 am

lastat77 wrote:
Mon Aug 02, 2021 2:58 am
The pi4 is already booting from USB natively I just want to clone the USB that already boots, not change the way my system works. In other words, why would my backup need to operate differently than its original? Kind of defeats the purpose of a "clone".

As long as the USB drive you're trying to copy with dd is not the running system and is not mounted anywhere, dd should copy it.

If the source of your copy with dd is the running system, you're asking for trouble.

lastat77
Posts: 14
Joined: Wed Jan 22, 2020 10:23 pm

Re: won't boot after clone

Mon Aug 02, 2021 3:14 am

I should have mentioned - I first shutdown the PI. Then put that USB drive (source) into my Mac. I then unmount boot, then use dd to create the image.

I then have used dd to place that image back onto a separate USB, identical brand/size etc. This results in a USB that is not booting.

RonR
Posts: 2388
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: won't boot after clone

Mon Aug 02, 2021 3:20 am

lastat77 wrote:
Mon Aug 02, 2021 3:14 am
I should have mentioned - I first shutdown the PI. Then put that USB drive (source) into my Mac. I then unmount boot, then use dd to create the image.

I then have used dd to place that image back onto a separate USB, identical brand/size etc. This results in a USB that is not booting.

Are you transferring the whole drive (/dev/sdX) as opposed to just a partition (/dev/sdX2)?

lastat77
Posts: 14
Joined: Wed Jan 22, 2020 10:23 pm

Re: won't boot after clone

Mon Aug 02, 2021 3:27 am

Whole drive.

Code: Select all

sudo dd bs=4m if=/dev/disk2 of=/BkUpIMG/pi4.2021.08.01.img
Maybe the USB destination is incorrectly initialized.

MBR vs GUID ?

I also erase it with a fat32 partition. Unmount and dd.
Last edited by lastat77 on Mon Aug 02, 2021 3:33 am, edited 1 time in total.

RonR
Posts: 2388
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: won't boot after clone

Mon Aug 02, 2021 3:31 am

lastat77 wrote:
Mon Aug 02, 2021 3:27 am
Whole drive.

Code: Select all

sudo dd bs=4m if=/dev/disk2 of=/BkUpIMG/pi4.2021.08.01.img

I'm not familiar with a Mac. Are you sure /dev/disk2 includes both partitions (BOOT and ROOT)?

lastat77
Posts: 14
Joined: Wed Jan 22, 2020 10:23 pm

Re: won't boot after clone

Mon Aug 02, 2021 3:35 am

Yes, disk2 contains disk2s1and disk2s2 where the s1 and s2 are the boot and linux partitions.

I am just thinking now that USB might need to be MBR not GUID (or the other way around)

RonR
Posts: 2388
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: won't boot after clone

Mon Aug 02, 2021 3:36 am

lastat77 wrote:
Mon Aug 02, 2021 3:27 am
Maybe the USB destination is incorrectly initialized.

MBR vs GUID ?

I also erase it with a fat32 partition. Unmount and dd.

When you copy with dd, there is no MBR vs GUID. dd does a sector-by-sector copy and has no idea what's in each sector (and doesn't care).

lastat77
Posts: 14
Joined: Wed Jan 22, 2020 10:23 pm

Re: won't boot after clone

Mon Aug 02, 2021 3:38 am

Yes, dd doesn't care/know, but those do matter to the ... I guess hardware maybe - as to whether the device itself is bootable - yes?

OR did you mean dd will replace the destination with source including whatever is used in source (MBR/GUID)?

RonR
Posts: 2388
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: won't boot after clone

Mon Aug 02, 2021 3:45 am

lastat77 wrote:
Mon Aug 02, 2021 3:38 am
Yes, dd doesn't care/know, but those do matter to the ... I guess hardware maybe - as to whether the device itself is bootable - yes?

Raspberry Pi OS doesn't boot like most Linux. The first (BOOT) partition is FAT32 and the Raspberry Pi loader reads files from there.

dd should create a mirror image of the source disk in the destination image file. If this image file is then written to another drive with dd or an imaging program such as Etcher, the result should be a mirror image of the original Nothing should be altered.

lastat77
Posts: 14
Joined: Wed Jan 22, 2020 10:23 pm

Re: won't boot after clone

Mon Aug 02, 2021 3:50 am

I agree with everything you are saying.

I just can't get a bootable clone of my USB.

It seems really straight forward but just isn't working.

I haven't tried writing the img back to USB with Etcher, but I did try with Raspberry Pi Imager. Same bad result.

RonR
Posts: 2388
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: won't boot after clone

Mon Aug 02, 2021 3:55 am

Mount both the original drive and the new drive and compare the files in the BOOT partition (partition 1 : FAT32) and the ROOT partition (partition 2 : EXT4). They should be identical.

lastat77
Posts: 14
Joined: Wed Jan 22, 2020 10:23 pm

Re: won't boot after clone

Mon Aug 02, 2021 4:03 am

Started making a new image - 64 GB - so it will take about an hour - then I will look at doing a compare.

User avatar
rpdom
Posts: 19052
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: won't boot after clone

Mon Aug 02, 2021 5:45 am

I don't know much about Macs, not used one for a while, but it might be worth trying /dev/rdisk2 instead of /dev/disk2. You might see a speed-up of your copy.
Unreadable squiggle

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 6396
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: won't boot after clone

Mon Aug 02, 2021 7:29 am

lastat77 wrote:
Sat Jul 31, 2021 9:36 pm
Have a similar issue. Possibly the same really.
I have two USB drives. They are identical.One is empty, the other is used to boot the RPI4.
I used dd to make a back up of the bootable USB.
I then used dd to copy the image to the other USB drive.
Old drive still boots.
New clone will not boot.
Tried multiple times.
With SD cards as source and destination, it works.
With USB, no boot on destination.
Ideas?
What you don't state above is what, presumably USB-to-SATA, chipset is used in those drives - although they may look identical, unless purchased at the same time, they could be different and if the "new clone" drive has a JMicron chipset there are known issues with those (including slow or not booting).
Trev.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B, B+, and a A+) but Buster on the P3B+, P4B's & P400. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

lastat77
Posts: 14
Joined: Wed Jan 22, 2020 10:23 pm

Re: won't boot after clone

Mon Aug 02, 2021 9:53 pm

I figured it out this afternoon.

Some portion of the processes creates a hidden directory inside /boot and that directory survives the dd/ertcher/etc. copy of the .img file on to the destination USB. Actually, it probably doesn't survive it, it probably gets written at the same time.

This hidden directory /boot/.fseventsd is not present on the .img. I think the Mac is writing this when it auto mounts the /boot directory.

The reason I think the above new directory is a problem is, I rm -R it and then the USB boots fine.

Interestingly, the .img file does not have the file, but the old USB had it created just now when I mounted it on my Mac. And yet, that USB boots without a need for rm -R the directory.

In fact, once the USB boots once, the hidden directory causes no problems. My Mac added it to both when I attached them as a test.

So maybe that hidden directory just cannot be preset for a first boot(?).

User avatar
HawaiianPi
Posts: 6440
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: won't boot after clone

Mon Aug 02, 2021 10:24 pm

lastat77 wrote:
Mon Aug 02, 2021 2:58 am
Is there no reliable way to make a literal clone of a bootable USB?
Desktop versions of Raspberry Pi OS include the SD Card Copier utility which can clone the running OS to a card or USB drive. It only copies the OS and not the the empty space, so it's much faster, and it can handle different sized drives (for example, I can clone my 256GB boot SSD to a smaller SD card, as long as the used space on the SSD doesn't exceed the capacity of the card).

It also includes an option to generate new PARTUUIDs on the clone (which I recommend using).
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

RonR
Posts: 2388
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: won't boot after clone

Mon Aug 02, 2021 10:37 pm

lastat77 wrote:
Mon Aug 02, 2021 9:53 pm
So maybe that hidden directory just cannot be preset for a first boot(?).

I just created a '.fseventsd' directory in the boot partition of a USB drive with a fresh (never before booted) Raspberry Pi OS image on it and it booted just fine.

Extra files/folders in the boot partition should not cause boot failures.

lastat77
Posts: 14
Joined: Wed Jan 22, 2020 10:23 pm

Re: won't boot after clone

Mon Aug 02, 2021 11:08 pm

All this said... I just made another clone with the same USB drive... same image and... it works like a charm. No delete etc of the hidden/extra directory.

So really, I had some problem.. I have not figured it out what.

Perhaps dd is having an issue? Because I did switch to Etcher and all seems good now.

I did waste a lot of time though. But I super appreciate the community here making suggestions etc.

cleverca22
Posts: 4397
Joined: Sat Aug 18, 2012 2:33 pm

Re: won't boot after clone

Tue Aug 03, 2021 12:27 am

lastat77 wrote:
Mon Aug 02, 2021 11:08 pm
All this said... I just made another clone with the same USB drive... same image and... it works like a charm. No delete etc of the hidden/extra directory.

So really, I had some problem.. I have not figured it out what.

Perhaps dd is having an issue? Because I did switch to Etcher and all seems good now.

I did waste a lot of time though. But I super appreciate the community here making suggestions etc.
what is macos is mounting the /boot and modifying it, as dd writes the image, and that then corrupts the drive?

Return to “Troubleshooting”