Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I plug a completely clean CF-card into my USB card-writer. Then I dd a mbr block of 512 bytes size to the device, which contains the partition table and the definition of one partition.

Problem: While "fdisk -l /dev/sdx" correctly displays the partition, it happens that there is no device like "/dev/sdx1" after these operations (as it was not present before). Unplugging and plugging the card-writer solves the problem and makes the device(s) appear. Since I use this procedure in a script, manually unplugging and re-plugging is no option whatsoever.

Is there a way to "refresh" the devices or to "unplug and re-plug" the drive by script such that /dev/sdx1 appears?

Thanks for any help,


share|improve this question
up vote 1 down vote accepted

I think I found a solution:

hdparm -z /dev/sdx

seems to to the trick so far.

share|improve this answer

try partprobe. I don't know if it rereads external cards, but it did help me when I changed partitions on my local drives.

share|improve this answer
Thanks for the hint, but while 'partprobe -s' detects the partitions correctly, the '/proc/partitions' file and the device nodes are not updated. – Chris May 12 '10 at 8:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.