After looking through the strace (and my original problem) - I see that
the read which is giving me trouble is in read_extended(). Naturally
since the change in 2.2, the entry in the main partition table points to
a sector somewhere which isn't the one containing the extended
partition - and may even be beyond the end of the disk as the previous
extended partition was in the 8-9 gig area.
However, after dd-ing /dev/zero over the first sector (the partition
table), the same error (from ll_rw_block) still occurs. Viewing the
strace output (included below) makes it appear as though the HDIO_GETGEO
ioctl() call is the one that produces the printk(), as it appears before
the first output from fdisk on the console. (4 lines after the open()
on /dev/sda, so it must be in there somewhere.) This appears to solve
my immediate problem, as fdisk no longer dies with the failed read.
execve("./fdisk", ["./fdisk", "-b", "2048", "/dev/sda"], [/* 24 vars */]) = 0
mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40007000
mprotect(0x40000000, 20881, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
mprotect(0x8048000, 69708, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
stat("/etc/ld.so.cache", {st_mode=S_IFREG|0644, st_size=4853, ...}) = 0
open("/etc/ld.so.cache", O_RDONLY) = 4
mmap(0, 4853, PROT_READ, MAP_SHARED, 4, 0) = 0x40008000
close(4) = 0
stat("/etc/ld.so.preload", 0xbffffae0) = -1 ENOENT (No such file or directory)
open("/lib/libc.so.5", O_RDONLY) = 4
read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3"..., 4096) = 4096
mmap(0, 794624, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4000a000
mmap(0x4000a000, 562371, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 4, 0) = 0x4000a000
mmap(0x40094000, 20304, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 4, 0x89000) = 0x40094000
mmap(0x40099000, 207288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40099000
close(4) = 0
mprotect(0x4000a000, 562371, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
munmap(0x40008000, 4853) = 0
mprotect(0x8048000, 69708, PROT_READ|PROT_EXEC) = 0
mprotect(0x4000a000, 562371, PROT_READ|PROT_EXEC) = 0
mprotect(0x40000000, 20881, PROT_READ|PROT_EXEC) = 0
personality(PER_LINUX) = 0
geteuid() = 0
getuid() = 0
getgid() = 0
getegid() = 0
brk(0x805d60c) = 0x805d60c
brk(0x805e000) = 0x805e000
stat("/etc/locale/C/libc.cat", 0xbffff614) = -1 ENOENT (No such file or directory)
stat("/usr/share/locale/C/libc.cat", 0xbffff614) = -1 ENOENT (No such file or directory)
stat("/usr/share/locale/libc/C", 0xbffff614) = -1 ENOENT (No such file or directory)
stat("/usr/share/locale/C/libc.cat", 0xbffff614) = -1 ENOENT (No such file or directory)
stat("/usr/local/share/locale/C/libc.cat", 0xbffff614) = -1 ENOENT (No such file or directory)
open("/dev/sda", O_RDWR) = 4
fstat(4, {st_mode=S_IFBLK|0640, st_rdev=makedev(8, 0), ...}) = 0
read(4, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2048) = 2048
ioctl(4, HDIO_GETGEO, 0xbffffa78) = 0
write(2, "Device contains neither a valid "..., 78) = 78
write(2, "Building a new DOS disklabel. Ch"..., 165) = 165
fstat(1, {st_mode=S_IFCHR|0720, st_rdev=makedev(4, 1), ...}) = 0
mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40008000
ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
write(1, "\n", 1) = 1
fstat(0, {st_mode=S_IFCHR|0720, st_rdev=makedev(4, 1), ...}) = 0
mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40009000
ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0
write(1, "Command (m for help): ", 22) = 22
read(0, "q\n", 4096) = 2
close(4) = 0
_exit(0) = ?
-- -Ben Carter Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so. - Douglas Adams, "Last Chance to See"- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/