Error with NVME on RPi Compute Module 4 #123

Open
opened 2021-07-06 02:14:22 +02:00 by rubberychicken · 11 comments
rubberychicken commented 2021-07-06 02:14:22 +02:00 (Migrated from github.com)

Hi,

I am getting this when trying to close to a NVME SSD:

pi@raspberrypi:~ $ sudo sys-clone nvme0n1 -f2

Target disk nvme0n1 ends with a digit so may be a partition.
sys-clone requires disk names like 'sda' and not partition names like 'sda1'.

Continue anyway? (yes/no): yes

Booted disk: mmcblk0 31.9GB Destination disk: nvme0n1 256.1GB

Part Size FS Label Part Size FS Label
1 /boot 256.0M fat32 -- 1 256.0M fat32 --
2 root 29.5G ext4 rootfs 2 238.2G -- --

== Initialize: IMAGE partition table - forced by option ==
1 /boot (48.0M used) : MKFS SYNC to nvme0n11
2 root (1.8G used) : RESIZE MKFS SYNC to nvme0n12

-f2 : force initialize to first two partitions only.
Run setup script : no.

Verbose mode : no.
** WARNING ** : All destination disk nvme0n1 data will be overwritten!
-----------------------:

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

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

Syncing file systems (can take a long time)
Syncing mounted partitions:
Mounting /dev/nvme0n12 on /mnt/clone
mount: /mnt/clone: special device /dev/nvme0n12 does not exist.
Mount failure of /dev/nvme0n12 on /mnt/clone.
Aborting!

Hi, I am getting this when trying to close to a NVME SSD: pi@raspberrypi:~ $ sudo sys-clone nvme0n1 -f2 Target disk nvme0n1 ends with a digit so may be a partition. sys-clone requires disk names like 'sda' and not partition names like 'sda1'. Continue anyway? (yes/no): yes Booted disk: mmcblk0 31.9GB Destination disk: nvme0n1 256.1GB --------------------------------------------------------------------------- Part Size FS Label Part Size FS Label 1 /boot 256.0M fat32 -- 1 256.0M fat32 -- 2 root 29.5G ext4 rootfs 2 238.2G -- -- --------------------------------------------------------------------------- == Initialize: IMAGE partition table - forced by option == 1 /boot (48.0M used) : MKFS SYNC to nvme0n11 2 root (1.8G used) : RESIZE MKFS SYNC to nvme0n12 --------------------------------------------------------------------------- -f2 : force initialize to first two partitions only. Run setup script : no. Verbose mode : no. -----------------------: ** WARNING ** : All destination disk nvme0n1 data will be overwritten! -----------------------: Initialize and clone to the destination disk nvme0n1? (yes/no): yes Optional destination ext type file system label (16 chars max): gateway Initializing Imaging past partition 1 start. => dd if=/dev/mmcblk0 of=/dev/nvme0n1 bs=1M count=8 ... Resizing destination disk last partition ... Resize success. Changing destination Disk ID ... => mkfs -t vfat -F 32 /dev/nvme0n11 ... => mkfs -t ext4 -L gateway /dev/nvme0n12 ... Syncing file systems (can take a long time) Syncing mounted partitions: Mounting /dev/nvme0n12 on /mnt/clone mount: /mnt/clone: special device /dev/nvme0n12 does not exist. Mount failure of /dev/nvme0n12 on /mnt/clone. Aborting!
mike-pisman commented 2021-08-16 02:51:06 +02:00 (Migrated from github.com)

Hi, I have the same issue. Have you found the solution?

Hardware: RPI CM4 (no wifi/ no mmc) + RPI IO Board, Samsung EVO 980, pci-m.2 adapter that is tested. I already managed to install and boot Raspbian 32 bit from NVMe; However, I am struggling to install Ubuntu Sever 64 bit in a similar fashion. I have tried "SD Copier" and "dd" but I could not boot, now I want to see if rpi-clone can do any different, but run into this issue...

ubuntu@ubuntu:~$ sudo rpi-clone nvme0n1

  Target disk nvme0n1 ends with a digit so may be a partition.
  rpi-clone requires disk names like 'sda' and not partition names like 'sda1'.

Continue anyway?  (yes/no): yes

Booted disk: mmcblk0 8.1GB                 Destination disk: nvme0n1 500.1GB
---------------------------------------------------------------------------
Part               Size    FS     Label           Part   Size  FS  Label
1 /boot/firmware   256.0M  fat32  --
2 root               7.3G  ext4   writable
---------------------------------------------------------------------------
== Initialize: IMAGE partition table - partition number mismatch: 2 -> 0 ==
1 /boot/firmware      (126.0M used)  : MKFS  SYNC to nvme0n11
2 root                (3.3G used)    : RESIZE  MKFS  SYNC to nvme0n12
---------------------------------------------------------------------------
Run setup script       : no.
Verbose mode           : no.
-----------------------:
** WARNING **          : All destination disk nvme0n1 data will be overwritten!
-----------------------:

Initialize and clone to the destination disk nvme0n1?  (yes/no): yes
Optional destination ext type file system label (16 chars max): NVME-EXT

Initializing
  Imaging past partition 1 start.
  => dd if=/dev/mmcblk0 of=/dev/nvme0n1 bs=1M count=5 ...
  Resizing destination disk last partition ...
    Resize success.
  Changing destination Disk ID ...
  => mkfs -t vfat -F 32  /dev/nvme0n11 ...
  => mkfs -t ext4 -L NVME-EXT /dev/nvme0n12 ...

Syncing file systems (can take a long time)
Syncing mounted partitions:
  Mounting /dev/nvme0n12 on /mnt/clone
mount: /mnt/clone: special device /dev/nvme0n12 does not exist.
    Mount failure of /dev/nvme0n12 on /mnt/clone.
Aborting!
Hi, I have the same issue. Have you found the solution? Hardware: RPI CM4 (no wifi/ no mmc) + RPI IO Board, Samsung EVO 980, pci-m.2 adapter that is tested. I already managed to install and boot Raspbian 32 bit from NVMe; However, I am struggling to install Ubuntu Sever 64 bit in a similar fashion. I have tried "SD Copier" and "dd" but I could not boot, now I want to see if rpi-clone can do any different, but run into this issue... ``` ubuntu@ubuntu:~$ sudo rpi-clone nvme0n1 Target disk nvme0n1 ends with a digit so may be a partition. rpi-clone requires disk names like 'sda' and not partition names like 'sda1'. Continue anyway? (yes/no): yes Booted disk: mmcblk0 8.1GB Destination disk: nvme0n1 500.1GB --------------------------------------------------------------------------- Part Size FS Label Part Size FS Label 1 /boot/firmware 256.0M fat32 -- 2 root 7.3G ext4 writable --------------------------------------------------------------------------- == Initialize: IMAGE partition table - partition number mismatch: 2 -> 0 == 1 /boot/firmware (126.0M used) : MKFS SYNC to nvme0n11 2 root (3.3G used) : RESIZE MKFS SYNC to nvme0n12 --------------------------------------------------------------------------- Run setup script : no. Verbose mode : no. -----------------------: ** WARNING ** : All destination disk nvme0n1 data will be overwritten! -----------------------: Initialize and clone to the destination disk nvme0n1? (yes/no): yes Optional destination ext type file system label (16 chars max): NVME-EXT Initializing Imaging past partition 1 start. => dd if=/dev/mmcblk0 of=/dev/nvme0n1 bs=1M count=5 ... Resizing destination disk last partition ... Resize success. Changing destination Disk ID ... => mkfs -t vfat -F 32 /dev/nvme0n11 ... => mkfs -t ext4 -L NVME-EXT /dev/nvme0n12 ... Syncing file systems (can take a long time) Syncing mounted partitions: Mounting /dev/nvme0n12 on /mnt/clone mount: /mnt/clone: special device /dev/nvme0n12 does not exist. Mount failure of /dev/nvme0n12 on /mnt/clone. Aborting!
psistwu commented 2021-08-27 09:12:32 +02:00 (Migrated from github.com)

I think I have a solution to this issue. Here I highlight some lines of the return message of rpi-clone:

....

Syncing file systems (can take a long time)
Syncing mounted partitions:
  Mounting /dev/nvme0n12 on /mnt/clone
mount: /mnt/clone: special device /dev/nvme0n12 does not exist.
    Mount failure of /dev/nvme0n12 on /mnt/clone.
Abouting!

The message above indicates that rpi-clone does not generate correct partition names for NVMe drive, which should be /dev/nvme0n1p1 and /dev/nvme0n1p2. In such a case, one can try the following modification in rpi-clone:

# begin at line 1060
if [[ ${chk_disk: -1} =~ ^[0-9]$ ]]
then
	if [[ $dst_disk == *"mmcblk"* || $dst_disk == *"nvme"* ]]    # update this line
	then
		SD_slot_dst=1
                ....

Unfortunately, I do not have an NVMe drive by my hand so that I cannot really test it. Can somebody verify if the solution works?

Beware that even the solution above works, it is not a rigorous one. If anyone can improve the solution, it will be much appreciated.

I think I have a solution to this issue. Here I highlight some lines of the return message of `rpi-clone`: ``` .... Syncing file systems (can take a long time) Syncing mounted partitions: Mounting /dev/nvme0n12 on /mnt/clone mount: /mnt/clone: special device /dev/nvme0n12 does not exist. Mount failure of /dev/nvme0n12 on /mnt/clone. Abouting! ``` The message above indicates that `rpi-clone` does not generate correct partition names for NVMe drive, which should be `/dev/nvme0n1p1` and `/dev/nvme0n1p2`. In such a case, one can try the following modification in `rpi-clone`: ```bash # begin at line 1060 if [[ ${chk_disk: -1} =~ ^[0-9]$ ]] then if [[ $dst_disk == *"mmcblk"* || $dst_disk == *"nvme"* ]] # update this line then SD_slot_dst=1 .... ``` Unfortunately, I do not have an NVMe drive by my hand so that I cannot really test it. Can somebody verify if the solution works? Beware that even the solution above works, it is not a rigorous one. If anyone can improve the solution, it will be much appreciated.
psistwu commented 2021-09-04 19:10:18 +02:00 (Migrated from github.com)

[Update]
Finally, I had my solution tested with the following configuration:

  • Hardware: Waveshare Mini Base Board (A) + rpi compute module 4 lite (2Gb ram w/o wifi) + WD SN530 256GB
  • System: Manjaro-ARM-minimal-rpi4-21.08

With the correction, everything works quite well. I can now boot my rpi with NVMe drive.

[Update] Finally, I had my solution tested with the following configuration: * Hardware: Waveshare Mini Base Board (A) + rpi compute module 4 lite (2Gb ram w/o wifi) + WD SN530 256GB * System: Manjaro-ARM-minimal-rpi4-21.08 With the correction, everything works quite well. I can now boot my rpi with NVMe drive.
NajibNour commented 2021-11-05 18:28:22 +01:00 (Migrated from github.com)

Hey hey! Im facing a similar issue. Im coping over from source "nvme0n1" to a "sda". The error I receive is "Error: Could not stat device /dev/nvme0n1p - No such file or directory." Seems like its messing up the partition names and moving "p1" to "1p". Could this be the same fix but for the source drive?

lsblk output:

sda           8:0    0 465.8G  0 disk 
└─sda1        8:1    0 465.8G  0 part 
nvme0n1     259:0    0 465.8G  0 disk 
├─nvme0n1p1 259:1    0   512M  0 part /boot/efi
└─nvme0n1p2 259:2    0 465.3G  0 part /
Hey hey! Im facing a similar issue. Im coping over from source "nvme0n1" to a "sda". The error I receive is "Error: Could not stat device /dev/nvme0n1p - No such file or directory." Seems like its messing up the partition names and moving "p1" to "1p". Could this be the same fix but for the source drive? lsblk output: ``` sda 8:0 0 465.8G 0 disk └─sda1 8:1 0 465.8G 0 part nvme0n1 259:0 0 465.8G 0 disk ├─nvme0n1p1 259:1 0 512M 0 part /boot/efi └─nvme0n1p2 259:2 0 465.3G 0 part / ```
psistwu commented 2021-11-12 16:27:28 +01:00 (Migrated from github.com)

I guess you can try to modify line 571--584 of rpi-clone using similar approach.

I guess you can try to modify line 571--584 of `rpi-clone` using similar approach.
NajibNour commented 2021-11-12 17:31:34 +01:00 (Migrated from github.com)

Yes this is exactly what i ended up doing! Had some issues with UUID's as this is on a ubuntu server but ended up resolving that with the following:
Then you have to edit "/etc/fstab" on the right volume with gedit, nano or else.

In a terminal, type:

sudo vim /mnt/clone/etc/fstab
and replace the old UUIDs by the new ones.

WARNING : Modifying "/boot/grub/grub.cfg" is very tricky. It should normally be generated with the command sudo update-grub.

Replace the old UUIDs by the new ones in "/boot/grub/grub.cfg" by entering the following in a terminal :

sudo vim /mnt/clone/boot/grub/grub.cfg

:%s/OLDUUID/NEWUUID/gc

If you use the tricky solution, I recommend you to launch sudo update-grub once you have successfully booted the system.

Yes this is exactly what i ended up doing! Had some issues with UUID's as this is on a ubuntu server but ended up resolving that with the following: Then you have to edit "/etc/fstab" on the right volume with gedit, nano or else. In a terminal, type: `sudo vim /mnt/clone/etc/fstab` and replace the old UUIDs by the new ones. WARNING : Modifying "/boot/grub/grub.cfg" is very tricky. It should normally be generated with the command `sudo update-grub`. Replace the old UUIDs by the new ones in "/boot/grub/grub.cfg" by entering the following in a terminal : `sudo vim /mnt/clone/boot/grub/grub.cfg` `:%s/OLDUUID/NEWUUID/gc` If you use the tricky solution, I recommend you to launch `sudo update-grub` once you have successfully booted the system.
mgrouch commented 2021-12-21 05:22:32 +01:00 (Migrated from github.com)

@psistwu

[Update] Finally, I had my solution tested with the following configuration:

* Hardware: Waveshare Mini Base Board (A) + rpi compute module 4 lite (2Gb ram w/o wifi) + WD SN530 256GB

* System: Manjaro-ARM-minimal-rpi4-21.08

With the correction, everything works quite well. I can now boot my rpi with NVMe drive.

I did the same with raspberry pi buster. It copied file systems fine. But it doesn't boot from NVMe.
All up to date raspberry pi OS (armhf buster) and firmware.

Thanks

@psistwu > [Update] Finally, I had my solution tested with the following configuration: > > * Hardware: Waveshare Mini Base Board (A) + rpi compute module 4 lite (2Gb ram w/o wifi) + WD SN530 256GB > > * System: Manjaro-ARM-minimal-rpi4-21.08 > > > With the correction, everything works quite well. I can now boot my rpi with NVMe drive. I did the same with raspberry pi buster. It copied file systems fine. But it doesn't boot from NVMe. All up to date raspberry pi OS (armhf buster) and firmware. Thanks
psistwu commented 2022-01-01 16:07:14 +01:00 (Migrated from github.com)

@mgrouch
What is your hardware configuration?

Also, did you change the boot order with usbboot? You may refer to the following YouTube video for the detail.
https://youtu.be/4Womn10v71s

@mgrouch What is your hardware configuration? Also, did you change the boot order with [`usbboot`](https://github.com/raspberrypi/usbboot)? You may refer to the following YouTube video for the detail. https://youtu.be/4Womn10v71s
mgrouch commented 2022-01-01 16:25:44 +01:00 (Migrated from github.com)

@psistwu
CM4 with McuZone board.

@psistwu CM4 with McuZone board.
chaisaeng commented 2022-09-14 16:30:30 +02:00 (Migrated from github.com)

I think I have a solution to this issue. Here I highlight some lines of the return message of rpi-clone:

....

Syncing file systems (can take a long time)
Syncing mounted partitions:
  Mounting /dev/nvme0n12 on /mnt/clone
mount: /mnt/clone: special device /dev/nvme0n12 does not exist.
    Mount failure of /dev/nvme0n12 on /mnt/clone.
Abouting!

The message above indicates that rpi-clone does not generate correct partition names for NVMe drive, which should be /dev/nvme0n1p1 and /dev/nvme0n1p2. In such a case, one can try the following modification in rpi-clone:

# begin at line 1060
if [[ ${chk_disk: -1} =~ ^[0-9]$ ]]
then
	if [[ $dst_disk == *"mmcblk"* || $dst_disk == *"nvme"* ]]    # update this line
	then
		SD_slot_dst=1
                ....

Unfortunately, I do not have an NVMe drive by my hand so that I cannot really test it. Can somebody verify if the solution works?

Beware that even the solution above works, it is not a rigorous one. If anyone can improve the solution, it will be much appreciated.

Your Solution is absolutely correct.

> I think I have a solution to this issue. Here I highlight some lines of the return message of `rpi-clone`: > > ``` > .... > > Syncing file systems (can take a long time) > Syncing mounted partitions: > Mounting /dev/nvme0n12 on /mnt/clone > mount: /mnt/clone: special device /dev/nvme0n12 does not exist. > Mount failure of /dev/nvme0n12 on /mnt/clone. > Abouting! > ``` > > The message above indicates that `rpi-clone` does not generate correct partition names for NVMe drive, which should be `/dev/nvme0n1p1` and `/dev/nvme0n1p2`. In such a case, one can try the following modification in `rpi-clone`: > > ```shell > # begin at line 1060 > if [[ ${chk_disk: -1} =~ ^[0-9]$ ]] > then > if [[ $dst_disk == *"mmcblk"* || $dst_disk == *"nvme"* ]] # update this line > then > SD_slot_dst=1 > .... > ``` > > Unfortunately, I do not have an NVMe drive by my hand so that I cannot really test it. Can somebody verify if the solution works? > > Beware that even the solution above works, it is not a rigorous one. If anyone can improve the solution, it will be much appreciated. Your Solution is absolutely correct.
geerlingguy commented 2022-09-22 00:41:27 +02:00 (Migrated from github.com)

Opened a PR with the two changes discussed above: https://github.com/billw2/rpi-clone/pull/147

Opened a PR with the two changes discussed above: https://github.com/billw2/rpi-clone/pull/147
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Lerking/rpi-clone#123