LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-25-2009, 03:30 AM   #16
huyangyang
Member
 
Registered: Nov 2009
Posts: 38

Original Poster
Rep: Reputation: 15

Quote:
Originally Posted by edwill View Post
because your system's the size of default block is 4K,every file will take up one block at least.
why append 1 byte data for file ,size change 8k
[root@WOLK-TECH tmp]# ll -sh joy
4.0K -rw-r--r-- 1 root root 0 Oct 30 17:46 joy
[root@WOLK-TECH tmp]# echo 1 > joy
[root@WOLK-TECH tmp]# ll -sh joy
8.0K -rw-r--r-- 1 root root 2 Oct 31 03:23 joy
 
Old 11-25-2009, 03:33 AM   #17
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Quote:
Originally Posted by edwill View Post
because your system's the size of default block is 4K,every file will take up one block at least.
What we are trying to discern at this point is why his info shows so, but mine does not. Just look at the numbers above, I won't paste them again.

The file is 0 bytes long. In his case, ls reports 4kb and stat says 8 disk blocks (disk block = 512 bytes, regardless of your fs). In my case, ls reports 0 kb and stat reports 0 disk blocks.

Last edited by i92guboj; 11-25-2009 at 03:35 AM.
 
Old 11-25-2009, 03:34 AM   #18
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
huyangyang, can you show us the mount line for that concrete partition where you are creating the file? Just in case.
 
Old 11-25-2009, 04:25 AM   #19
huyangyang
Member
 
Registered: Nov 2009
Posts: 38

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by i92guboj View Post
huyangyang, can you show us the mount line for that concrete partition where you are creating the file? Just in case.
this???
[root@WOLK-TECH test]# 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@WOLK-TECH test]# df -T
Filesystem Type 1K-blocks Used Available Use% Mounted on
/dev/sda3 ext3 7002712 2630968 4010284 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
 
Old 11-25-2009, 04:46 AM   #20
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Yes, that's what I wanted to see, just in case you were using some rare mount option or something, but everything seems quite normal to me.

If no one around can give a reasoned response I'd ask on the kernel subsection of the forum, maybe someone around there can give a better response, the reason for this must lie forcingly in the file system driver.
 
Old 11-25-2009, 04:58 AM   #21
huyangyang
Member
 
Registered: Nov 2009
Posts: 38

Original Poster
Rep: Reputation: 15
thank you!!!
 
  


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
Solaris 8 - file size and partition size discrepancy noir911 Solaris / OpenSolaris 1 02-10-2009 05:43 PM
[SOLVED] Questions about file size and dd djeikyb Linux - Software 3 10-15-2008 05:29 PM
Display by File Name, File Size, and File Owner using ls akeenabawa Linux - Newbie 9 08-15-2008 03:21 PM
any ideas to reduce log file size or make log file size managed? George2 Programming 2 08-13-2006 07:55 AM
file system size larger than fysical size:superblock or partition table corrupt klizon Linux - General 0 06-18-2004 05:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:50 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
Open Source Consulting | Domain Registration