LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Some Allocated Disk Space When Formatting A Device (https://www.linuxquestions.org/questions/linux-newbie-8/some-allocated-disk-space-when-formatting-a-device-832448/)

ethereal1m 09-15-2010 10:52 PM

Some Allocated Disk Space When Formatting A Device
 
Dear all,
what is the allocated disk space for system files in a new formatted device?

Suppose I install a IDE hard drive with size of 40Gig and connect it to PC via SATA to IDE converter into SATA port. After the device is formatted (I format the whole thing without being partitioned) and mounted, it left with space of around 37.2Gig, which I suppose less than 2.8Gig are allocated for system files.

Is 2.8Gig allocation a normal size for system files? Can its size be minimized?

Regards,
ethereal1m

chrism01 09-15-2010 11:25 PM

there are 2 things to consider:

1. manufacturers often quote in figures based on powers of 10 vs actual size which is a power of 2. The difference increases as the size of the disk in qn grows.
http://en.wikipedia.org/wiki/Binary_prefix

2. Linux (and Unix) reserve an amt (typically 5%) for use by root only (ie unavail to regular users) on the disk in case it fills up. It may also be used by the OS (briefly) to minimise fragmentation when adding to/changing a file layout.

Quote:

-m reserved-blocks-percentage
Specify the percentage of the filesystem blocks reserved for the super-user. This avoids fragmentation, and allows root-owned daemons, such as syslogd(8), to continue to function correctly after non-privileged processes are prevented from writing to the filesystem. The default percentage is 5%.
http://linux.die.net/man/8/mkfs.ext3

ethereal1m 09-16-2010 03:29 AM

hmm, I'm using XFS filesystem and looking at mkfs.xfs command, I find a hard time to locate reserve-block-percentage option. I try to minimize this. Any idea?

ethereal1m 09-16-2010 03:51 AM

actually I run mkfs.xfs with option
Code:

-i maxpct=1
which suppose to allocate inode size, in this case 1 %, but after I execute the command, the remaining disk space is the same as before.

i92guboj 09-16-2010 04:51 AM

As the other poster said above, maybe all the "problem" is a different way to meassure things. How are you meassuring the disk space? Which tool?

Please, post the output for fdisk -l as well.

ethereal1m 09-16-2010 06:50 AM

I use "df -h"
Code:

/dev/sda              38G  9.6M  38G  1% /data
fdisk -l shows
Code:

Disk /dev/sda: 40.0 GB, 40019582464 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Disk /dev/sda doesn't contain a valid partition table

I didn't partition this device, not sure if this causing a problem though.....

i92guboj 09-16-2010 07:04 AM

fdisk and df meassure the disk capacity in different ways, it's what the other person said above.

Try "df -H" and they'll match. It's just a matter of using GB vs GiB, 1024 vs 1000, powers of 2 instead of powers of 10, whatever you prefer. There's nothing wrong with your disk or your fs.

ps. The fact that you didn't partition is will never be a problem for Linux, it could be for some other OSes, but not for Linux. It really doesn't matter if you use the raw device, a partition or any other kind of file (because in linux you can mkfs any arbitrary file, nost just these under /dev/sd*).

ethereal1m 09-16-2010 07:18 AM

ok, very good, thanks for the clarification


All times are GMT -5. The time now is 01:19 PM.