kjt
Posts: 3
Joined: Sun Feb 10, 2013 3:30 pm

Problems with rpi-clone

Sun Feb 10, 2013 3:51 pm

As reported in http://www.raspberrypi.org/phpBB3/viewt ... 66&t=17622, rpi-clone works for some people but not for others.

I'm trying to use it to clone an existing 16Gb SD card to a new 16Gb one. I get the errors marked *** below. (I changed the calls of "fdisk" and "mkfs.ext4" to show full output.)

Any idea what's wrong here? Thanks!

----------------------------------------------------------------------------

[Things start OK]

rpi-clone sda

The existing partitions on destination disk 'sda' are:
Disk /dev/sda: 16071MB
Partition Table: msdos

Number Start End Size Type File system Flags
1 4.19MB 62.9MB 58.7MB primary fat32 lba
2 62.9MB 15932MB 15869MB primary

... Cannot find a destination boot file system of type: fat16

... Cannot find a destination root file system of type: ext4

This script can initialize the destination disk with a partition
structure copied from the currently booted filesytem and then resize
partition 2 (the root filesystem) to use all space on the SD card.
Do you want to initialize the destination /dev/sda? (yes/no): yes

Imaging the partition structure, copying 70 megabytes...
70+0 records in
70+0 records out
73400320 bytes (73 MB) copied, 2.58946 s, 28.3 MB/s

----------------------------------------------------------------------------

[At this point the script calls "fdisk" to expand the root file system, but this gives a warning and an error]

Sizing partition 2 (root partition) to use all SD card space...

Command (m for help):
Disk /dev/sda: 16.1 GB, 16071000064 bytes
64 heads, 32 sectors/track, 15326 cylinders, total 31388672 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00016187

Device Boot Start End Blocks Id System
/dev/sda1 8192 122879 57344 c W95 FAT32 (LBA)
/dev/sda2 122880 31116287 15496704 83 Linux

Command (m for help): Partition number (1-4):
Command (m for help): Partition type:
p primary (1 primary, 0 extended, 3 free)
e extended
Select (default p): Partition number (1-4, default 2): First sector (2048-31388671, default 2048): Last sector, +sectors or +size{K,M,G} (122880-31388671, default 31388671): Using default value 31388671

Command (m for help):
Disk /dev/sda: 16.1 GB, 16071000064 bytes
64 heads, 32 sectors/track, 15326 cylinders, total 31388672 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00016187

Device Boot Start End Blocks Id System
/dev/sda1 8192 122879 57344 c W95 FAT32 (LBA)
/dev/sda2 122880 31388671 15632896 83 Linux

Command (m for help): The partition table has been altered!

Calling ioctl() to re-read partition table.

*** WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)

*** Error closing file

----------------------------------------------------------------------------

[At this point the script calls "mkfs.ext4" to creat an ext4 file system, but this fails to create superblocks]

mke2fs 1.42.5 (29-Jul-2012)

*** Warning, had trouble writing out superblocks.
/dev/sda is initialized and resized. Its partitions are:
Disk /dev/sda: 16071MB
Partition Table: msdos

Number Start End Size Type File system Flags
1 4.19MB 62.9MB 58.7MB primary fat32 lba
2 62.9MB 15932MB 15869MB primary


Your booted /dev/mmcblk0p2 rootfs existing label:

----------------------------------------------------------------------------

[At this point, trying to define a label fails]

You may enter a label for the destination rootfs /dev/sda2: RPI

You may enter a label for the destination rootfs /dev/sda2: RPI
*** e2label: Bad magic number in super-block while trying to open /dev/sda2
*** Couldn't find valid filesystem superblock.
*** e2label: Bad magic number in super-block while trying to open /dev/sda2
*** Couldn't find valid filesystem superblock.

----------------------------------------------------------------------------

kjt
Posts: 3
Joined: Sun Feb 10, 2013 3:30 pm

Re: Problems with rpi-clone

Thu Feb 14, 2013 11:51 am

"billw" kindly spent a lot of time working with me on this problem. There is nothing wrong with the "rpi-clone" script. Contributing factors seem to be:

(1) The external SD card may be automatically mounted or "claimed" by File Manager. It is necessary to make sure the card is unmounted before running "rpi-clone".

(2) In some versions of the OS it seems that high-speed USB support can be unreliable. This results in frequent USB timeouts or I/O errors when trying to run "rpi-clone". Disabling USB 2 support might help.

Eradicatore
Posts: 23
Joined: Sun Jul 29, 2012 1:21 am

Re: Problems with rpi-clone

Fri Jan 10, 2014 9:23 pm

kjt wrote:"billw" kindly spent a lot of time working with me on this problem. There is nothing wrong with the "rpi-clone" script. Contributing factors seem to be:

(1) The external SD card may be automatically mounted or "claimed" by File Manager. It is necessary to make sure the card is unmounted before running "rpi-clone".

(2) In some versions of the OS it seems that high-speed USB support can be unreliable. This results in frequent USB timeouts or I/O errors when trying to run "rpi-clone". Disabling USB 2 support might help.
Thanks for sharing your experiences on this! I will make sure to look out for that. So far the script has worked perfectly for me twice.

dpitchfo
Posts: 7
Joined: Sun Sep 21, 2014 7:21 pm

Re: Problems with rpi-clone

Wed Mar 30, 2016 2:25 pm

Hi,

I having the issue that the rpi-clone appears to make a backup but the back up SD card does not work. The rpi-finish successfully but when I book off the back up card the system dies. Here is snap shot from the screen. Sorry, I couldn't paste the entire screen since my email is on a different system.

From the PI Boot UP:
...
[2.092281] VFS: Cannot open root device "mmcblk0p7" or unknown-block(179,7): error-6
[2.107150] Please append a correct "root=" boot option; here are available partitions:
...
[ 2.334335] Kernal panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,7)
...
Stops working...

Anyone have any ideal what I need to do to fix the issue. I am using 32GB SD card and backing up to a 32GD SD card.

billw
Posts: 413
Joined: Tue Sep 18, 2012 8:23 pm

Re: Problems with rpi-clone

Thu Mar 31, 2016 2:06 am

dpitchfo wrote:Hi,

I having the issue that the rpi-clone appears to make a backup but the back up SD card does not work. The rpi-finish successfully but when I book off the back up card the system dies. Here is snap shot from the screen. Sorry, I couldn't paste the entire screen since my email is on a different system.

From the PI Boot UP:
...
[2.092281] VFS: Cannot open root device "mmcblk0p7" or unknown-block(179,7): error-6
[2.107150] Please append a correct "root=" boot option; here are available partitions:
...
[ 2.334335] Kernal panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,7)
...
Stops working...

Anyone have any ideal what I need to do to fix the issue. I am using 32GB SD card and backing up to a 32GD SD card.
Since you have a mmcblk0p7, maybe you are running NOOBS? If so, rpi-clone does not work
with NOOBS and can only handle distributions that have just a 2 partition setup (Raspian and others).

Return to “General discussion”