Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
my system is RHEL5.2
[root@joy ~]# uname -r
2.6.18-92.el5
[root@joy ~]# mount
/dev/sda3 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
/dev/sdb on /mnt type ext3 (rw)
[root@joy ~]# df -T
Filesystem Type 1K-blocks Used Available Use% Mounted on
/dev/sda3 ext3 7002712 2631988 4009264 40% /
/dev/sda1 ext3 101086 11139 84728 12% /boot
tmpfs tmpfs 257744 0 257744 0% /dev/shm
/dev/sdb ext3 20642428 176200 19417652 1% /mnt
create a empty file,but this file size is 4k
[root@joy tmp]# touch joy
[root@joy tmp]# ll -sh joy
4.0K -rw-r--r-- 1 root root 0 Oct 30 17:23 joy
[root@joy tmp]# stat joy
File: `joy'
Size: 0 Blocks: 8 IO Block: 4096 regular empty file
Device: 803h/2051d Inode: 1421279 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2009-10-30 17:23:50.000000000 +0800
Modify: 2009-10-30 17:23:50.000000000 +0800
Change: 2009-10-30 17:23:50.000000000 +0800
append 2 byte data for the file ,size change 8k
[root@joy tmp]# echo i > joy
[root@joy tmp]# ll -sh joy
8.0K -rw-r--r-- 1 root root 2 Oct 31 04:59 joy
There is a difference between the actual size of the content of a file (in your case, 2 bytes) and the size it takes up on disk.
The latter is always a multiple of the block size, which in your case seems to be 8KB (a fairly standard value).
This is related to how disk reading/writing/caching works, which is related to your operating system (Linux) and the
organization of the data on your hard drive (the filesystem).
If you scroll down to 8 block you see the scsi disk devices (8 being the so called major number), next to it a breakdown per disk (sda/sdb etc) with the starting minor number.
One none partitioned scsci disk will have major number 8 and minor number 0. The first partition will be 8 1, then 8 2 etc. This also explains why you can have a maximum of 15 partitions on one disk. (0 -> 16. One for the disk itself, 15 for partitions).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.