Gentoo Archives: gentoo-user

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

Replies

Subject Author
Re: [gentoo-user] [OT]: Optimal formatting a SDcard (64GB) with partions of diffent sizes and filesystems? Fernando Rodriguez <frodriguez.developer@×××××××.com>