USB sticks
Sept 1, 2013 9:12:08 GMT -5
Post by Deleted on Sept 1, 2013 9:12:08 GMT -5
Files may be copied from one computer to another in a number of ways. One convenient method is to use an USB stick. With Windows there is no rigmarole of "mounting." With OpenBSD there regrettably is, and it took me some time to find out how to do it. The much-vaunted "man pages" provide some general information, but leave the user at an utter loss when it comes to practicalities. Eventually, though, I discovered the requisite information in the "OpenBSD FAQ" on their web-site.
First a word about CDs and DVDs: the method is not too difficult - evidently so since I worked it out myself. In a "root account," just type:
mount -t cd9660 -r /dev/cd0a /mnt/cdrom
and that should be that. Create the directory /mnt/cdrom beforehand, if it does not already exist.
When it comes to USB sticks, though, the method is less straightforward. What happens is this:
1) Insert the stick. On the root console, about seven lines of difficult semi-gibberish will appear, with the final line looking something like this:
sd1: 30666MB, 512 bytes/sector, 62803968 sectors
The only part of this worth noting is the first item: sd1. (It may be sd0 or something similar.) But one cannot now go ahead and simply mount sd1 as one did the cd0a in the case of the DVD above.
2) Next one must type this:
disklabel sd1 (or sd0 etc as the case may be).
It will generate a screen of information, at the end of which there will be two lines, the first of which begins:
c: ... fstype unused
and the second of which begins:
i: ... fstype MSDOS
(This is an ordinary USB stick, of the sort that one might purchase preformatted in a shop.) So, do take careful note of that little "i:" because that precisely is what you need.
3) Now you can type:
mount -t msdos /dev/sd1i /mnt/mystick
See the little "i" there in "sd1i"?
Again a directory "mystick" or similar should be created beforehand if nothing suitable already exists - the precise name is not important. I hope this information will be found useful. But it is a bit of a rigmarole, compared with the Windows method of simply sticking it in is it not.
By the way, the programme "Midnight Commander" can be useful when exploring strange directories such as these. Ordinary users may read USB sticks, but only the root user may write to them. (Excessive "security" of that kind I find very tiresome indeed.) And another very simple tip is that one may open multiple terminals (whether user or root), and quickly switch between them by typing Control-Alt-Fn where Fn is one of the function keys F1, F2, F3, F4, or F6. (I don't yet know what F5 is used for.)
First a word about CDs and DVDs: the method is not too difficult - evidently so since I worked it out myself. In a "root account," just type:
mount -t cd9660 -r /dev/cd0a /mnt/cdrom
and that should be that. Create the directory /mnt/cdrom beforehand, if it does not already exist.
When it comes to USB sticks, though, the method is less straightforward. What happens is this:
1) Insert the stick. On the root console, about seven lines of difficult semi-gibberish will appear, with the final line looking something like this:
sd1: 30666MB, 512 bytes/sector, 62803968 sectors
The only part of this worth noting is the first item: sd1. (It may be sd0 or something similar.) But one cannot now go ahead and simply mount sd1 as one did the cd0a in the case of the DVD above.
2) Next one must type this:
disklabel sd1 (or sd0 etc as the case may be).
It will generate a screen of information, at the end of which there will be two lines, the first of which begins:
c: ... fstype unused
and the second of which begins:
i: ... fstype MSDOS
(This is an ordinary USB stick, of the sort that one might purchase preformatted in a shop.) So, do take careful note of that little "i:" because that precisely is what you need.
3) Now you can type:
mount -t msdos /dev/sd1i /mnt/mystick
See the little "i" there in "sd1i"?
Again a directory "mystick" or similar should be created beforehand if nothing suitable already exists - the precise name is not important. I hope this information will be found useful. But it is a bit of a rigmarole, compared with the Windows method of simply sticking it in is it not.
By the way, the programme "Midnight Commander" can be useful when exploring strange directories such as these. Ordinary users may read USB sticks, but only the root user may write to them. (Excessive "security" of that kind I find very tiresome indeed.) And another very simple tip is that one may open multiple terminals (whether user or root), and quickly switch between them by typing Control-Alt-Fn where Fn is one of the function keys F1, F2, F3, F4, or F6. (I don't yet know what F5 is used for.)