On Sun, Feb 21, 2010 at 9:03 AM, Asdo <asdo@xxxxxxxxxxxxx> wrote: > James Bottomley wrote: > > On Sat, 2010-02-20 at 22:30 +0100, Asdo wrote: > > > It rereads the wrong size, i.e. the one of the old disk :-( > I am sure sdr is the correct disk, I even identified it by doing dd > if=/dev/sdr of=/dev/null and then looking at the activity led to confirm > it's the right drive. It should have read a size of 1TB. > > > What's happening is that libata is returning the old cached size to > READ_CAPACITY. This would likely indicate some type of libata hotplug > failure ... the dmesg across the unplug/plug would be useful for > diagnosing this. > > > Thanks for your reply > Unfortunately there is absolutely no dmesg output when I swap the disk. It > does not realize I am swapping it. > One time I tried to do smartctl -a when the disk was out, and all kernel > hanged. I had to hard reset the system. > > So there is no way to uncache the read_capacity or to enter the value > manually? > (I say in advance that I cannot remove the driver module from the running > kernel because the operating system is on other disks also on the same > controller) ata_piix doesn't have a way to get automatically notified that the disk has been hotplugged since the chipset doesn't support it in this mode. (The ideal solution would be to switch the controller into AHCI mode, but I don't know if that's possible on that chipset and BIOS.) I think there are some ways to get the code to recheck the disk however.. you can try echoing something into the "rescan" sysfs file under /sys that matches your device (do a "find /sys/ -name scsi_level" to see what directories they're in, the rescan file is in the same directory). -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html