Hitchhiker's Guide to Openbsd


- Can I use a flash memory device with OpenBSD?


Download 1.27 Mb.
Pdf ko'rish
bet228/258
Sana04.04.2023
Hajmi1.27 Mb.
#1328980
1   ...   224   225   226   227   228   229   230   231   ...   258
Bog'liq
obsd-faq49

14.17 - Can I use a flash memory device with OpenBSD?
14.17.1 - Flash memory as a portable storage device
Normally, the memory device should be recognized upon plugging it into a port of your machine. Shortly after 
inserting it, a number of messages are written to the console by the kernel. For instance, when I plug in my USB 
flash memory device, I see the following on my console: 
umass0 at uhub1 port 1 configuration 1 interface 0
umass0: LEXR PLUG DRIVE LEXR PLUG DRIVE, rev 1.10/0.01, addr 2
umass0: using SCSI over Bulk-Only
scsibus2 at umass0: 2 targets
sd0 at scsibus2 targ 1 lun 0: SCSI2 0/
direct removable
sd0: 123MB, 512 bytes/sec, 251904 sec total
These lines indicate that the 
umass(4)
(USB mass storage) driver has been attached to the memory device, and 
that it is using the SCSI system. The last two lines are the most important ones: they are saying to which device 
node the memory device has been attached, and what the total amount of storage space is. If you somehow missed 
these lines, you can still see them afterwards with the 
dmesg(1)
command. The reported CHS geometry is a rather 
fictitious one, as the flash memory is being treated like any regular SCSI disk. 
We will discuss two scenarios below. 
The device is new/empty and you want to use it with OpenBSD only
You will need to initialize a disklabel onto the device, and create at least one partition. Please read 
Using 
OpenBSD's disklabel
 and the 
disklabel(8)
manual page for details about this. 
In this example I created just one partition a in which I will place a FFS filesystem: 
http://www.openbsd.org/faq/faq14.html (28 of 34)9/4/2011 10:02:25 AM


14 - Disk Setup
newfs sd0a
Warning: inode blocks/cyl group (125) >= data blocks (62) in last
cylinder group. This implies 1984 sector(s) cannot be 
allocated.
/dev/rsd0a: 249856 sectors in 122 cylinders of 64 tracks, 32 
sectors
122.0MB in 1 cyl groups (122 c/g, 122.00MB/g, 15488 i/g)
super-block backups (for fsck -b #) at:
32,
Let's mount the filesystem we created in the a partition on 
/mnt/flashmem
. Create the mount point first if it 
does not exist. 
mkdir /mnt/flashmem
mount /dev/sd0a /mnt/flashmem

Download 1.27 Mb.

Do'stlaringiz bilan baham:
1   ...   224   225   226   227   228   229   230   231   ...   258




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling