| To: | Sebastian Brings <sebas@xxxxxxxxxxxxxx>, Nathan Scott <nathans@xxxxxxx>, xfs@xxxxxxxxxxx |
|---|---|
| Subject: | Re: XFS bmap to disk lba question. |
| From: | "Michael Li (gmail)" <mikore.li@xxxxxxxxx> |
| Date: | Fri, 14 Jul 2006 21:42:37 +0800 |
| Domainkey-signature: | a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:x-accept-language:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=jf99VC8jlkIoASyx7V4HKo7BiTmsk7Z9DdJ6SWuMq1GCxCuzMe9A6Los4TUROfSj/JR3WShsSjn2GJQhA3XEYCkov4dEL2eEIjmcyylF7zEw33x0g/EGIFoR6mWN8Pdp5fEP5dUeMXykRjg0Rf/wkIpZN5l2b8UXGEXhmCVCNic= |
| In-reply-to: | <55EF1E5D5804A542A6CA37E446DDC2062D6068@mapibe17.exchange.xchg> |
| References: | <55EF1E5D5804A542A6CA37E446DDC2062D6068@mapibe17.exchange.xchg> |
| Sender: | xfs-bounce@xxxxxxxxxxx |
| User-agent: | Mozilla Thunderbird 1.0.7 (Windows/20050923) |
Hi, Nathan and Sebastian, I have drafted a formula for the bmap->LBA mapping for a simple stripe group(RAID0) on IRIX/CXFS. Maybe it is some roughness, If there is any mistake, correct me: For example: if a file is on [200, 1000]( shown from xfs_bmap). And the stripe unit is 128kB. stripe width is 3(totally 3 disks), xvm can told us the user data area begin after 4096 block.(This is changable by admin) stripe_unit_size = 128KB stripe_width = 3 sector_size = 512Btyes chuck_blocks = stripe_unit_size/sector_size = 128KB/512B = 256 blocks. stripe_line_blocks = chuck_block * stripe_width = 256 * 3 = 768 blocks data_offset_to_disk_block0 = 4096 blocks. file_sector_offset_in_stripe_line = BMAP % stripe_line_blocks = 200 % 768 = 200 disk_id = file_sector_offset_in_stripe_line / chunk_blocks = 200 / 256 = 0 stripe_high = BMAP / strip_line_blocks = 200 / 768 = 0 File_head_sector = stripe_high * chuck_blocks + data_offset_to_disk_block0 + file_sector_offset_in_stripe_line = 0*256 + 4096 + 200 = 4296 The LBA for the file's first block IS the above line: 4296. To ensure it, just dd back the raw data from the disk at the offset 4296 is ok. However, I am not sure the result if there is a plex layer is inserted or on the realtime volume... Could you or other interested persons refine the calculation for some variation or is there any outstanding issue on it? Thanks, Michael Sebastian Brings wrote: For Irix I am aware of two ways. One is to do the math, using xvm show -verbose phys/* and so on to get the sizes of labels and volume header and figure out where the first data block starts. The other way is to use a program which does direct IO read on an existing file and run it under control of "par -k". This produces plenty of output, but holds information like "read from device X starting at offset Y number of bytes Z. You then can match it with your xfs_bmap -v list. |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: [PATCH] xfs: i_state of inode is changed after the inode is freed, Masayuki Saito |
|---|---|
| Next by Date: | Request Barriers and Software RAID, Federico Sevilla III |
| Previous by Thread: | RE: XFS bmap to disk lba question., Sebastian Brings |
| Next by Thread: | dmapi support for xfs on fedora core 5?, Jeff Hardy |
| Indexes: | [Date] [Thread] [Top] [All Lists] |