LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 04-02-2019, 06:04 AM   #1
Velenon
LQ Newbie
 
Registered: Mar 2019
Location: Northern Ireland
Distribution: Debian 9.6 Stretch
Posts: 5

Rep: Reputation: Disabled
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.
 
Old 04-04-2019, 09:04 AM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,345

Rep: Reputation: Disabled
What does
Code:
tune2fs -l /dev/sdb1 | grep "Block size"
return?
 
Old 04-04-2019, 09:42 AM   #3
Velenon
LQ Newbie
 
Registered: Mar 2019
Location: Northern Ireland
Distribution: Debian 9.6 Stretch
Posts: 5

Original Poster
Rep: Reputation: Disabled
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
 
Old 04-04-2019, 09:56 AM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,783

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
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?"
 
Old 04-06-2019, 02:49 AM   #5
Velenon
LQ Newbie
 
Registered: Mar 2019
Location: Northern Ireland
Distribution: Debian 9.6 Stretch
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thumbs up

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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows 7 can't write to RHEL 3 server when files greater then 1kb morixhanson Linux - Server 6 03-15-2010 11:29 AM
handling 1mb adsl + 1mb adsl on one ubuntu router? sarthor Linux - Server 0 10-03-2007 06:57 AM
Mandrake 10 Internet very slow (<1kb/sec) while windows got 50k/sec SafeTechs Mandriva 13 09-01-2006 04:07 PM
Kernel size under 1KB? Zvi Linux - Software 4 12-07-2003 02:15 PM
i can upload file that is greater than 1MB marconi8 Linux - General 0 12-17-2002 09:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 02:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration