LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   WD Red Drive 1Kb file takes up 1Mb on my fileserver (https://www.linuxquestions.org/questions/linux-hardware-18/wd-red-drive-1kb-file-takes-up-1mb-on-my-fileserver-4175651330/)

Velenon 04-02-2019 06:04 AM

WD Red Drive 1Kb file takes up 1Mb on my fileserver
 
Hi All,

My first time, posting a question.

Quick summary here, I have a 6Tb WD RED NAS drive that I am re-using as my data drive, just in a new Debian 9.6 system.

My Problem: When I save a 1Kb text file on the HD, my windows PC reports "Size on Disk" as 1Mb

Issue is I have done everything I understand is required to make the block size 4Kb for general file storage.

If I run: sudo fdisk -l
Code:

Disk /dev/sda: 111.8 GiB, 120034123776 bytes, 234441648 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
Disklabel type: dos
Disk identifier: 0xe89b0126

Device    Boot    Start      End  Sectors  Size Id Type
/dev/sda1  *        2048 226232319 226230272 107.9G 83 Linux
/dev/sda2      226234366 234440703  8206338  3.9G  5 Extended
/dev/sda5      226234368 234440703  8206336  3.9G 82 Linux swap / Solaris


Disk /dev/sdb: 5.5 TiB, 6001175126016 bytes, 11721045168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 96080702-BC3C-4ED1-A8E2-CCF926CF4A06

Device    Start        End    Sectors  Size Type
/dev/sdb1  2048 11721045134 11721043087  5.5T Linux filesystem

and run: sudo blockdev --getbsz /dev/sdb1

It returns 4096

As far as I know, this should mean that 1Kb file should take up 4Kb on the 6TB WD RED NAS drive.

The filesystem I put on the sdb1 partition was ext4 and I did so with the following command:

Code:

sudo mkfs.ext4 /dev/sdb1
Can anyone spot something obvious that I simply dont know or understand about hard drives and filesystems that is causing this? and possible give me a pointer as to what I should be searching for to fill in the blanks.

Some additional information which may be relevant:

This HD was used twice before.

Once was in a ubuntu server system the same as this setup but I never noticed if the files were using 1Mb as a minimum.

The second time was a Dell T610 server with a Dell Perc H700i RAID card with ESXI, I discovered that ESXI VMFS was limited to 1Mb block size by default and later decided that I was loosing too much space and that a virtualized file server through a normal RAID card that wasn't set for pass through probably wasn't the best idea versus a standalone dedicated file server.

So during the setup of the ESXI Datastore I created and initialized the virtual disk as a single drive RAID 0, and given the 1Mb limit of the VMFS I might have set the stripe size as 1Mb during this process, however even if I did do it, as far as I know this stripe size should only affect the virtual disk which no longer exists as this HD is now in an old Dell Vostro 260 Desktop and is nowhere near the H700i RAID card.

So is it possible I have overwritten the "geometry" of the hard drive with the RAID card?

Any help is appreciated,
Kind Regards, Velenon.

Ser Olmy 04-04-2019 09:04 AM

What does
Code:

tune2fs -l /dev/sdb1 | grep "Block size"
return?

Velenon 04-04-2019 09:42 AM

Hi Ser Olmy, thanks for the reply.

Returns Block Size: 4096

Would dump of the full file help?

I compared the full file to the partition on my VPN server on my ESXI Box and it was pretty much the same, the following lines were different:

WD RED
Inodes per group: 4096
Inode blocks per group: 256

VPN Server
Inodes per group: 8192
Inode blocks per group: 512

rknichols 04-04-2019 09:56 AM

Just what, in Windows, is reporting that file size as 1 MB? Note that in Linux, a "du -m" command would also show that size as "1 MB" because it is answering the question, "How many blocks of size 1MB would it take to hold this file?"

Velenon 04-06-2019 02:49 AM

Hi rknichols, thank you for raising some skepticism on the part of what is doing the reporting, it helped me find the answer.

I just automatically trusted the windows 10 folder properties window as correct.

I did a test and made a 15 byte txt file and put it on both the SSD and the HD of the file server in question and checked it with my windows 10 PC and a Windows 7 PC on the network.

The windows 10 PC reported size on disk as 1Mb but with the same file The windows 7 PC reported size on disk as 1Kb so it seems the issue isnt with the linux install this is a Windows 10 issue.

Anyway I checked and my windows PC reports that my total actual combined file size in the share is 4.02Tb for /Data_1 and I ran "sudo df /dev/sdb1" on the fileserver and it reported blocks of 1K and the total used space as 4.03Tb so I'm happy that the linux system is functioning correctly.

Thank you everyone for the help.


All times are GMT -5. The time now is 03:38 PM.