Hi Robert, I am not having much luck with this … I get the BLKRRPART: Device or resource busy error and “ERROR: sector 3069841408 does not have an msdos signature”. Second time around, I did “dd if=/dev/zero of=/dev/mmcblk0 bs=512 count=1” as it suggested but no luck (2nd round). I then took out the SD card and reformatted as FAT32 with gparted, but still no luck (3rd run below), its hung. Wonder why it says resource is busy. I did have a tempfs mounted :
tmpfs on /tmp/tmpfs type tmpfs (rw,size=3m)
and I ran the script from inside /tmp but I dont think that matters …
root@arm:/tmp# ls
beaglebone-black-copy-eMMC-to-microSD.sh tmpfs
root@arm:/tmp# ./beaglebone-black-copy-eMMC-to-microSD.sh
update-initramfs: Generating /boot/initrd.img-3.8.13-bone21
grep: /boot/config-3.8.13-bone21: No such file or directory
‘/boot/initrd.img-3.8.13-bone21’ → ‘/boot/uboot/initrd.img’
Image Name: initramfs
Created: Sun Jun 30 02:54:14 2013
Image Type: ARM Linux RAMDisk Image (uncompressed)
Data Size: 2709751 Bytes = 2646.24 kB = 2.58 MB
Load Address: 00000000
Entry Point: 00000000
umount: /dev/mmcblk0p1: not mounted
umount: /dev/mmcblk0p2: not mounted
16+0 records in
16+0 records out
16777216 bytes (17 MB) copied, 0.142181 s, 118 MB/s
Checking that no-one is using this disk right now …
BLKRRPART: Device or resource busy
This disk is currently in use - repartitioning is probably a bad idea.
Umount all file systems, and swapoff all swap partitions on this disk.
Use the --no-reread flag to suppress this check.
Disk /dev/mmcblk0: 60000 cylinders, 255 heads, 63 sectors/track
sfdisk: ERROR: sector 3069370368 does not have an msdos signature
/dev/mmcblk0: unrecognized partition table type
Old situation:
No partitions found
New situation:
Units = mebibytes of 1048576 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End MiB #blocks Id System
/dev/mmcblk0p1 * 0+ 70- 71- 72261 e W95 FAT16 (LBA)
/dev/mmcblk0p2 70+ 1874- 1805- 1847475 83 Linux
/dev/mmcblk0p3 0 - 0 0 0 Empty
/dev/mmcblk0p4 0 - 0 0 0 Empty
Successfully wrote the new partition table
Re-reading the partition table …
BLKRRPART: Device or resource busy
The command to re-read the partition table failed.
Run partprobe(8), kpartx(8) or reboot your system now,
before using mkfs
If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes: dd if=/dev/zero of=/dev/foo7 bs=512 count=1
(See fdisk(8).)
root@arm:/tmp# ^C
root@arm:/tmp# dd if=/dev/zero of=/dev/mmcblk0 bs=512 count=1
1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.00515201 s, 99.4 kB/s
root@arm:/tmp#
root@arm:/tmp#
root@arm:/tmp# ./beaglebone-black-copy-eMMC-to-microSD.sh
update-initramfs: Generating /boot/initrd.img-3.8.13-bone21
grep: /boot/config-3.8.13-bone21: No such file or directory
‘/boot/initrd.img-3.8.13-bone21’ → ‘/boot/uboot/initrd.img’
Image Name: initramfs
Created: Sun Jun 30 03:00:43 2013
Image Type: ARM Linux RAMDisk Image (uncompressed)
Data Size: 2709750 Bytes = 2646.24 kB = 2.58 MB
Load Address: 00000000
Entry Point: 00000000
umount: /dev/mmcblk0p1: not mounted
umount: /dev/mmcblk0p2: not mounted
16+0 records in
16+0 records out
16777216 bytes (17 MB) copied, 0.0885991 s, 189 MB/s
Checking that no-one is using this disk right now …
BLKRRPART: Device or resource busy
This disk is currently in use - repartitioning is probably a bad idea.
Umount all file systems, and swapoff all swap partitions on this disk.
Use the --no-reread flag to suppress this check.
Disk /dev/mmcblk0: 60000 cylinders, 255 heads, 63 sectors/track
sfdisk: ERROR: sector 3069546496 does not have an msdos signature
/dev/mmcblk0: unrecognized partition table type
Old situation:
No partitions found
New situation:
Units = mebibytes of 1048576 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End MiB #blocks Id System
/dev/mmcblk0p1 * 0+ 70- 71- 72261 e W95 FAT16 (LBA)
/dev/mmcblk0p2 70+ 1874- 1805- 1847475 83 Linux
/dev/mmcblk0p3 0 - 0 0 0 Empty
/dev/mmcblk0p4 0 - 0 0 0 Empty
Successfully wrote the new partition table
Re-reading the partition table …
BLKRRPART: Device or resource busy
The command to re-read the partition table failed.
Run partprobe(8), kpartx(8) or reboot your system now,
before using mkfs
If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes: dd if=/dev/zero of=/dev/foo7 bs=512 count=1
(See fdisk(8).)
root@arm:/tmp# nano ./beaglebone-black-copy-eMMC-to-microSD.sh
root@arm:/tmp# ./beaglebone-black-copy-eMMC-to-microSD.sh
- source=/dev/mmcblk1
- destination=/dev/mmcblk0
- check_running_system
- ‘[’ ‘!’ -f /boot/uboot/uEnv.txt ‘]’
- check_host_pkgs
- unset deb_pkgs
- dpkg -l
- grep dosfstools
- grep rsync
- dpkg -l
- grep u-boot-tools
- dpkg -l
- ‘[’ ‘’ ‘]’
- update_boot_files
++ uname -r
- ‘[’ ‘!’ -f /boot/initrd.img-3.8.13-bone21 ‘]’
++ uname -r
- update-initramfs -u -k 3.8.13-bone21
update-initramfs: Generating /boot/initrd.img-3.8.13-bone21
grep: /boot/config-3.8.13-bone21: No such file or directory
++ uname -r
- ‘[’ -f /boot/vmlinuz-3.8.13-bone21 ‘]’
++ uname -r
- ‘[’ -f /boot/initrd.img-3.8.13-bone21 ‘]’
++ uname -r
- cp -v /boot/initrd.img-3.8.13-bone21 /boot/uboot/initrd.img
‘/boot/initrd.img-3.8.13-bone21’ → ‘/boot/uboot/initrd.img’
++ uname -r
- mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 -n initramfs -d /boot/initrd.img-3.8.13-bone21 /boot/uboot/uInitrd
Image Name: initramfs
Created: Sun Jun 30 03:02:45 2013
Image Type: ARM Linux RAMDisk Image (uncompressed)
Data Size: 2709760 Bytes = 2646.25 kB = 2.58 MB
Load Address: 00000000
Entry Point: 00000000
- mount_n_check
- umount /dev/mmcblk0p1
umount: /dev/mmcblk0p1: not mounted
- true
- umount /dev/mmcblk0p2
umount: /dev/mmcblk0p2: not mounted
- true
- lsblk
- grep /dev/mmcblk0p1
- repartition_emmc
- dd if=/dev/zero of=/dev/mmcblk0 bs=1M count=16
16+0 records in
16+0 records out
16777216 bytes (17 MB) copied, 0.143162 s, 117 MB/s
- LC_ALL=C
- sfdisk --force --DOS --sectors 63 --heads 255 --unit M /dev/mmcblk0
Checking that no-one is using this disk right now …
BLKRRPART: Device or resource busy
This disk is currently in use - repartitioning is probably a bad idea.
Umount all file systems, and swapoff all swap partitions on this disk.
Use the --no-reread flag to suppress this check.
Disk /dev/mmcblk0: 60000 cylinders, 255 heads, 63 sectors/track
sfdisk: ERROR: sector 3069841408 does not have an msdos signature
/dev/mmcblk0: unrecognized partition table type
Old situation:
No partitions found
New situation:
Units = mebibytes of 1048576 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End MiB #blocks Id System
/dev/mmcblk0p1 * 0+ 70- 71- 72261 e W95 FAT16 (LBA)
/dev/mmcblk0p2 70+ 1874- 1805- 1847475 83 Linux
/dev/mmcblk0p3 0 - 0 0 0 Empty
/dev/mmcblk0p4 0 - 0 0 0 Empty
Successfully wrote the new partition table
Re-reading the partition table …
BLKRRPART: Device or resource busy
The command to re-read the partition table failed.
Run partprobe(8), kpartx(8) or reboot your system now,
before using mkfs
If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes: dd if=/dev/zero of=/dev/foo7 bs=512 count=1
(See fdisk(8).)
root@arm:/tmp# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
mmcblk1boot0 179:16 0 1M 1 disk
mmcblk1boot1 179:24 0 1M 1 disk
mmcblk0 179:0 0 1.9G 0 disk
-mmcblk0p1 179:1 0 70.6M 0 part
-mmcblk0p2 179:2 0 627.6M 0 part mmcblk1 179:8 0 1.8G 0 disk -mmcblk1p1 179:9 0 64M 0 part /boot/uboot
-mmcblk1p2 179:10 0 1.7G 0 part /
root@arm:/tmp# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
mmcblk1boot0 179:16 0 1M 1 disk
mmcblk1boot1 179:24 0 1M 1 disk
mmcblk0 179:0 0 1.9G 0 disk
-mmcblk0p1 179:1 0 70.6M 0 part
-mmcblk0p2 179:2 0 627.6M 0 part mmcblk1 179:8 0 1.8G 0 disk -mmcblk1p1 179:9 0 64M 0 part /boot/uboot
-mmcblk1p2 179:10 0 1.7G 0 part /
root@arm:/tmp#
root@arm:/tmp#
root@arm:/tmp# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
mmcblk1boot0 179:16 0 1M 1 disk
mmcblk1boot1 179:24 0 1M 1 disk
mmcblk0 179:0 0 1.9G 0 disk
-mmcblk0p1 179:1 0 70.6M 0 part
-mmcblk0p2 179:2 0 627.6M 0 part mmcblk1 179:8 0 1.8G 0 disk -mmcblk1p1 179:9 0 64M 0 part /boot/uboot
-mmcblk1p2 179:10 0 1.7G 0 part /
root@arm:/tmp# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
mmcblk1boot0 179:16 0 1M 1 disk
mmcblk1boot1 179:24 0 1M 1 disk
mmcblk0 179:0 0 1.9G 0 disk
-mmcblk0p1 179:1 0 70.6M 0 part
-mmcblk0p2 179:2 0 627.6M 0 part mmcblk1 179:8 0 1.8G 0 disk -mmcblk1p1 179:9 0 64M 0 part /boot/uboot
-mmcblk1p2 179:10 0 1.7G 0 part /
root@arm:/tmp#
root@arm:/tmp#
root@arm:/tmp#
root@arm:/tmp#
root@arm:/tmp# ls /dev/mmcblk*
mmcblk0 mmcblk0p1 mmcblk0p2 mmcblk1 mmcblk1boot0 mmcblk1boot1 mmcblk1p1 mmcblk1p2
root@arm:/tmp# ./beaglebone-black-copy-eMMC-to-microSD.sh
- source=/dev/mmcblk1
- destination=/dev/mmcblk0
- check_running_system
- ‘[’ ‘!’ -f /boot/uboot/uEnv.txt ‘]’
- check_host_pkgs
- unset deb_pkgs
- dpkg -l
- grep dosfstools
- grep rsync
- dpkg -l
- grep u-boot-tools
- dpkg -l
- ‘[’ ‘’ ‘]’
- update_boot_files
++ uname -r
- ‘[’ ‘!’ -f /boot/initrd.img-3.8.13-bone21 ‘]’
++ uname -r
- update-initramfs -u -k 3.8.13-bone21
update-initramfs: Generating /boot/initrd.img-3.8.13-bone21
grep: /boot/config-3.8.13-bone21: No such file or directory
++ uname -r
- ‘[’ -f /boot/vmlinuz-3.8.13-bone21 ‘]’
++ uname -r
- ‘[’ -f /boot/initrd.img-3.8.13-bone21 ‘]’
++ uname -r
- cp -v /boot/initrd.img-3.8.13-bone21 /boot/uboot/initrd.img
‘/boot/initrd.img-3.8.13-bone21’ → ‘/boot/uboot/initrd.img’
++ uname -r
- mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 -n initramfs -d /boot/initrd.img-3.8.13-bone21 /boot/uboot/uInitrd
Image Name: initramfs
Created: Sun Jun 30 03:09:51 2013
Image Type: ARM Linux RAMDisk Image (uncompressed)
Data Size: 2709744 Bytes = 2646.23 kB = 2.58 MB
Load Address: 00000000
Entry Point: 00000000
- mount_n_check
- umount /dev/mmcblk0p1
umount: /dev/mmcblk0p1: not mounted
- true
- umount /dev/mmcblk0p2
umount: /dev/mmcblk0p2: not mounted
- true
- grep /dev/mmcblk0p1
- lsblk
- repartition_emmc
- dd if=/dev/zero of=/dev/mmcblk0 bs=1M count=16
16+0 records in
16+0 records out
16777216 bytes (17 MB) copied, 0.0803752 s, 209 MB/s
- LC_ALL=C
- sfdisk --force --DOS --sectors 63 --heads 255 --unit M /dev/mmcblk0
Checking that no-one is using this disk right now …
BLKRRPART: Device or resource busy
This disk is currently in use - repartitioning is probably a bad idea.
Umount all file systems, and swapoff all swap partitions on this disk.
Use the --no-reread flag to suppress this check.
Disk /dev/mmcblk0: 60000 cylinders, 255 heads, 63 sectors/track
sfdisk: ERROR: sector 3069308928 does not have an msdos signature
/dev/mmcblk0: unrecognized partition table type
Old situation:
No partitions found
New situation:
Units = mebibytes of 1048576 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End MiB #blocks Id System
/dev/mmcblk0p1 * 0+ 70- 71- 72261 e W95 FAT16 (LBA)
/dev/mmcblk0p2 70+ 1874- 1805- 1847475 83 Linux
/dev/mmcblk0p3 0 - 0 0 0 Empty
/dev/mmcblk0p4 0 - 0 0 0 Empty