You are not logged in.

#1 2010-07-15 13:48:19

fturco
Member
Registered: 2010-07-12
Posts: 40

how to correctly create a partition and format it?

i have an usb flash drive and i'd like to create a single ext4 partition on it with parted and mke2fs. the drive has 15,644,672 sectors (512 bytes each). since the first sector (sector 0) is reserved to the mbr, i have 15,644,671 sectors left (from 1 to 15,644,671). i could create a partition here, but since the filesystem, by default, uses 4,096 bytes for each block, the number of sectors should be multiple of 4,096/512=8. this means i should use 15,644,664 sectors only. i could use 1,024 bytes blocks instead and have a partition with 15,644,670 sectors. if i remember correctly, another thing to consider is that files or directories occupies only an integer number of blocks. even a 0 byte file occupies either 1,024, 2,048 or 4,096 bytes. so the smallest possible block size seems to me the best choice. are there other rules to check?

Offline

#2 2010-07-15 14:13:42

Cyrusm
Member
From: Bozeman, MT
Registered: 2007-11-15
Posts: 1,053

Re: how to correctly create a partition and format it?

wow, you've put quite a bit of thought into this!  sounds like the smallest block size would indeed be the best choice for you, I'm not sure if there is really anything else that needs to be considered in this case really.


Hofstadter's Law:
           It always takes longer than you expect, even when you take into account Hofstadter's Law.

Offline

#3 2010-07-15 15:20:21

kaizoku
Member
Registered: 2009-01-09
Posts: 62

Re: how to correctly create a partition and format it?

Try ext2 instead, if you're worry about 1 or 2 KB. Having ext4 alone could burn 50 megs or so even without any files.

Last edited by kaizoku (2010-07-15 15:20:38)

Offline

Board footer

Powered by FluxBB