refresh partition table

David Henderson dhenderson at
Mon May 16 15:20:55 UTC 2011

On 05/16/2011 11:09 AM, David Henderson wrote:
> On 05/16/2011 10:52 AM, David Henderson wrote:
>> On 05/15/2011 04:27 PM, Sergey Naumov wrote:
>>> blockdev --rereadpt
>>> Sergey Naumov.
>> I've run into an interesting problem by using the above syntax.  
>> Apparently when I issue that command "blockdev --rereadpt /dev/sde", 
>> it removes all the device's partition files (e.g. /dev/sde1) and 
>> leaves the one for the drive itself (e.g. /dev/sde).  If I unplug the 
>> device and plug it back in, the correct device files populate again.  
>> So it appears that mdev is working right, but the blockdev is not.  
>> Any ideas why blockdev would be doing this?
>> Dave
> Just to add a few more details.  I have a card reader that occupies 
> /dev/sda through /dev/sdd.  If I insert an SD card with 2 partitions 
> and wait for mdev to populate the device files, wait a few seconds, 
> then issue the blockdev command, it wipes out those partition files 
> too (e.g. /dev/sdb1).  If I issue the blockdev command on the device 
> files for the card reader that don't have any inserted media, I get 
> the error message "blockdev: can't open '/dev/sda': No medium found".  
> This tells me that blockdev can actually see if a device is present 
> and that the devices files are populated correctly.  I just have no 
> idea why it wouldn't be working correctly.  I've also tried:
> # hdparm -z /dev/sde
> /dev/sde:
> So you can see that it's failing too.  I think, however, hdparm isn't 
> the best choice to use for USB attached devices.  Thoughts anyone?
> Dave

Even more details - I wanted to see what dmesg was giving me, so I 
browsed the output, tried the blockdev command again and noticed that 
for every attempt at running it, I get the following entry appended to 
the dmesg output:

sd 5:0:0:0: [sde] Assuming drive cache: write through
  sde: sde1

So perhaps blockdev is working correctly, there just happens to be a 
problem getting the device files to populate.  Are the device files 
created by blockdev itself as opposed to a helper of some type (e.g. mdev)?


More information about the busybox mailing list