# 320GB SATA drive is only reading 284GB.

## Hydraulix

Anyone know why my drive is only reading 284GB? Let me know if you need to see more info.

```

libata version 1.30 loaded.

sata_sil 0000:00:12.0: version 1.0

ACPI (acpi_bus-0216): Device 'SAT0' is not power manageable [20060310]

ACPI: PCI Interrupt 0000:00:12.0[A] -> GSI 22 (level, low) -> IRQ 18

ata1: SATA max UDMA/100 cmd 0xDC80E080 ctl 0xDC80E08A bmdma 0xDC80E000 irq 18

ata2: SATA max UDMA/100 cmd 0xDC80E0C0 ctl 0xDC80E0CA bmdma 0xDC80E008 irq 18

ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)

ata1: dev 0 cfg 49:2f00 82:346b 83:7f01 84:4003 85:3469 86:3c01 87:4003 88:203f

ata1: dev 0 ATA-6, max UDMA/100, 625142448 sectors: LBA48

ata1: dev 0 configured for UDMA/100

scsi0 : sata_sil

ata2: SATA link down (SStatus 0 SControl 300)

scsi1 : sata_sil

  Vendor: ATA       Model: WDC WD3200JD-22K  Rev: 08.0

  Type:   Direct-Access                      ANSI SCSI revision: 05

SCSI device sda: 625142448 512-byte hdwr sectors (320073 MB)

sda: Write Protect is off

sda: Mode Sense: 00 3a 00 00

SCSI device sda: drive cache: write back

SCSI device sda: 625142448 512-byte hdwr sectors (320073 MB)

sda: Write Protect is off

sda: Mode Sense: 00 3a 00 00

SCSI device sda: drive cache: write back

 sda: sda1

sd 0:0:0:0: Attached scsi disk sda

sd 0:0:0:0: Attached scsi generic sg0 type 0

```

```

/dev/sda1             284G  9.5M  284G   1% /ftp

```

----------

## daemonflower

I figure that's normal. The 320 GB number comes not from the technical division of your hard disk manufacturer, but from the marketing division. Tech guys, like you and me, think 1 GB is 1024*1024*1024 bytes, while "normal" people think 1G = 1000*1000*1000. For people who insist on precision of expression, the ten-based gigabyte is 1 GB, while the binary-based gigabyte is 1GiB.

Linux shows you the GiB numbers, even if it says GB. So, your 320 GB drive has only 298 raw GiB, which you see as GB.

The rest is probably reserved for administrative use. Which filesystem do you use? At least ext2 and ext3 reserve 5% of the space for the root user. You can change that with the command "tune2fs -m".

It's weird that the kernel shows you a 320073 MB disk. That really seem to be MB, not MiB, because if it were MiB, you had a 336 GB disk, and I've never heard of those.

Anyway, it adds up. 95% of 298 GiB is 283 GiB. Taking rounding errors in my calculation into account, that's what you've got.

----------

## Ast0r

The 5% is not from the amount reserved for root; it's from the file-system overhead. You can see this for yourself by the superuser reserved space to an arbitrary percentage and looking at the output of df before and afterwards.

Also, fdisk (at least on every machine that I have ever used) gives me the size of the disk in bytes/(1,000,000,000). In this way the amount that fdisk shows matches up with the manufacturer's labeling. Kernel output is similar in this regard.

Here is the kernel message regarding my 80GB drive:

```
hda: 160086528 sectors (81964 MB) w/7936KiB Cache, CHS=65535/16/63, UDMA(133)
```

Here is output from fdisk:

```
Disk /dev/hda: 81.9 GB, 81964302336 bytes
```

As you can see, fdisk just added a decimal and made it 3 significant figures. You just have to get used to how different things calculate and display size (however, it appears to be pretty consistent in Linux as long as you're dealing with disks and partition sizes).

----------

## Hydraulix

Ah that sucks. I'm trying out Reiser4 for my FTP server. I really wanted at least 300GB but I guess this will have to do. Unless I figure out a way to crank out more storage off this drive. Thanks for the info.

----------

## Ast0r

 *Hydraulix wrote:*   

> Ah that sucks. I'm trying out Reiser4 for my FTP server. I really wanted at least 300GB but I guess this will have to do. Unless I figure out a way to crank out more storage off this drive. Thanks for the info.

 Isn't Reiser4 experimental?

Also, I'm not sure how the overhead on Reisfer4 compares to Reiser3 or ext3. You could try formatting the partition with various file-systems and see how much free space you get, but I'm guessing it's going to be pretty comperable.

----------

## Hydraulix

 *Ast0r wrote:*   

>  *Hydraulix wrote:*   Ah that sucks. I'm trying out Reiser4 for my FTP server. I really wanted at least 300GB but I guess this will have to do. Unless I figure out a way to crank out more storage off this drive. Thanks for the info. Isn't Reiser4 experimental?
> 
> Also, I'm not sure how the overhead on Reisfer4 compares to Reiser3 or ext3. You could try formatting the partition with various file-systems and see how much free space you get, but I'm guessing it's going to be pretty comperable.

 

It's very experimental.  :Very Happy:  But that's why I'm putting it on a /ftp partition. Nothing major just some files that I'm sharing so if it goes down then whatever. I do have to say it's by far the fastest filesystem I've ever seen in my life. Give it some time and it should be in the stable branch. But don't hold your breath. 

I'll give some other filesystems a shot just to see if there's a difference. Thanks for the input.

----------

## robgrady

This thread partially answered a similar problem that I am having.  I have a 300GB drive, which I now understand is not what I thought it to be (I can't believe I didn't know this until now).  So that explains why `df -h' lists 276G as the Size.  However, I still cannot figure out why it lists Used as 129M and Avail as 261G on a freshly partitioned drive.

```
# fdisk -l /dev/sdc

Disk /dev/sdc: 300.0 GB, 300069052416 bytes

255 heads, 63 sectors/track, 36481 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

/dev/sdc1               1       36481   293033601   83  Linux

# df -h

Filesystem            Size  Used Avail Use% Mounted on

...

/dev/sdc1             276G  129M  261G   1% /mnt/new_backup
```

Any ideas?

----------

## Hydraulix

Also for some reason smartd won't find my SATA drive. Here's the output...

```

smartctl -a /dev/sda

smartctl version 5.36 [i686-pc-linux-gnu] Copyright (C) 2002-6 Bruce Allen

Home page is http://smartmontools.sourceforge.net/

Device: ATA      WDC WD3200JD-22K Version: 08.0

Serial number:      WD-WCAMR2244705

Device type: disk

Local Time is: Wed Apr 26 06:00:58 2006 EDT

Device does not support SMART

Error Counter logging not supported

[GLTSD (Global Logging Target Save Disable) set. Enable Save with '-S on']

Device does not support Self Test logging

```

```

smartctl -S on /dev/sda

smartctl version 5.36 [i686-pc-linux-gnu] Copyright (C) 2002-6 Bruce Allen

Home page is http://smartmontools.sourceforge.net/

Enable autosave (clear GLTSD bit) failed

```

```

smartctl -s on /dev/sda

smartctl version 5.36 [i686-pc-linux-gnu] Copyright (C) 2002-6 Bruce Allen

Home page is http://smartmontools.sourceforge.net/

unable to fetch IEC (SMART) mode page [unsupported field in scsi command]

A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.

```

```

Apr 26 05:58:34 compaq smartd[14944]: Device: /dev/sda, IE (SMART) not enabled, skip device Try 'smartctl -s on /dev/sda' to turn on SMART features

```

----------

## Sachankara

 *Hydraulix wrote:*   

> Also for some reason smartd won't find my SATA drive. Here's the output...
> 
> ```
> 
> smartctl -a /dev/sda
> ...

 Read the log:  *Quote:*   

> SATA disks accessed via libata are not currently supported by_smartmontools. When libata is given
> 
> an ATA pass-thru ioctl() then an_additional '-d libata' device type will be added to smartmontools.

 

----------

## farnz

 *robgrady wrote:*   

> This thread partially answered a similar problem that I am having.  I have a 300GB drive, which I now understand is not what I thought it to be (I can't believe I didn't know this until now).  So that explains why `df -h' lists 276G as the Size.  However, I still cannot figure out why it lists Used as 129M and Avail as 261G on a freshly partitioned drive.
> 
> ```
> # fdisk -l /dev/sdc
> 
> ...

 

Fairly standard Unix filesystem behaviour, which Linux copies. The 129M used will be the space used for filesystem overheads; the available space is the space available for users. The difference between Avail+Used and Size is the reserved blocks; these are used by the filesystem to aid performance (they can be used to reduce fragmentation, for example), and are available to root as ordinary disk space. The amount reserved can be changed with tune2fs if it's ext3 or ext2; there's equivalents for other FSes.

----------

## robgrady

 *farnz wrote:*   

> Fairly standard Unix filesystem behaviour, which Linux copies. The 129M used will be the space used for filesystem overheads; the available space is the space available for users. The difference between Avail+Used and Size is the reserved blocks; these are used by the filesystem to aid performance (they can be used to reduce fragmentation, for example), and are available to root as ordinary disk space. The amount reserved can be changed with tune2fs if it's ext3 or ext2; there's equivalents for other FSes.

 

Alrighty, thanks, a few more questions though.  First, does the FS really need 15G?  I notice in the first post by Hydraulix that Size and Avail are of roughly equal value.

 *Hydraulix wrote:*   

> 
> 
> ```
> 
> /dev/sda1             284G  9.5M  284G   1% /ftp
> ...

 

Second, if the difference between Avail and Size is due to reserved blocks, what is the cause of the difference between Size and the raw disk space?  My 300GB drive translates to 279.46 GiB which is ~4.39GiB greater than `df' displays for Size.  Sorry for all the questions, just trying to learn.  Thanks again!

----------

## Kaste

276 GiB *  (100% - 5%) = 261 GiB 5 % Overhead, just like said above. 

I don't know about the Size and raw difference. Is it possible that they rounded it to 300 GB to make it look prettier? BTW. If you played Baseball or an equivalent sport with it already then it could also be due to S.M.A.R.T but i think there should be a more trivial solution  :Very Happy: 

----------

## robgrady

 *Kaste wrote:*   

> 276 GiB *  (100% - 5%) = 261 GiB 5 % Overhead, just like said above. 
> 
> I don't know about the Size and raw difference. Is it possible that they rounded it to 300 GB to make it look prettier? BTW. If you played Baseball or an equivalent sport with it already then it could also be due to S.M.A.R.T but i think there should be a more trivial solution 

 

Maybe I need to rephrase my question.  I know that the difference between the Size and Avail in this case is 5%.  I'm asking if the filesystem really needs that 5% (which comes out to ~15GiB), or would it be safe to reduce that (and by how much)?  The difference between Size and Avail listed by Hydraulix is 0%, is that bad?  Hmm... now reading over this again, I see that daemonflower computed that the Size value for Hydraulix already accounted for the filesystem overhead.  So, is this just a difference in the output that Hydraulix and I see from `df'?

----------

