You are not logged in.

#1 2019-04-09 13:13:58

Tom B
Member
Registered: 2014-01-15
Posts: 187
Website

[SOLVED] New hard drive, available space showing too low

I just bought a new 8tb hard drive and do not seem to be able to get all the space available.

TiB to TB calculation means there should be about 7.3TB in total which is shown correctly:

# df -h /dev/sdc1
Filesystem      Size  Used Avail Use% Mounted on
/dev/sdc1       7.3T   51M  6.9T   1% /run/media/server/backup

There are two strange things going on here:

1. There's nothing on the drive so I'm not sure where that 51MB is coming from, perhaps it's required by the filesystem, I have no idea, it if it was just that I wouldn't worry.

2. 7.3T available, 51MB used, 6.9T available. Even ignoring the 51MB used, there's 0.4T missing. Shouldn't Size = Used + Avail?

I used gparted to create a GPT partition table, then partition and format it to ext4. cgdisk shows the partition as the correct size.

It's a brand new drive so could potentially be faulty but smartctl shows everything as fine. My worry isn't so much the space, though losing nearly 500gb is rather annoying, but that the drive may be faulty.

# smartctl -a /dev/sdc
smartctl 7.0 2018-12-30 r4883 [x86_64-linux-4.20.0-arch1-1-ARCH] (local build)
Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Western Digital Red
Device Model:     WDC WD80EFAX-68KNBN0
Serial Number:    VAHW72VL
LU WWN Device Id: 5 000cca 099da7825
Firmware Version: 81.00A81
User Capacity:    8,001,563,222,016 bytes [8.00 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    5400 rpm
Form Factor:      3.5 inches
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ACS-2, ATA8-ACS T13/1699-D revision 4
SATA Version is:  SATA 3.2, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Tue Apr  9 14:08:59 2019 BST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x80) Offline data collection activity
                                        was never started.
                                        Auto Offline Data Collection: Enabled.
Self-test execution status:      (   0) The previous self-test routine completed
                                        without error or no self-test has ever 
                                        been run.
Total time to complete Offline 
data collection:                (   87) seconds.
Offline data collection
capabilities:                    (0x5b) SMART execute Offline immediate.
                                        Auto Offline data collection on/off support.
                                        Suspend Offline collection upon new
                                        command.
                                        Offline surface scan supported.
                                        Self-test supported.
                                        No Conveyance Self-test supported.
                                        Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
                                        power-saving mode.
                                        Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
                                        General Purpose Logging supported.
Short self-test routine 
recommended polling time:        (   2) minutes.
Extended self-test routine
recommended polling time:        ( 887) minutes.
SCT capabilities:              (0x003d) SCT Status supported.
                                        SCT Error Recovery Control supported.
                                        SCT Feature Control supported.
                                        SCT Data Table supported.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000b   100   100   016    Pre-fail  Always       -       0
  2 Throughput_Performance  0x0004   100   100   054    Old_age   Offline      -       0
  3 Spin_Up_Time            0x0007   100   100   024    Pre-fail  Always       -       0
  4 Start_Stop_Count        0x0012   100   100   000    Old_age   Always       -       1
  5 Reallocated_Sector_Ct   0x0033   100   100   005    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x000a   100   100   067    Old_age   Always       -       0
  8 Seek_Time_Performance   0x0004   100   100   020    Old_age   Offline      -       0
  9 Power_On_Hours          0x0012   100   100   000    Old_age   Always       -       0
 10 Spin_Retry_Count        0x0012   100   100   060    Old_age   Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       1
192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       1
193 Load_Cycle_Count        0x0012   100   100   000    Old_age   Always       -       1
194 Temperature_Celsius     0x0002   147   147   000    Old_age   Always       -       44 (Min/Max 14/44)
196 Reallocated_Event_Count 0x0032   100   100   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0022   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0008   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x000a   200   200   000    Old_age   Always       -       0

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
No self-tests have been logged.  [To run self-tests, use: smartctl -t]

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

Last edited by Tom B (2019-04-09 13:39:28)

Offline

#2 2019-04-09 13:27:57

Ropid
Member
Registered: 2015-03-09
Posts: 1,069

Re: [SOLVED] New hard drive, available space showing too low

There's 5% reserved space on ext4 by default. You can disable that manually and set it to 0%. I don't remember the command for this.

Here's a calculation using those 5% where I end up with 6.9 TiB:

$ bc -l <<< '8001563222016 * 0.95 / 2^40'
6.91351038850843906402

That 8001563222016 number I got out of your smartctl output.

Offline

#3 2019-04-09 13:36:43

Tom B
Member
Registered: 2014-01-15
Posts: 187
Website

Re: [SOLVED] New hard drive, available space showing too low

Ropid wrote:

There's 5% reserved space on ext4 by default. You can disable that manually and set it to 0%. I don't remember the command for this.

Here's a calculation using those 5% where I end up with 6.9 TiB:

$ bc -l <<< '8001563222016 * 0.95 / 2^40'
6.91351038850843906402

That 8001563222016 number I got out of your smartctl output.

Aha, thank you. Looking at the man page for mkfs, it's -m [percentage]. It looks like this is useful to avoid fragmentation, though approaching 500gb is excessive.

Offline

#4 2019-04-09 14:17:29

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] New hard drive, available space showing too low

It's nothing to do with fragmentation, it's reserved for root use only so that a runaway user process can't fill up the filesystem and bring down the system. 5% used to be a sensible amount back when drives were measured in MB/GB but nowadays it's a ridiculous default. On a filesystem that's going to be used for data storage only I routinely set it to 0%.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#5 2019-04-09 14:42:25

Tom B
Member
Registered: 2014-01-15
Posts: 187
Website

Re: [SOLVED] New hard drive, available space showing too low

The man page suggests it does help with fragmentation, though I'd assume it only really makes a difference if the disk is nearly full.

-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%. 

Offline

Board footer

Powered by FluxBB