Skip to main content
Retitle, remove irrelevant tags
Link
Arda
  • 1.6k
  • 1
  • 13
  • 12

samba network disk ext4 3tb wrong Wrong free space reported for an ext4-formatted 3TB drive

added 321 characters in body
Source Link
Arda
  • 1.6k
  • 1
  • 13
  • 12

I've just bought a WD elements 3TB external hard drive, formatted it to ext4 and mounted it on raspberry pi (raspbian (fork of debian) with latest kernel and package updates), and I've a problem linux counting its free space.

This is the fdisk -l output:

Disk /dev/sdb: 3000.6 GB, 3000590401536 bytes
255 heads, 63 sectors/track, 45600 cylinders, total 732566016 sectors
Units = sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x0018b22e

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1

         256   732566015  2930263040   83  Linux

This is the df -h output of the drive:

Filesystem      Size  Used Avail Use% Mounted on
/dev/sdb1       2.7T  201M  2.6T   1% /media/disk2

I've mounted it on samba (smb.conf) like this:

[usbdisk2]
comment = password please!
dfree command = /home/pi/dfree    
path = /media/disk2
create mask = 0775
directory mask = 0775
read only = no
guest ok = yes
browseable = yes
writable = yes

This is my /home/pi/dfree (777 chmodded):

#!/bin/sh
df $1 | tail -1 | awk '{print $2" "$4}'

This is my samba version: Samba version 3.6.6

When the network drive is mounted on windows, even if there are no files on drive, it says 139GB used space, which is not acceptable for me.

What am I doing wrong, how do I fix this?

Edit: I've also provided a dfree method, issue goes on. Updating the question

Thanks,

I've just bought a WD elements 3TB external hard drive, formatted it to ext4 and mounted it on raspberry pi (raspbian (fork of debian) with latest kernel and package updates), and I've a problem linux counting its free space.

This is the fdisk -l output:

Disk /dev/sdb: 3000.6 GB, 3000590401536 bytes
255 heads, 63 sectors/track, 45600 cylinders, total 732566016 sectors
Units = sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x0018b22e

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1

         256   732566015  2930263040   83  Linux

This is the df -h output of the drive:

Filesystem      Size  Used Avail Use% Mounted on
/dev/sdb1       2.7T  201M  2.6T   1% /media/disk2

I've mounted it on samba (smb.conf) like this:

[usbdisk2]
comment = password please!
path = /media/disk2
create mask = 0775
directory mask = 0775
read only = no
guest ok = yes
browseable = yes
writable = yes

This is my samba version: Samba version 3.6.6

When the network drive is mounted on windows, even if there are no files on drive, it says 139GB used space, which is not acceptable for me.

What am I doing wrong, how do I fix this?

Thanks,

I've just bought a WD elements 3TB external hard drive, formatted it to ext4 and mounted it on raspberry pi (raspbian (fork of debian) with latest kernel and package updates), and I've a problem linux counting its free space.

This is the fdisk -l output:

Disk /dev/sdb: 3000.6 GB, 3000590401536 bytes
255 heads, 63 sectors/track, 45600 cylinders, total 732566016 sectors
Units = sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x0018b22e

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1

         256   732566015  2930263040   83  Linux

This is the df -h output of the drive:

Filesystem      Size  Used Avail Use% Mounted on
/dev/sdb1       2.7T  201M  2.6T   1% /media/disk2

I've mounted it on samba (smb.conf) like this:

[usbdisk2]
comment = password please!
dfree command = /home/pi/dfree    
path = /media/disk2
create mask = 0775
directory mask = 0775
read only = no
guest ok = yes
browseable = yes
writable = yes

This is my /home/pi/dfree (777 chmodded):

#!/bin/sh
df $1 | tail -1 | awk '{print $2" "$4}'

This is my samba version: Samba version 3.6.6

When the network drive is mounted on windows, even if there are no files on drive, it says 139GB used space, which is not acceptable for me.

What am I doing wrong, how do I fix this?

Edit: I've also provided a dfree method, issue goes on. Updating the question

Thanks,

Source Link
Arda
  • 1.6k
  • 1
  • 13
  • 12
Loading