Refresh devices - reconnect CF card drive by script (unplug-plug equivalent)

Posted by Chris on Server Fault See other posts from Server Fault or by Chris
Published on 2010-05-11T14:21:32Z Indexed on 2010/05/11 14:25 UTC
Read the original article Hit count: 366

Hello

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,

Chris

© Server Fault or respective owner

Related posts about linux

Related posts about usb-flash-drive