On 09/11/2018 12:17, Ralph Corderoy wrote:
Hi Peter,
I didn't know that you should do each partition individually.
fsck(8) stands for filesystem check and with each partition holding one
filesystem, it needs to run on each partition=filesystem.
I'm trying Deans suggestion to catch an image and clone it, but not
successfully so far.
Try these commands, pasting one at a time and checking for no errors.
I don't think I've messed up, but I haven't tried them so you should
have a read first. In particular, you don't want dd's conv=noerror
suggested at
https://wiki.archlinux.org/index.php/Dd#Cloning_an_entire_hard_disk
As normal, specifying the wrong device can trample your main hard disk
so `measure twice', and then again.
src=/dev/sdb # Change as appropriate. Disk, not partition.
img=${src//\//_}
img=${img#_}.img
devbs=$(stat -fc %s $src)
echo copy $src to $img using multiple of $devbs bytes
sudo dd if=$src bs=$((devbs * 32)) of=$img
dest=/dev/sdc # Change as appropriate. Disk, not partition.
devbs=$(stat -fc %s $dest)
echo copy $img to $dest using multiple of $devbs bytes
sudo dd if=$img bs=$((devbs * 32)) of=$dest
sync # Vital. Don't remove media until it's finished.
Cheers, Ralph.
Result:
peterm@peterm-MBB-34204H:~/Raspberry-Pi$
peterm@peterm-MBB-34204H:~/Raspberry-Pi$ src=/dev/sdb
peterm@peterm-MBB-34204H:~/Raspberry-Pi$ img=${src//\//_}
peterm@peterm-MBB-34204H:~/Raspberry-Pi$ img=${img#_}.img
peterm@peterm-MBB-34204H:~/Raspberry-Pi$ devbs=$(stat -fc %s $src)
peterm@peterm-MBB-34204H:~/Raspberry-Pi$
peterm@peterm-MBB-34204H:~/Raspberry-Pi$ sudo dd if=$src bs=$((devbs * 32))
of=$img
[sudo] password for peterm:
dd: error reading '/dev/sdb': Input/output error
126+1 records in
126+1 records out
16580608 bytes (17 MB, 16 MiB) copied, 0.0128577 s, 1.3 GB/s
peterm@peterm-MBB-34204H:~/Raspberry-Pi$
Is it because sdb is mounted?
peterm@peterm-MBB-34204H:~/Raspberry-Pi$ sudo fdisk -l
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 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
Disklabel type: dos
Disk identifier: 0x80d1abcd
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 156250111 156248064 74.5G 83 Linux
/dev/sda2 156252158 976771071 820518914 391.3G 5 Extended
/dev/sda5 156252160 167968767 11716608 5.6G 82 Linux swap / Solaris
/dev/sda6 167970816 976771071 808800256 385.7G 83 Linux
Disk /dev/sdb: 7.2 GiB, 7744782336 bytes, 15126528 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
Disklabel type: dos
Disk identifier: 0x3f7114e6
Device Boot Start End Sectors Size Id Type
/dev/sdb1 8192 97889 89698 43.8M c W95 FAT32 (LBA)
/dev/sdb2 98304 15126527 15028224 7.2G 83 Linux
peterm@peterm-MBB-34204H:~/Raspberry-Pi$
just tried this, and it failed too.
http://www.aoakley.com/articles/2015-10-09-resizing-sd-images.php
Going to test the card ( this is my 'master') and see if it still works.
Cheers,
Peter
Thanks Peter
--
Next meeting at *new* venue: Bournemouth, Tuesday, 2018-12-04 20:00
Check if you're replying to the list or the author
Meetings, mailing list, IRC, ... http://dorset.lug.org.uk/
New thread, don't hijack: mailto:dorset@mailman.lug.org.uk