Device LBA to array offset calculation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Is there an easy way to work out what offset into /dev/md3 would
correspond to LBA 3141211755 on /dev/sdc?

$ sudo fdisk -u -l /dev/sdc
Disk /dev/sdc: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: A9D7DEE3-9894-4D43-92D0-F5CC3B6E9E2A

Device           Start        End    Sectors  Size Type
/dev/sdc1         2048    1050623    1048576  512M Linux RAID
/dev/sdc2      1050624    7342079    6291456    3G Linux RAID
/dev/sdc3      7342080    9439231    2097152    1G Linux swap
/dev/sdc4      9439232 3907022847 3897583616  1.8T Linux RAID
/dev/sdc128 3907022848 3907029134       6287  3.1M BIOS boot

$ cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md3 : active raid10 sdc4[4] sdb4[3] sda4[0]
      2922991104 blocks super 1.2 512K chunks 2 far-copies [3/3] [UUU]
      bitmap: 0/22 pages [0KB], 65536KB chunk

An easier way than, "read the source," that is, the understanding
of which is a bit beyond me!

So it seems that is 3141211755 - 9439232 = 3131772523 sectors in to
device member sdc4, but md3 is a 3 device RAID-10 with far layout.

Cheers,
Andy



[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux