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.
----------------------------------------------------------------------------