1 |
On Friday 07 Aug 2015 00:23:35 wabenbau@×××××.com wrote: |
2 |
> Mick <michaelkintzios@×××××.com> wrote: |
3 |
> > I was wondering similar questions regarding a 32G flash card I have. |
4 |
> > Using fdisk to partition it the starting sector was automatically |
5 |
> > aligned with 2048 as it fdisk has been improved to deal with 4KB |
6 |
> > sector drives. |
7 |
> > |
8 |
> > However, formatting it with mkfs.vfat I was none the wise if I should |
9 |
> > use the '-s sectors-per-cluster' option or what to set it at. |
10 |
> |
11 |
> For the SD Cards of my Android devices I use |
12 |
> |
13 |
> mkfs.vfat -F32 -s64 |
14 |
> |
15 |
> This always gave me good performance. |
16 |
> |
17 |
> > Furthermore, how can I read the current cluster size off the flash |
18 |
> > card? Is this appropriate? |
19 |
> > |
20 |
> > blockdev --getbsz /dev/sdb |
21 |
> > 4096 |
22 |
> |
23 |
> This gives you the physical blocksize of the device. |
24 |
> |
25 |
> If you wanna know the cluster size, that means the blocksize of your |
26 |
> filesystem, you can use mtools. First configure /etc/mtools/mtools.conf |
27 |
> and set a drive letter for your SD Card, e.g. |
28 |
> |
29 |
> drive c: file="/dev/sde1" |
30 |
> |
31 |
> then use |
32 |
> |
33 |
> minfo C: |
34 |
> |
35 |
> to query a lot of information about the filesystem. Beside some other infos |
36 |
> you will get for example: |
37 |
> |
38 |
> sector size: 512 bytes |
39 |
> cluster size: 8 sectors |
40 |
> |
41 |
> This means cluster size is 4096 Bytes. |
42 |
> |
43 |
> -- |
44 |
> Regards |
45 |
> wabe |
46 |
|
47 |
Thanks! |
48 |
|
49 |
I've used minfo and this is what it showed: |
50 |
|
51 |
# minfo d: |
52 |
device information: |
53 |
=================== |
54 |
filename="/dev/sdb1" |
55 |
sectors per track: 32 |
56 |
heads: 64 |
57 |
cylinders: 30399 |
58 |
|
59 |
mformat command line: mformat -t 30399 -h 64 -s 32 -H 2048 d: |
60 |
|
61 |
bootsector information |
62 |
====================== |
63 |
banner:"mkfs.fat" |
64 |
sector size: 512 bytes |
65 |
cluster size: 32 sectors |
66 |
reserved (boot) sectors: 32 |
67 |
fats: 2 |
68 |
max available root directory slots: 0 |
69 |
small size: 0 sectors |
70 |
media descriptor byte: 0xf8 |
71 |
sectors per fat: 0 |
72 |
sectors per track: 32 |
73 |
heads: 64 |
74 |
hidden sectors: 2048 |
75 |
big size: 62257152 sectors |
76 |
physical drive id: 0x80 |
77 |
reserved=0x1 |
78 |
dos4=0x29 |
79 |
serial number: 870C0C43 |
80 |
disk label="VERBATIM32G" |
81 |
disk type="FAT32 " |
82 |
Big fatlen=15193 |
83 |
Extended flags=0x0000 |
84 |
FS version=0x0000 |
85 |
rootCluster=2 |
86 |
infoSector location=1 |
87 |
backup boot sector=6 |
88 |
|
89 |
Infosector: |
90 |
signature=0x41615252 |
91 |
free clusters=516445 |
92 |
last allocated cluster=1448265 |
93 |
|
94 |
|
95 |
So, with: |
96 |
|
97 |
sector size: 512 bytes |
98 |
cluster size: 32 sectors |
99 |
|
100 |
I get a cluster of 16,384 bytes. This was created automagically, when I ran: |
101 |
|
102 |
mkfs.vfat -c -n "Verbatim Flash" /dev/sdb1 |
103 |
|
104 |
Without knowing the specific AU/RU as Fernando explained, should it be |
105 |
smaller/bigger, or should I leave well alone. |
106 |
|
107 |
-- |
108 |
Regards, |
109 |
Mick |