LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices



Reply
 
Search this Thread
Old 06-09-2009, 04:41 AM   #1
bitzsk
LQ Newbie
 
Registered: Apr 2009
Posts: 15

Rep: Reputation: 0
why sector number not match block number?


Hi,

i want to get the exact match between block number and sector number of a file in domU of Xen. so i do follows .


root@feisty:~# ls -l
total 1
-rw-r--r-- 1 root root 4 Jun 9 08:16 a

root@feisty:~# filefrag -v a
Checking a
Filesystem type is: ef53
Filesystem cylinder groups is approximately 122
Blocksize of file a is 1024
File size of a is 2 (1 blocks)
First block: 247208
Last block: 247208
a: 1 extent found

the file has one block and block size is 247208, so the secoter size is 247208 *2 +1 == 78B51 and 247208*2 +2 == 78B52 (block number count begin from 0 , sector number count begin from 1).

root@feisty:~# echo "a" >> a

command above is a write to a file

root@feisty:~# tail /var/log/messages
Jun 9 08:15:54 feisty kernel: do_blk_req cf9d1de8: cmd cf9d1e64, sec ae85e, (2/2) buffer:cf7a1800 [write]
Jun 9 08:16:14 feisty kernel: do_blk_req cf9d152c: cmd cf9d15a8, sec ae7c6, (2/2) buffer:ce81ec00 [write]
Jun 9 08:16:19 feisty kernel: do_blk_req cf9d152c: cmd cf9d15a8, sec 2, (2/2) buffer:d06ee400 [write]
Jun 9 08:16:19 feisty kernel: do_blk_req cf9d1f40: cmd cf9d1fbc, sec 6, (2/2) buffer:d06eec00 [write]
Jun 9 08:16:19 feisty kernel: do_blk_req cf9d1e94: cmd cf9d1f10, sec 880d0, (2/2) buffer:d0392000 [write]
Jun 9 08:16:19 feisty kernel: do_blk_req cf9d1de8: cmd cf9d1e64, sec 880d4, (2/2) buffer:d0392800 [write]
Jun 9 08:16:19 feisty kernel: do_blk_req cf9d11d0: cmd cf9d124c, sec 880d8, (2/2) buffer:cecdf000 [write]
Jun 9 08:16:19 feisty kernel: do_blk_req cf9d127c: cmd cf9d12f8, sec ac002, (2/2) buffer:cf1e4400 [write]
Jun 9 08:16:19 feisty kernel: do_blk_req cf9d1124: cmd cf9d11a0, sec ae25a, (2/2) buffer:cf652400 [write]
Jun 9 08:16:19 feisty kernel: do_blk_req cf9d1b38: cmd cf9d1bb4, sec ae67c, (2/2) buffer:ce6d1800 [write]

and then to show sector number i had written, i expect to see 78B51 or 78B52 sector number. but none of then display, can you tell me why?

--
Regards,
Sucan
 
Old 06-09-2009, 06:32 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729
Normally, a sector is 512 bytes----regardless of the block size. Perhaps you are using "sector" to mean something else.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
why block number changed after change of file? bitzsk Linux - Kernel 2 06-05-2009 08:10 AM
LXer: Revamped Perl Script To More Evenly Distribute Number Pool Match Odds LXer Syndicated Linux News 0 09-17-2008 02:30 PM
Bad magic number in super-block Cadmium Linux - Newbie 2 10-03-2007 02:50 AM
Bad magic number in super-block kubokubik Linux - Newbie 4 01-26-2005 11:52 AM
why there is a need for minor number and major number for monitor/keyboard in pc? tripathi Solaris / OpenSolaris 1 11-07-2003 10:36 AM


All times are GMT -5. The time now is 01:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration