2009年10月6日 星期二

"cat /proc/partitions"的block size

$ cat /proc/partitions
major minor #blocks name

8 0 80418240 sda
8 1 6835626 sda1
8 2 1 sda2
8 5 2650693 sda5
8 6 70926943 sda6
7 0 5892 loop0
8 16 3948544 sdb

$ sudo dd if=/dev/zero of=/dev/sdb count=3948544 bs=1024

該block size =1024

reference:

Any time Linux refers to block size, it is almost always 1024 bytes - Linux uses 1024-byte blocks as its primitive units for the buffer cache and everything The only times it isn't is in filesystem-specific drivers, since some filesystems use other granularities (for example, on a normal-sized ext3 filesystem, the filesystem block size is usually 4096 bytes). However, you almost never get to see the filesystem block size; almost the only way to actually see it is to be a kernel hacker or run programs like dumpe2fs.

http://www.linuxforums.org/forum/misc/5654-linux-disk-block-size-help-please.html

沒有留言: