#22 --fibmap does not show physical secotrs on losetup device

closed-invalid
nobody
None
5
2009-08-18
2009-08-17
Anonymous
No

There is no logick for getting physical sectors for losetup devices. It will be very-very cool if hdparm can get sector number inside losetup file and then (recursively) get sector number of underlying device.

Example for losetup on /dev/sdb
1. fibmap() on original file sector number 56 -> losetup's sector 78
2. fibmap() on losetup's file sector 78 -> /dev/sdb sector 134

for situation where losetup on losetup on losetup on hdd, hdparm should be able to detect if block device is physical. and if not, recursion (no more than, say, 16 times) should be used. In current state it should check if block device is losetup. Think about stripping RAIDs.

Myabe format of output should be
device: start_sector: count
And when recursion, output may be in this form ( replace @ with > ):
@/fs/file.img: 1234:56
@@/dev/sda:56:50
@@/dev/sda:10:6
@/fs/file.img: 555:10
@@/dev/sda:100:10

Discussion

  • Mark Lord
    Mark Lord
    2009-08-18

    Not a bug. This is a feature request, and one that cannot be done in hdparm alone. Kernel support for FIEMA on loop devices is required for this to work.

     
  • Mark Lord
    Mark Lord
    2009-08-18

    • status: open --> closed-invalid