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 |
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 :) |
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. |
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. |
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. |
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? |
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 |
Quote:
|
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? |
Quote:
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). |
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. |
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 |
All times are GMT -5. The time now is 08:15 PM. |