I have a 750 GB WD MyBook drive that I move lots of data around on, specifically from work to home and back. Today I wanted to hook it up to my development Linux box. The last time I did this I walked up and plugged it into the front USB ports on the machine (a Dell PowerEdge 2850 running Red Hat Enterprise Linux 4). No sweat.
Today was different, though. For whatever reason the partition on the disk didn’t get picked up automatically. I plugged the drive in and got /dev/sdt, but no /dev/sdt1, though fdisk showed it there. Um, WTF.
After a few minutes of futzing around with it, unplugging it, plugging it back in, flailing with pvscan, scratching my head, Googling with no good results, etc. it finally occurred to me to use fdisk to fix it:
fdisk /dev/sdt
p (to make sure the partition is still there)
w (writing causes fdisk to tell the kernel to reread the partition table)
Ta-dum! I now have /dev/sdt1. No idea why the bad behavior started, but at least it’s a fairly easy fix.
Update: Jim Bartus suggests /sbin/partprobe in the comments. Rock on, thanks Jim!
If it happens again, try running “partprobe”.
This is why I like you guys. 🙂 Thanks Jim!
Another way to force a re-read the part table.
sudo /sbin/blockdev –rereadpt /dev/sdt1