LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-16-2011, 05:49 AM   #1
mah454
Member
 
Registered: Oct 2009
Location: Iran
Distribution: Debian , Ubuntu , RHEL , CentOS , NetBill
Posts: 134

Rep: Reputation: 15
1T file in 188G file system !


Hello ...
I use this command for make image file :
Code:
#dd if=/dev/zero of=disk.img seek=2G count=1
and use this command for check file size :
Code:
#ls -l
-rw-r--r-- 1 root   root   1099511627776 2011-03-16 14:14 disk.img
#ls -lh
-rw-r--r-- 1 root   root   1.0T 2011-03-16 14:15 disk.img
I make this file in /home partition :
Code:
#df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda5             188G  124G   55G  70% /home
Please compare file and filesystem size !
What is this mean ?
 
Old 03-16-2011, 07:21 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,740

Rep: Reputation: 5921Reputation: 5921Reputation: 5921Reputation: 5921Reputation: 5921Reputation: 5921Reputation: 5921Reputation: 5921Reputation: 5921Reputation: 5921Reputation: 5921
seek skips n blocks (using the specified output block size) from beginning of output file before copying. Since you did not specify the block size vie the bs option the default is 512. So:
file size = 2G * BS
1099511627776=2*1024*1024*1024*512

The correct syntax to create a 2G file is:
dd if=/dev/zero of=disk.img bs=2G count=1


I will let the experts chime in on what is actually happening but my logical guess is the actual disk space is only 512 i.e default block size. Assuming the command completed successfully and obviously if a 1TB file was written you would see errors or worse yet file system corruption.
 
Old 03-16-2011, 08:38 AM   #3
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
Explanation here:

http://en.wikipedia.org/wiki/Sparse_file
 
Old 03-16-2011, 09:04 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,740

Rep: Reputation: 5921Reputation: 5921Reputation: 5921Reputation: 5921Reputation: 5921Reputation: 5921Reputation: 5921Reputation: 5921Reputation: 5921Reputation: 5921Reputation: 5921
Of course... Thanks...
 
Old 03-17-2011, 12:08 AM   #5
mah454
Member
 
Registered: Oct 2009
Location: Iran
Distribution: Debian , Ubuntu , RHEL , CentOS , NetBill
Posts: 134

Original Poster
Rep: Reputation: 15
Ok ...
Thank You
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
where does file system keeps file name in the file system data structure pavan.manipal Linux - Newbie 4 02-22-2010 07:38 AM
Linpus Fedora after saving files to file system, CAN'T open FILE SYSTEM from desktop! remiwa Fedora 2 01-07-2009 07:28 AM
when does linux switch from realmode file system to protectedmode file system sitthar Linux - General 3 04-08-2006 08:05 AM
figuring out 'file system' and 'swap file system' types TrulyTessa Linux - Newbie 3 09-26-2005 06:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:42 PM.

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