1 |
On Monday 16 May 2011 02:01:13 Adam Carter wrote: |
2 |
> WRT why it stopped after 10MB, if i specified a smaller size it would just |
3 |
> stop after whatever was specified, so its just doing a single chunk equal |
4 |
> to whatever bs has been specified as. |
5 |
|
6 |
I recall zeroing drives/partitions and getting this message on the *second* |
7 |
run, when the partition table had already been deleted. Recreating a |
8 |
partition table with fdisk allowed another run by dd. Floppies did not have |
9 |
this problem (no partition tables on them). |
10 |
|
11 |
What I suggested was to experiment with another bs just in case that was |
12 |
causing the problem of writing only one block. |
13 |
|
14 |
|
15 |
> I think the re-read of the partition table is probably the problem - so |
16 |
> thanks for that suggestion. |
17 |
|
18 |
This is the most likely cause, but I cannot understand why it will write only |
19 |
one block and not the lot. |
20 |
|
21 |
|
22 |
> To check my understanding - would it be correct to say that; |
23 |
> 1. Using dd to copy the first 512 bytes (MBR) is ALL that is needed to |
24 |
> setup the partitions - that is i wont need to run fdisk etc afterward. |
25 |
|
26 |
This is correct if you only have primary partitions. It will not copy the |
27 |
extended partition and any logical partitions in it. They reside in the first |
28 |
sector of the extended partition, which is not a boot sector, but contains the |
29 |
logical partition table. (I found this out the hard way!) |
30 |
|
31 |
Have a look at this to see how you can back up the extended partition tables |
32 |
with sfdisk (there's more than one of these, if you have more than one logical |
33 |
partition) : |
34 |
|
35 |
http://www.partimage.org/Partimage-manual_Backup-partition-table |
36 |
|
37 |
|
38 |
> 2. Using dd in this way of course will not update the kernel's knowledge of |
39 |
> the partition table so a partprobe is necessary |
40 |
|
41 |
Yes, or a reboot. |
42 |
|
43 |
|
44 |
> 3. When using fdisk to write a partition table and exit, it calls a re-read |
45 |
> of the partition table by the kernel so any changes should be ready |
46 |
> straight away. (there's a message about calling ioctl when it exits - so i |
47 |
> guess that is the update) |
48 |
|
49 |
They are ready (i.e. written) but not yet read by the OS. Tools like gparted |
50 |
(part)probe the device to re-read the partition table after saving changes to |
51 |
disk. |
52 |
-- |
53 |
Regards, |
54 |
Mick |