@pfr
Formatting a 16GB usb to FFSv2 on NetBSD, just follow Chapter 13.
Does this make any sense to you?? If not, don't worry, it will sooner or later 🙂
pin@mybox $ sysctl hw.disknames
hw.disknames = wd0 sd0
pin@mybox $ doas dd if=/dev/zero of=/dev/sd0 bs=1m count=1
Password:
1+0 records in
1+0 records out
1048576 bytes transferred in 0.689 secs (1521880 bytes/sec)
pin@mybox $ doas fdisk -au sd0
Password:
fdisk: primary partition table invalid, no magic in sector 0
fdisk: Cannot determine the number of heads
Disk: /dev/rsd0
NetBSD disklabel disk geometry:
cylinders: 14784, heads: 64, sectors/track: 32 (2048 sectors/cylinder)
total sectors: 30277632, bytes/sector: 512
BIOS disk geometry:
cylinders: 1023, heads: 255, sectors/track: 63 (16065 sectors/cylinder)
total sectors: 30277632
Partitions aligned to 16065 sector boundaries, offset 63
Do you want to change our idea of what BIOS thinks? [n]
Partition table:
0: <UNUSED>
1: <UNUSED>
2: <UNUSED>
3: <UNUSED>
Bootselector disabled.
No active partition.
Drive serial number: 0 (0x00000000)
Which partition do you want to change?: [none] 0
The data for partition 0 is:
<UNUSED>
sysid: [0..255 default: 169]
start: [0..1885cyl default: 63, 0cyl, 0MB]
size: [0..1885cyl default: 30277569, 1885cyl, 14784MB]
bootmenu: [] (space to clear)
Partition table:
0: NetBSD (sysid 169)
start 63, size 30277569 (14784 MB, Cyls 0-1884/177/21)
PBR is not bootable: All bytes are identical (0x00)
1: <UNUSED>
2: <UNUSED>
3: <UNUSED>
Bootselector disabled.
No active partition.
Drive serial number: 0 (0x00000000)
Which partition do you want to change?: [none]
Do you want to change the active partition? [n]
We haven't written the MBR back to disk yet. This is your last chance.
Partition table:
0: NetBSD (sysid 169)
start 63, size 30277569 (14784 MB, Cyls 0-1884/177/21)
PBR is not bootable: All bytes are identical (0x00)
1: <UNUSED>
2: <UNUSED>
3: <UNUSED>
Bootselector disabled.
No active partition.
Drive serial number: 0 (0x00000000)
Should we write new partition table? [n] y
pin@mybox $ doas disklabel sd0
Password:
# /dev/rsd0:
type: SCSI
disk: DataTraveler 3.0
label: fictitious
flags: removable
bytes/sector: 512
sectors/track: 32
tracks/cylinder: 64
sectors/cylinder: 2048
cylinders: 14784
total sectors: 30277632
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0 # microseconds
track-to-track seek: 0 # microseconds
drivedata: 0
5 partitions:
# size offset fstype [fsize >
c: 30277569 63 unused 0 >
d: 30277632 0 unused 0 >
e: 30277569 63 4.2BSD 0 >
disklabel: boot block size 0
disklabel: super block size 0
pin@mybox $ doas newfs -O 2 /dev/rsd0e
Password:
/dev/rsd0e: 14784.0MB (30277568 sectors) block size 16384, fragment size 2048
using 80 cylinder groups of 184.81MB, 11828 blks, 22976 inodes.
super-block backups (for fsck_ffs -b #) at:
160, 378656, 757152, 1135648, 1514144, 1892640, 2271136, 2649632, 3028128,
..............................................................................
pin@mybox $ sysctl hw.disknames
hw.disknames = wd0 sd0
pin@mybox $ doas mount /dev/sd0e /home/pin/Extmedia/
Password:
pin@mybox $ df -h
Filesystem Size Used Avail %Cap Mounted on
/dev/wd0a 2.8G 173M 2.5G 6% /
/dev/wd0f 1.9G 96M 1.7G 5% /var
/dev/wd0e 17G 5.2G 11G 32% /usr
/dev/wd0g 3.8G 113M 3.5G 3% /home
kernfs 1.0K 1.0K 0B 100% /kern
ptyfs 1.0K 1.0K 0B 100% /dev/pts
procfs 4.0K 4.0K 0B 100% /proc
tmpfs 1.9G 0B 1.9G 0% /var/shm
/dev/sd0e 14G 2.0K 13G 0% /home/pin/Extmedia
pin@mybox $ doas umount /dev/sd0e
Password:
pin@mybox $ df -h
Filesystem Size Used Avail %Cap Mounted on
/dev/wd0a 2.8G 173M 2.5G 6% /
/dev/wd0f 1.9G 96M 1.7G 5% /var
/dev/wd0e 17G 5.2G 11G 32% /usr
/dev/wd0g 3.8G 113M 3.5G 3% /home
kernfs 1.0K 1.0K 0B 100% /kern
ptyfs 1.0K 1.0K 0B 100% /dev/pts
procfs 4.0K 4.0K 0B 100% /proc
tmpfs 1.9G 0B 1.9G 0% /var/shm
No errors on mounting or unmounting the drive. Obviously, if you want to share the drive with another machine running another OS you should not format it to FFSv2 😉
Check the output of fdisk -l
for the options of file systems and man newfs
for the flags and options before writing the partitions to disk.