update draft post (obsd)

main
Dominic Reich 12 months ago
parent 35e68bc34e
commit 818d475845
Signed by: dominic
GPG Key ID: BC9D6AE1A3BE169A

@ -37,6 +37,74 @@ magic 19540119 (FFS2) time Thu Nov 16 21:14:34 2023
This can be helpful if you want to know, which filesystem you actually This can be helpful if you want to know, which filesystem you actually
use on your OpenBSD box. use on your OpenBSD box.
## Create a Win95 FAT32 USB stick
When you `fdisk -iy sd2` (for example) a USB stick, you usually create
one single OpenBSD partition at the 4<sup>th</sup> position. When you then
try to `newfs_msdos -F 32 -L Label sd2i` the layout is gone -- happened to
me several times until I got fed up and investigated.
I don't know why that happened, but I got my way to create USB sticks, that
actually work with other devices like my amateur radios that need those fancy
microSD cards.
Delete the first bytes on the stick:
~~~console
$ doas dd if=/dev/zero bs=1m count=1 of=/dev/rsd2c
~~~
Create the needed partition:
~~~console
$ echo -n 'edit 0\n0c\n\n2048\n*\nq\n' | doas fdisk -e sd2
~~~
A short explanation (`\n` is basically a newline; the <kbd>Enter</kbd> key):
- `edit 0\n`: edit the first entry (`fdisk -iy sd2` would edit the 4th entry)
- `0c\n`: selects **Win95 FAT32L** as file system format
- `\n`: only hit enter and use the default _[n]_
- `2048\n`: Start of the partition
- `*\n`: Special size value -- means the remainder of the disk (like `-1` on many other tools)
- `q\n`: write MBR and quits the program
This results in a partition table like this:
~~~console
$ fdisk sd2
Disk: sd2 geometry: 966/255/63 [15523840 Sectors]
Offset: 0 Signature: 0xAA55
Starting Ending LBA Info:
#: id C H S - C H S [ start: size ]
-------------------------------------------------------------------------------
0: 0C 0 32 33 - 966 80 10 [ 2048: 15521792 ] Win95 FAT32L
1: 00 0 0 0 - 0 0 0 [ 0: 0 ] Unused
2: 00 0 0 0 - 0 0 0 [ 0: 0 ] Unused
3: 00 0 0 0 - 0 0 0 [ 0: 0 ] Unused
~~~
whereas a `fdisk -iy sd2` creates a table like this:
~~~console
$ fdisk sd2
Disk: sd2 geometry: 966/255/63 [15523840 Sectors]
Offset: 0 Signature: 0xAA55
Starting Ending LBA Info:
#: id C H S - C H S [ start: size ]
-------------------------------------------------------------------------------
0: 00 0 0 0 - 0 0 0 [ 0: 0 ] Unused
1: 00 0 0 0 - 0 0 0 [ 0: 0 ] Unused
2: 00 0 0 0 - 0 0 0 [ 0: 0 ] Unused
*3: A6 0 1 2 - 966 80 10 [ 64: 15523776 ] OpenBSD
~~~
Don't forget to create the file system:
~~~console
$ doas newfs_msdos -F 32 -L 8GB_Stick sd2i
~~~
## Python ## Python
### ModuleNotFoundError ### ModuleNotFoundError

Loading…
Cancel
Save