LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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, 09:59 AM   #1
billvance
Member
 
Registered: Sep 2013
Location: Bothell, Washington USA
Distribution: Kubuntu 12.04
Posts: 60

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, 03:57 PM   #2
qrange
Senior Member
 
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian stable/testing, amd64
Posts: 1,057

Rep: Reputation: 47
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, 10:23 PM   #3
billvance
Member
 
Registered: Sep 2013
Location: Bothell, Washington USA
Distribution: Kubuntu 12.04
Posts: 60

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, 01:30 AM   #4
qrange
Senior Member
 
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian stable/testing, amd64
Posts: 1,057

Rep: Reputation: 47
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, 07:51 AM   #5
billvance
Member
 
Registered: Sep 2013
Location: Bothell, Washington USA
Distribution: Kubuntu 12.04
Posts: 60

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, 03:57 AM   #6
billvance
Member
 
Registered: Sep 2013
Location: Bothell, Washington USA
Distribution: Kubuntu 12.04
Posts: 60

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, 04:05 PM   #7
qrange
Senior Member
 
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian stable/testing, amd64
Posts: 1,057

Rep: Reputation: 47
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, 05:34 PM   #8
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
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, 03:37 AM   #9
qrange
Senior Member
 
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian stable/testing, amd64
Posts: 1,057

Rep: Reputation: 47
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, 08:21 AM   #10
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
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, 10:35 AM   #11
qrange
Senior Member
 
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian stable/testing, amd64
Posts: 1,057

Rep: Reputation: 47
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, 02:39 AM   #12
billvance
Member
 
Registered: Sep 2013
Location: Bothell, Washington USA
Distribution: Kubuntu 12.04
Posts: 60

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 04:27 AM
fsck.ext3 keeps fails with "Error reading block" short read at same block jpletka Linux - Server 2 06-10-2010 02:46 AM
define different physical sizes on Multiple Monitors of different sizes MasterC Linux - Desktop 2 03-18-2008 04:24 PM
changing block sizes on mount djgerbavore Slackware 2 05-30-2005 09:12 PM
IPTables and PPTPD :S (to block or not to block) thewonka Linux - Networking 0 03-24-2005 06:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:08 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