Format a USB flash drive using gpart

Polytropon freebsd at edvax.de
Sun Jul 8 09:54:55 UTC 2012


On Sun, 8 Jul 2012 09:49:30 +0200 (CEST), Wojciech Puchar wrote:
> >> Magdeburg, Germany
> >
> > I have used gpart to partition a USB flash drive into FreeBSD boot partition, root partition and swap partition.
> 
> making swap partition on USB pendrive is at least stupid. if you won't 
> swap at all - wasted space.
> If you will it would be so slow and wear USB pendrive so quickly that you 
> certainly don't want this.
> 
> 
> bsdlabel -w device
> 
> bsdabel -e  device and make "a" partition start from 0 to end, 4.2BSD
> 
> newfs it
> 
> bsdlabel -B
> 
> and put everything in one partition.
> 
> make heavy use of tmpfs, make sure noatime is put in fstab to limit writes 
> to pendrive.

An addition: You can label the a partition (e. g. /dev/da0a)
or use its UFSID in /etc/fstab, so you don't depend on the
exact device name, which in turn depends on the detection
order of mass storage which is hard to predict.

I'd like to recommend reading for details:
http://www.wonkity.com/~wblock/docs/html/disksetup.html
and
http://www.freebsd.org/doc/handbook/geom-glabel.html



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list