LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-11-2013, 10:59 AM   #1
billvance
Member
 
Registered: Sep 2013
Location: Bothell, Washington USA
Distribution: Kubuntu 12.04
Posts: 57

Rep: Reputation: Disabled
Block Sizes


Howdy;
I'm trying to find out how to do appropriate block sizes for
quota and dd. Near as I've been able to find out, dvd-r uses
a block size of 2048, and has a total of 4044128 blocks.

However, when I try to do the math, it comes out to 8282374144
bytes, and when I try to divide it up to get something that
seems reasonable for the two mentioned programs, and then check
the math by multiplying back up, the numbers all come out
different. Can anyone tell me what the appropriate numbers are?

Bill
 
Old 09-11-2013, 04:57 PM   #2
qrange
Member
 
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian stable, amd64
Posts: 805

Rep: Reputation: 32
that seems like a dual layer disc?
why not simply use bs=2048 in dd ?

I don't understand how numbers can be different, unless you're using Pentium I
 
Old 09-11-2013, 11:23 PM   #3
billvance
Member
 
Registered: Sep 2013
Location: Bothell, Washington USA
Distribution: Kubuntu 12.04
Posts: 57

Original Poster
Rep: Reputation: Disabled
I don't understand it either. According to one source, dd
is supposed to create a file of n length composed of all
zeros, n being the size of the virtual file thats the same
size as the dvd-r. At least thats what they seemed to be
saying.
 
Old 09-12-2013, 02:30 AM   #4
qrange
Member
 
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian stable, amd64
Posts: 805

Rep: Reputation: 32
well it can do that. what options are you using?

you could use it like this:

dd if=/dev/zero of=file_composed_of_zeros bs=2048 count=4044128

or

dd if=/dev/zero of=file_composed_of_zeros bs=16384 count=505516

result should be the same. but the latter might be a bit faster.

maybe you forgot the 'count' option when reading from dvd.
various dvd drives can add some zeroes to end of .iso file, so you get slightly wrong result. just truncate it to N*2048.
 
1 members found this post helpful.
Old 09-12-2013, 08:51 AM   #5
billvance
Member
 
Registered: Sep 2013
Location: Bothell, Washington USA
Distribution: Kubuntu 12.04
Posts: 57

Original Poster
Rep: Reputation: Disabled
Thanks, that was the part that wasn't explained.

Now, for the second part of my question, how does one do
that for quota? Or would lat-quota be easier? I only just found out about lat-quota, so I haven't even had a chance
to go over the man page yet.
 
Old 09-13-2013, 04:57 AM   #6
billvance
Member
 
Registered: Sep 2013
Location: Bothell, Washington USA
Distribution: Kubuntu 12.04
Posts: 57

Original Poster
Rep: Reputation: Disabled
Perhaps I should rephrase the question a bit.
I've been all over the web looking, but all
I've found, is that its relatively easy to
set the number of blocks in quota. What I
haven't been able to find, is how to set the
size of those blocks, or even if quota has
some default block size that it insists on
using. Anyone got a clue on that?
 
Old 09-13-2013, 05:05 PM   #7
qrange
Member
 
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian stable, amd64
Posts: 805

Rep: Reputation: 32
I don't know, never used quota. my guess is it would be equal to size of filesystem blocks. you set that when you format partition. I think its usually 4K.
might be a good idea to have larger blocks if partition is to hold mostly huge files.

I just checked, seems it is so: http://www.cyberciti.biz/tips/determ...isk-quota.html
 
Old 09-13-2013, 06:34 PM   #8
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,602

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Quote:
Originally Posted by billvance View Post
Perhaps I should rephrase the question a bit.
I've been all over the web looking, but all
I've found, is that its relatively easy to
set the number of blocks in quota. What I
haven't been able to find, is how to set the
size of those blocks, or even if quota has
some default block size that it insists on
using. Anyone got a clue on that?
Disk quotas are computed using the size of the minimum allocation unit of the disk (a block). If your disk uses 2048 byte blocks, then that is the size it will use. If the disk is 4k byte blocks then that is the size it uses.
 
1 members found this post helpful.
Old 09-14-2013, 04:37 AM   #9
qrange
Member
 
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian stable, amd64
Posts: 805

Rep: Reputation: 32
iirc, 'physical' block size on *all* disks is 512 bytes. this seems to be logical block size.
if so, its a bit confusing, what happens when you have several mount points with different logical block size?
 
Old 09-14-2013, 09:21 AM   #10
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,602

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Quote:
Originally Posted by qrange View Post
iirc, 'physical' block size on *all* disks is 512 bytes. this seems to be logical block size.
if so, its a bit confusing, what happens when you have several mount points with different logical block size?
That used to be true, but isn't anymore. Some of the 4TB disks use 4k blocks instead, and emulate (at a performance penalty) a 512 byte block if they are configured to do so.

Each filesystem has the minimum allocation unit in its header, and that is what is used.

Each filesystem mounted has to be given its own quota allocation. Where it is mounted doesn't matter. Now that said, SOME filesystems don't support quotas - FAT/VFAT don't support quotas, NTFS looks like it does, Ext2/3/4 and btrfs do. Memory resident filesystems tmpfs/ramfs do not (and tmpfs introduce a denial of service attack area with the ability to cause OOM when users can access that filesystem).

It looks like CD/DVD formats do not (iso9660, UDF).
 
Old 09-14-2013, 11:35 AM   #11
qrange
Member
 
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian stable, amd64
Posts: 805

Rep: Reputation: 32
if you're refering to 'advanced format', it has been used on many modern drives, not just 4Tb. but, I doubt you can turn off that 512 byte emulation.
it would be nice though, because of 2Tb limit and other things.
 
Old 09-16-2013, 03:39 AM   #12
billvance
Member
 
Registered: Sep 2013
Location: Bothell, Washington USA
Distribution: Kubuntu 12.04
Posts: 57

Original Poster
Rep: Reputation: Disabled
Just for the record, here's how I found what
size blocks my hard drive uses:

blockdev --getbsz /dev/sdb5
4096

So it has 4K blocks. Took a while to dig up
what would work, but it does it quickly.

Bill
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Set custom block sizes (512-4096 bytes) in Gparted? permissive Linux - General 5 08-23-2013 05:27 AM
fsck.ext3 keeps fails with "Error reading block" short read at same block jpletka Linux - Server 2 06-10-2010 03:46 AM
define different physical sizes on Multiple Monitors of different sizes MasterC Linux - Desktop 2 03-18-2008 05:24 PM
changing block sizes on mount djgerbavore Slackware 2 05-30-2005 10:12 PM
IPTables and PPTPD :S (to block or not to block) thewonka Linux - Networking 0 03-24-2005 07:58 PM


All times are GMT -5. The time now is 08:37 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration