LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-19-2012, 08:41 PM   #1
ItsTheSource
LQ Newbie
 
Registered: Aug 2012
Posts: 5

Rep: Reputation: Disabled
Why are fdisk & df reporting different sizes for encrypted disk?


Here's the problem I'm having. I cannot determine slice size for dar, because I cannot figure out exactly what the slice size should be.

My output from fdisk -l seems to clash with my output from df. I didn't create any partitions when I encrypted the drive, so I believed that they should match. Alas, they do not.

Code:
# fdisk -l
Disk /dev/mapper/realcrypt1: 2000.4 GB, 2000398671872 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907028656 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Code:
# df -B1
Filesystem                 1B-blocks          Used     Available Use% Mounted on
/dev/mapper/realcrypt1 1969009336320  435361845248 1533647491072  23% /mnt/esata
Obviously 2000398671872 bytes != 1969009336320 bytes. So what gives?

Last edited by ItsTheSource; 10-20-2012 at 09:11 AM.
 
Old 10-20-2012, 08:32 PM   #2
aetratus
LQ Newbie
 
Registered: Jul 2006
Location: Internet
Distribution: Fedora, CentOS, Archlinux
Posts: 27

Rep: Reputation: 6
fdisk looks at disks/partitions. df looks at filesystems. This seems to make sense on the face of it, since you encrypted the whole partition (which you referred to as a drive - it's not). The "extra" bytes fdisk sees are a function of the encryption and not useable - stick with what df reports.
FWIW, what does
Code:
tune2fs -l /dev/mapper/realcrypt1
show?
 
1 members found this post helpful.
Old 10-21-2012, 06:53 AM   #3
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
Another possibility can be space allocated to the root user (5%).
 
Old 10-21-2012, 10:00 AM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,783

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
You are overlooking the file system overhead -- the space occupied by inodes, group descriptors, and the like. For an ext2/3/4 file system with the default parameters, this is around 1.5%. The report from df shows only the number of available data blocks after formatting.
 
1 members found this post helpful.
Old 10-21-2012, 10:03 PM   #5
ItsTheSource
LQ Newbie
 
Registered: Aug 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thanks for the information.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
dar drisay Linux - Software 4 01-22-2009 06:06 AM
LXer: Disk ARchive (Backup and Restore) using dar and kdar(dar Frontend) LXer Syndicated Linux News 0 01-12-2007 05:54 PM
Wget quiz && size limit? Zmyrgel Slackware 2 08-14-2006 07:07 AM
maximizing video size to full screen in mplayer ashrafzia Fedora 1 07-31-2006 04:17 PM
Desktop the size of a slice of toast terrus Linux - Laptop and Netbook 6 09-04-2005 02:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:29 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