Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Nov 2006 13:01:38 +0100 (CET)
From:      Oliver Fromme <olli@lurza.secnetix.de>
To:        freebsd-stable@FreeBSD.ORG, jwyatt@rwsystems.net
Subject:   Re: Large msdosfs disk will not mount on RELENG_6
Message-ID:  <200611281201.kASC1cXr098034@lurza.secnetix.de>
In-Reply-To: <20061127155411.O19053@extra.rwsystems.net>

next in thread | previous in thread | raw e-mail | index | archive | help
James Wyatt wrote:
 > James Wyatt wrote:
 > > I had the same issue with a Fry's $99 special 320GB USB2/FW exernal HDD. 
 > > Since I need to mount it with WinXP, Linux, and "GENERIC" FreeBSD, I was 
 > > somewhat stuck. The way I got around it was to reformat it to ext2 and use 
 > > the Win32 ext2fs driver from SourceForge.  I considered NTFS, but the FreeBSD 
 > > support for NTFS didn't look practical to use at the time - Jy@
 > 
 > Sorry to reply to myself, but I forgot to mention that if you're doing 
 > tar/zip backups, then FAT32 may be worth the extra memory.  If you are 
 > doing file backups, then ext2 will better preserve the metadata you want 
 > like UID, GID, permissions, etc... as well as avoiding the waste of small 
 > files stored in mega-clusters.

What do you mean, mega-clusters?  You can specify the size
of the clusters when formatting the media.  For a 160 giga-
byte disk (149 GB) you can make the cluster size as small
as 1024 bytes:

# truncate -s 160000000000 testhd.img
# mdconfig -a -t vnode -f testhd.img
md1
# newfs_msdos -N -s 312500000 -c 2 /dev/md1 minimum
/dev/md1: 310077486 sectors in 155038743 FAT32 clusters (1024 bytes/cluster)

When you make the cluster size that small, the FATs (there
are two of them by default) will take up much space, of
course.  It might make sense to use only one FAT, though
(option -n).  With a larger cluster size, the FATs get
smaller so you have more space for actual data:

# newfs_msdos -N -s 312500000 -c 32 /dev/md1 minimum
/dev/md1: 312347424 sectors in 9760857 FAT32 clusters (16384 bytes/cluster)

So, changing the cluster size from 1 KB to 32 KB will shrink
each FAT by more than 0.5 GB, so you get about 1.1 GB more
space for actual file data.  That's acceptable if you intend
to store few large files (archives, multimedia files etc.).
To store a large number of small files, it is advisable to
use the smaller cluster size, of course.

That's actually quite similar (although a bit simpler) to
the selection of bsize/fsize parameters and the inode density
for UFS/FFS.

Best regards
   Oliver

-- 
Oliver Fromme,  secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing
Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.

"C is quirky, flawed, and an enormous success."
        -- Dennis M. Ritchie.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200611281201.kASC1cXr098034>