Hi !
Ich quäle mich jetzt seit einer Woche in einem OE 2.0 Image auf den alten 800ern mit Ihrem weiterhin alten 2.6.18 kernel einen simplen USB stick mit 2 Partitionen (FAT + EXT 3) zum Booten zu partitionieren und zu formatieren.
Dieses Simple Shellscript produziert Fehler die weder in einem OE 1.6 Image mit dem selben 2.6.18 Kernel auf der 800 noch in allen anderen Boxen unter OE 2.0 mit dem 3.2 Kernel reproduzierbar sind.
#!/bin/sh -x
dd if=/dev/zero of=/dev/sdb bs=2048 count=1
fdisk /dev/sdb << EOF
n
p
1
+256M
t
6
a
1
n
p
2
w
EOF
partprobe /dev/sdb
dd if=/dev/zero of=/dev/sdb1 bs=512 count=1
mkfs.vfat -F 16 -n TIMOTHY /dev/sdb1
mkfs.ext3 -L DUMBO /dev/sdb2
mkdir /var/tmp/dumbo
mount -t ext3 /dev/sdb2 /var/tmp/dumbo
mkdir /var/tmp/dumbo/boot
mount -t vfat /dev/sdb1 /var/tmp/dumbo/boot
Alles anzeigen
Obiges Script produziert folgenden Output wenn man es mit sh -x ausführt:
+ dd if=/dev/zero of=/dev/sdb bs=2048 count=1
1+0 records in
1+0 records out
2048 bytes (2.0KB) copied, 0.019333 seconds, 103.4KB/s
+ fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI, OSF or GPT disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that the previous content
won't be recoverable.
Command (m for help): Command action
e extended
p primary partition (1-4)
Partition number (1-4): First cylinder (1-1022, default 1): Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1022, default 1022):
Command (m for help): Selected partition 1
Hex code (type L to list codes): Changed system type of partition 1 to 6 (FAT16)
Command (m for help): Partition number (1-4):
Command (m for help): Command action
e extended
p primary partition (1-4)
Partition number (1-4): First cylinder (35-1022, default 35): Using default value 35
Last cylinder or +size or +sizeM or +sizeK (35-1022, default 1022): Using default value 1022
Command (m for help): The partition table has been altered.
Calling ioctl() to re-read partition table
+ partprobe /dev/sdb
Warning: Could not determine physical sector size for /dev/sdb.
Using the logical sector size (512).
Error: Partition(s) 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64 on /dev/sdb have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use. As a result, the old partition(s) will remain in use. You should reboot now before making further changes.
+ fdisk -l /dev/sdb
Disk /dev/sdb: 8014 MB, 8014528512 bytes
247 heads, 62 sectors/track, 1022 cylinders
Units = cylinders of 15314 * 512 = 7840768 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 34 260307 6 FAT16
/dev/sdb2 35 1022 7565116 83 Linux
+ dd if=/dev/zero of=/dev/sdb1 bs=512 count=1
1+0 records in
1+0 records out
512 bytes (512B) copied, 0.001272 seconds, 393.1KB/s
+ mkfs.vfat -F 16 -n TIMOTHY /dev/sdb1
mkfs.vfat: image is too small
+ mkfs.ext3 -L DUMBO /dev/sdb2
mke2fs 1.42.1 (17-Feb-2012)
Could not stat /dev/sdb2 --- No such file or directory
The device apparently does not exist; did you specify it correctly?
+ mount -t vfat /dev/sdb1 /var/tmp/dumbo/boot
mount: mounting /dev/sdb1 on /var/tmp/dumbo/boot failed: Input/output error
Alles anzeigen
Obige Fehler sind zwar sehr hübsch aber nicht wegzukriegen. Damit ist es NICHT mehr möglich ein device auf der 800 im OE 2.0 zu partitionieren und diese Partitionen zu formatieren OHNE dazwischen zu rebooten (es ist dabei egal ob man fdisk oder sfdisk zum Partitionieren nimmt und das ganze passiert trotz partprobe um die Partitiontable neu zu lesen obobwohl das fdisk -l die neue Partitionierung richtig anzeigt, sie also auch richtig geschrieben wird).
Kann sich das mal BITTE wer ansehen, weil sonst muss ich den Support für die alte 800 im OE 2.0 leider einstellen.
LG
gutemine
PS: Und nein, es macht keinen Unterschied ob man die Primary Partition vorher mit fdisk löscht statt mit dd den Disklabel einfach zu löschen und auch ein mknod für das /dev/sdb1 und
/dev/sdb2 hilft nichts.