Blob


1 version=pmwiki-2.3.20 ordered=1 urlencoded=1
2 agent=w3m/0.5.3+git20230121
3 author=jrmu
4 charset=UTF-8
5 csum=
6 ctime=1622783087
7 host=104.167.242.140
8 name=Fdisk.Usage
9 rev=9
10 targets=Openbsd.Backup,Dmesg.Usage,Disklabel.Usage,Newfs.Usage
11 text=(:title fdisk:)%0a%0a[[https://man.openbsd.org/fdisk|fdisk(8)]] is a disk partitioning%0autility. It is called when installing OpenBSD to change the default%0apartition layout of the disk. It can also be called manually after%0ainstallation when you want to add a new disk.%0a%0a'''WARNING''': '''BE CAREFUL!''' fdisk can cause irreversible data%0aloss. We recommend you [[openbsd/backup|backup]] your files before%0aattempting to run these commands. You should also double check every%0acommand to make sure you have made no typos or mistakes. A single typo%0acould destroy your data forever!%0a%0a'''NOTE''': This guide is '''no''' substitute for reading the%0a[[https://www.openbsd.org/faq/|OpenBSD FAQ]]. In particular, you may%0awant to read the section on%0a[[https://www.openbsd.org/faq/faq14.html|Disk Setup]].%0a%0a!! Whole Disk for OpenBSD%0a%0aIf you want to set aside an entire disk for OpenBSD, it's relatively%0aeasy. First, find the correct disk using [[dmesg/usage|dmesg]]:%0a%0a[@%0a$ dmesg | grep -E '(wd|sd)[0-9]'%0asd0 at scsibus1 targ 0 lun 0: %3cVirtIO, Block Device, >%0asd0: 20480MB, 512 bytes/sector, 41943040 sectors%0asd1 at scsibus2 targ 0 lun 0: %3cVirtIO, Block Device, >%0asd1: 256000MB, 512 bytes/sector, 524288000 sectors%0aroot on sd0a (5f6d0b5c9f65249d.a) swap on sd0b dump on sd0b%0a@]%0a%0a'''NOTE''': On OpenBSD, there are two disk drivers: [[https://man.openbsd.org/wd|wd]] and [[https://man.openbsd.org/sd|sd]]. @@wd@@ is an IDE-like disk, and @@sd@@ is a SCSI-like disk (including USB disks). Here, I have two SCSI-like disks.%0a%0aIn this case, the disk I want to add is @@sd1@@, a [[Vmctl/Disk|new%0adisk]] for additional storage. Here is the simple way to create fdisk partitions (Master Boot Record partitions):%0a%0a[@%0a$ doas fdisk -iy sd1%0a@]%0a%0aI can then proceed to use [[Disklabel/Usage|disklabel]], followed by%0a[[newfs/usage|newfs]].%0a%0a!! Interactive fdisk%0a%0aInstead of running the above command, it is possible to edit the fdisk partitions interactively:%0a%0a[@%0a$ doas fdisk -e sd1%0aEnter 'help' for information%0a@]%0a%0aType @@help@@ to get help, @@manual@@ to read the [[https://man.openbsd.org/fdisk|fdisk]] man page, and @@print@@ to view the partitions:%0a%0a[@%0asd1: 1> help%0a help Command help list%0a manual Show entire OpenBSD man page for fdisk%0a reinit Re-initialize loaded MBR (to defaults)%0a setpid Set the identifier of a given table entry%0a disk Edit current drive stats%0a edit Edit given table entry%0a flag Flag given table entry as bootable%0a update Update machine code in loaded MBR%0a select Select extended partition table entry MBR%0a swap Swap two partition entries%0a print Print loaded MBR partition table%0a write Write loaded MBR to disk%0a exit Exit edit of current MBR, without saving changes%0a quit Quit edit of current MBR, saving current changes%0a abort Abort program without saving current changes%0asd1: 1> print%0aDisk: sd1 geometry: 66837/255/63 [1073741824 Sectors]%0aOffset: 0 Signature: 0x0%0a Starting Ending LBA Info:%0a #: id C H S - C H S [ start: size ]%0a-------------------------------------------------------------------------------%0a 0: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused %0a 1: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused %0a 2: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused %0a 3: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused %0a@]%0a%0aThis disk sd1 is completely blank, so it is probably safe to edit the fdisk partitions and format the disk.%0a%0a'''WARNING''': If the disk already has existing partitions, double check to make sure you are not wiping out important data!%0a%0aFirst, let's reinit. This should automatically create an fdisk partition on the last partition, partition 3, for OpenBSD and use all available space. It will also initialize this as the boot block.%0a%0a[@%0asd1: 1> reinit%0aDisk: sd1 geometry: 66837/255/63 [1073741824 Sectors]%0aOffset: 0 Signature: 0xAA55%0a Starting Ending LBA Info:%0a #: id C H S - C H S [ start: size ]%0a-------------------------------------------------------------------------------%0a 0: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused %0a 1: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused %0a 2: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused %0a*3: A6 0 1 2 - 66836 254 63 [ 64: 1073736341 ] OpenBSD %0aUse 'write' to update disk.%0a@]%0a%0aNotice that the Signature changes from 0x0 to 0xAA55, and partition #3 is now set to id A6 (the OpenBSD partition type).%0a%0aThis can also be done manually by using the edit command on partition 3:%0a%0a[@%0asd1: 1> edit 3%0a Starting Ending LBA Info:%0a #: id C H S - C H S [ start: size ]%0a-------------------------------------------------------------------------------%0a 3: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused %0aPartition id ('0' to disable) [01 - FF]: [0] (? for help) A6%0aDo you wish to edit in CHS mode? [n] y%0aBIOS Starting cylinder [0 - 66836]: [0] %0aBIOS Starting head [0 - 254]: [1] %0aBIOS Starting sector [1 - 63]: [2] %0aBIOS Ending cylinder [0 - 66836]: [0] 66836%0aBIOS Ending head [0 - 254]: [0] 254%0aBIOS Ending sector [1 - 63]: [1] 63%0a@]%0a%0aWe need to edit in [[https://en.wikipedia.org/wiki/Cylinder-head-sector|Cylinder-Head-Sector]] ('''CHS''') mode. To use the full space of the disk, you will want to choose the lowest numbers in the range for the starting cylinder, head, and sector; and the highest possible numbers for the ending cylinder, head, and sector.%0a%0aWe now write to disk:%0a%0a[@%0asd1*: 1> write%0aWriting MBR at offset 0.%0a@]%0a%0aWe'll @@print G@@ to see everything in gigabytes:%0a%0a[@%0asd1: 1> print G%0aDisk: sd1 geometry: 66837/255/63 [1073741824 Sectors]%0aOffset: 0 Signature: 0xAA55%0a Starting Ending LBA Info:%0a #: id C H S - C H S [ start: size ]%0a-------------------------------------------------------------------------------%0a 0: 00 0 0 0 - 0 0 0 [ 0: 0G] unused %0a 1: 00 0 0 0 - 0 0 0 [ 0: 0G] unused %0a 2: 00 0 0 0 - 0 0 0 [ 0: 0G] unused %0a*3: A6 0 1 2 - 66836 254 63 [ 64: 512G] OpenBSD %0a@]%0a%0aIf everything looks good, %0a%0a[@%0asd1: 1> quit%0a@]%0a%0aWe can now proceed to use [[Disklabel/Usage|disklabel]], followed by%0a[[newfs/usage|newfs]].%0a
12 time=1712794198
13 title=fdisk
14 author:1712794198=jrmu
15 diff:1712794198:1712794164:=154,156d153%0a%3c %0a%3c We can now proceed to use [[Disklabel/Usage|disklabel]], followed by%0a%3c [[newfs/usage|newfs]].%0a
16 host:1712794198=104.167.242.140
17 author:1712794164=jrmu
18 diff:1712794164:1712793883:=87c87%0a%3c '''WARNING''': If the disk already has existing partitions, double check to make sure you are not wiping out important data!%0a---%0a> '''WARNING''': If the disk already has existing partitions, double check to make sure you are not wiping out data!%0a
19 host:1712794164=104.167.242.140
20 author:1712793883=jrmu
21 diff:1712793883:1712793284:=33,35c33,35%0a%3c '''NOTE''': On OpenBSD, there are two disk drivers: [[https://man.openbsd.org/wd|wd]] and [[https://man.openbsd.org/sd|sd]]. @@wd@@ is an IDE-like disk, and @@sd@@ is a SCSI-like disk (including USB disks). Here, I have two SCSI-like disks.%0a%3c %0a%3c In this case, the disk I want to add is @@sd1@@, a [[Vmctl/Disk|new%0a---%0a> '''NOTE''': On OpenBSD, there are two disk drivers: [[https://man.openbsd.org/wd|wd]] and [[https://man.openbsd.org/sd|sd]]. wd is an IDE-like disk, and sd is a SCSI-like disk (including USB disks). Here, I have two SCSI-like disks.%0a> %0a> In this case, the disk I want to add is sd1, a [[Vmctl/Disk|new%0a74c74%0a%3c Disk: sd1 geometry: 66837/255/63 [1073741824 Sectors]%0a---%0a> Disk: sd0 geometry: 66837/255/63 [1073741824 Sectors]%0a85,86c85,86%0a%3c This disk sd1 is completely blank, so it is probably safe to edit the fdisk partitions and format the disk.%0a%3c %0a---%0a> This disk sd0 is completely blank, so it is probably safe to edit the fdisk partitions and format the disk.%0a> %0a92,93c92,93%0a%3c sd1: 1> reinit%0a%3c Disk: sd1 geometry: 66837/255/63 [1073741824 Sectors]%0a---%0a> sd0: 1> reinit%0a> Disk: sd0 geometry: 66837/255/63 [1073741824 Sectors]%0a110c110%0a%3c sd1: 1> edit 3%0a---%0a> sd0: 1> edit 3%0a130c130%0a%3c sd1*: 1> write%0a---%0a> sd0*: 1> write%0a137,138c137,138%0a%3c sd1: 1> print G%0a%3c Disk: sd1 geometry: 66837/255/63 [1073741824 Sectors]%0a---%0a> sd0: 1> print G%0a> Disk: sd0 geometry: 66837/255/63 [1073741824 Sectors]%0a
22 host:1712793883=104.167.242.140
23 author:1712793284=jrmu
24 diff:1712793284:1712793009:=5,7c5,6%0a%3c partition layout of the disk. It can also be called manually after%0a%3c installation when you want to add a new disk.%0a%3c %0a---%0a> partition layout of the disk. It can also be called manually later on if you want to add a new disk.%0a> %0a33,37c32,34%0a%3c '''NOTE''': On OpenBSD, there are two disk drivers: [[https://man.openbsd.org/wd|wd]] and [[https://man.openbsd.org/sd|sd]]. wd is an IDE-like disk, and sd is a SCSI-like disk (including USB disks). Here, I have two SCSI-like disks.%0a%3c %0a%3c In this case, the disk I want to add is sd1, a [[Vmctl/Disk|new%0a%3c disk]] for additional storage. Here is the simple way to create fdisk partitions (Master Boot Record partitions):%0a%3c %0a---%0a> In this case, the disk I want to format is sd1, a [[Vmctl/Disk|new%0a> disk]] I added for additional storage:%0a> %0a45,48c42,43%0a%3c !! Interactive fdisk%0a%3c %0a%3c Instead of running the above command, it is possible to edit the fdisk partitions interactively:%0a%3c %0a---%0a> On OpenBSD, there are two disk drivers: [[https://man.openbsd.org/wd|wd]] and [[https://man.openbsd.org/sd|sd]]. wd is an IDE-like disk, and sd is a SCSI-like disk (including USB disks). To list all your available disks:%0a> %0a50,51c45,49%0a%3c $ doas fdisk -e sd1%0a%3c Enter 'help' for information%0a---%0a> $ dmesg | grep -E '(sd[0-9]|wd[0-9])'%0a> sd0 at scsibus2 targ 0 lun 0: %3cBUYVM, SLAB, 2.5+> serial.BUYVM_SLAB_VOLUME-4047%0a> sd0: 524288MB, 512 bytes/sector, 1073741824 sectors, thin%0a> sd1 at scsibus3 targ 0 lun 0: %3cVirtIO, Block Device, >%0a> sd1: 40960MB, 512 bytes/sector, 83886080 sectors%0a54,55c52,63%0a%3c Type @@help@@ to get help, @@manual@@ to read the [[https://man.openbsd.org/fdisk|fdisk]] man page, and @@print@@ to view the partitions:%0a%3c %0a---%0a> In this example, our server has two SCSI-like disks (a BuyVM slab and a VirtIO block device). In this case, the VirtIO block device is the hard disk the operating system is installed on, and the slab is extra storage we purchased. The disks are numbered by the order in which they are detected at boot time. The first SCSI-like disk will be sd0, the second sd1, and so forth.%0a> %0a> The first disk @@sd0@@ can store around 500GB of data, the second disk @@sd1@@ can store around 40GB.%0a> %0a> We will now add the new space from @@sd0@@ by creating a new partition for the disk, formatting it, and then mounting it to the filesystem.%0a> %0a> '''WARNING''': Double check your commands and make certain you are editing the correct disk. You must substitute the disk in the example for the one you actually want to format. Typing the wrong disk by accident could destroy all your data forever.%0a> %0a> !! Creating a New Partition%0a> %0a> The first task is to use fdisk to create fdisk partitions (Master Boot Record partitions). Now, the easy way is to run this one command:%0a> %0a57c65,78%0a%3c sd1: 1> help%0a---%0a> $ doas fdisk -iy sd0%0a> @]%0a> %0a> This automatically creates an fdisk partition that spans the entire disk. That said, you can (and should!) learn how to edit this interactively, to fine tune your options.%0a> %0a> [@%0a> $ doas fdisk -e sd0%0a> Enter 'help' for information%0a> @]%0a> %0a> Type @@help@@ to get help, @@manual@@ to read the [[https://man.openbsd.org/fdisk|fdisk]] man page, and @@print@@ to view the partitions:%0a> %0a> [@%0a> sd0: 1> help%0a73c94%0a%3c sd1: 1> print%0a---%0a> sd0: 1> print%0a152c173%0a%3c sd1: 1> quit%0a---%0a> sd0: 1> quit%0a
25 host:1712793284=104.167.242.140
26 author:1712793009=jrmu
27 diff:1712793009:1712792984:=
28 host:1712793009=104.167.242.140
29 author:1712792984=jrmu
30 diff:1712792984:1712792496:=7,17d6%0a%3c '''WARNING''': '''BE CAREFUL!''' fdisk can cause irreversible data%0a%3c loss. We recommend you [[openbsd/backup|backup]] your files before%0a%3c attempting to run these commands. You should also double check every%0a%3c command to make sure you have made no typos or mistakes. A single typo%0a%3c could destroy your data forever!%0a%3c %0a%3c '''NOTE''': This guide is '''no''' substitute for reading the%0a%3c [[https://www.openbsd.org/faq/|OpenBSD FAQ]]. In particular, you may%0a%3c want to read the section on%0a%3c [[https://www.openbsd.org/faq/faq14.html|Disk Setup]].%0a%3c %0a20,22c9,10%0a%3c If you want to set aside an entire disk for OpenBSD, it's relatively%0a%3c easy. First, find the correct disk using [[dmesg/usage|dmesg]]:%0a%3c %0a---%0a> If you want to set aside a whole disk for OpenBSD, it's relatively easy. First, find the correct disk using [[dmesg/usage|dmesg]]:%0a> %0a32,34c20,21%0a%3c In this case, the disk I want to format is sd1, a [[Vmctl/Disk|new%0a%3c disk]] I added for additional storage:%0a%3c %0a---%0a> In this case, the disk I want to format is sd1, a [[Vmctl/Disk|new disk]] I added for additional storage:%0a> %0a39,174c26%0a%3c I can then proceed to use [[Disklabel/Usage|disklabel]], followed by%0a%3c [[newfs/usage|newfs]].%0a%3c %0a%3c On OpenBSD, there are two disk drivers: [[https://man.openbsd.org/wd|wd]] and [[https://man.openbsd.org/sd|sd]]. wd is an IDE-like disk, and sd is a SCSI-like disk (including USB disks). To list all your available disks:%0a%3c %0a%3c [@%0a%3c $ dmesg | grep -E '(sd[0-9]|wd[0-9])'%0a%3c sd0 at scsibus2 targ 0 lun 0: %3cBUYVM, SLAB, 2.5+> serial.BUYVM_SLAB_VOLUME-4047%0a%3c sd0: 524288MB, 512 bytes/sector, 1073741824 sectors, thin%0a%3c sd1 at scsibus3 targ 0 lun 0: %3cVirtIO, Block Device, >%0a%3c sd1: 40960MB, 512 bytes/sector, 83886080 sectors%0a%3c @]%0a%3c %0a%3c In this example, our server has two SCSI-like disks (a BuyVM slab and a VirtIO block device). In this case, the VirtIO block device is the hard disk the operating system is installed on, and the slab is extra storage we purchased. The disks are numbered by the order in which they are detected at boot time. The first SCSI-like disk will be sd0, the second sd1, and so forth.%0a%3c %0a%3c The first disk @@sd0@@ can store around 500GB of data, the second disk @@sd1@@ can store around 40GB.%0a%3c %0a%3c We will now add the new space from @@sd0@@ by creating a new partition for the disk, formatting it, and then mounting it to the filesystem.%0a%3c %0a%3c '''WARNING''': Double check your commands and make certain you are editing the correct disk. You must substitute the disk in the example for the one you actually want to format. Typing the wrong disk by accident could destroy all your data forever.%0a%3c %0a%3c !! Creating a New Partition%0a%3c %0a%3c The first task is to use fdisk to create fdisk partitions (Master Boot Record partitions). Now, the easy way is to run this one command:%0a%3c %0a%3c [@%0a%3c $ doas fdisk -iy sd0%0a%3c @]%0a%3c %0a%3c This automatically creates an fdisk partition that spans the entire disk. That said, you can (and should!) learn how to edit this interactively, to fine tune your options.%0a%3c %0a%3c [@%0a%3c $ doas fdisk -e sd0%0a%3c Enter 'help' for information%0a%3c @]%0a%3c %0a%3c Type @@help@@ to get help, @@manual@@ to read the [[https://man.openbsd.org/fdisk|fdisk]] man page, and @@print@@ to view the partitions:%0a%3c %0a%3c [@%0a%3c sd0: 1> help%0a%3c help Command help list%0a%3c manual Show entire OpenBSD man page for fdisk%0a%3c reinit Re-initialize loaded MBR (to defaults)%0a%3c setpid Set the identifier of a given table entry%0a%3c disk Edit current drive stats%0a%3c edit Edit given table entry%0a%3c flag Flag given table entry as bootable%0a%3c update Update machine code in loaded MBR%0a%3c select Select extended partition table entry MBR%0a%3c swap Swap two partition entries%0a%3c print Print loaded MBR partition table%0a%3c write Write loaded MBR to disk%0a%3c exit Exit edit of current MBR, without saving changes%0a%3c quit Quit edit of current MBR, saving current changes%0a%3c abort Abort program without saving current changes%0a%3c sd0: 1> print%0a%3c Disk: sd0 geometry: 66837/255/63 [1073741824 Sectors]%0a%3c Offset: 0 Signature: 0x0%0a%3c Starting Ending LBA Info:%0a%3c #: id C H S - C H S [ start: size ]%0a%3c -------------------------------------------------------------------------------%0a%3c 0: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused %0a%3c 1: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused %0a%3c 2: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused %0a%3c 3: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused %0a%3c @]%0a%3c %0a%3c This disk sd0 is completely blank, so it is probably safe to edit the fdisk partitions and format the disk.%0a%3c %0a%3c '''WARNING''': If the disk already has existing partitions, double check to make sure you are not wiping out data!%0a%3c %0a%3c First, let's reinit. This should automatically create an fdisk partition on the last partition, partition 3, for OpenBSD and use all available space. It will also initialize this as the boot block.%0a%3c %0a%3c [@%0a%3c sd0: 1> reinit%0a%3c Disk: sd0 geometry: 66837/255/63 [1073741824 Sectors]%0a%3c Offset: 0 Signature: 0xAA55%0a%3c Starting Ending LBA Info:%0a%3c #: id C H S - C H S [ start: size ]%0a%3c -------------------------------------------------------------------------------%0a%3c 0: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused %0a%3c 1: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused %0a%3c 2: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused %0a%3c *3: A6 0 1 2 - 66836 254 63 [ 64: 1073736341 ] OpenBSD %0a%3c Use 'write' to update disk.%0a%3c @]%0a%3c %0a%3c Notice that the Signature changes from 0x0 to 0xAA55, and partition #3 is now set to id A6 (the OpenBSD partition type).%0a%3c %0a%3c This can also be done manually by using the edit command on partition 3:%0a%3c %0a%3c [@%0a%3c sd0: 1> edit 3%0a%3c Starting Ending LBA Info:%0a%3c #: id C H S - C H S [ start: size ]%0a%3c -------------------------------------------------------------------------------%0a%3c 3: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused %0a%3c Partition id ('0' to disable) [01 - FF]: [0] (? for help) A6%0a%3c Do you wish to edit in CHS mode? [n] y%0a%3c BIOS Starting cylinder [0 - 66836]: [0] %0a%3c BIOS Starting head [0 - 254]: [1] %0a%3c BIOS Starting sector [1 - 63]: [2] %0a%3c BIOS Ending cylinder [0 - 66836]: [0] 66836%0a%3c BIOS Ending head [0 - 254]: [0] 254%0a%3c BIOS Ending sector [1 - 63]: [1] 63%0a%3c @]%0a%3c %0a%3c We need to edit in [[https://en.wikipedia.org/wiki/Cylinder-head-sector|Cylinder-Head-Sector]] ('''CHS''') mode. To use the full space of the disk, you will want to choose the lowest numbers in the range for the starting cylinder, head, and sector; and the highest possible numbers for the ending cylinder, head, and sector.%0a%3c %0a%3c We now write to disk:%0a%3c %0a%3c [@%0a%3c sd0*: 1> write%0a%3c Writing MBR at offset 0.%0a%3c @]%0a%3c %0a%3c We'll @@print G@@ to see everything in gigabytes:%0a%3c %0a%3c [@%0a%3c sd0: 1> print G%0a%3c Disk: sd0 geometry: 66837/255/63 [1073741824 Sectors]%0a%3c Offset: 0 Signature: 0xAA55%0a%3c Starting Ending LBA Info:%0a%3c #: id C H S - C H S [ start: size ]%0a%3c -------------------------------------------------------------------------------%0a%3c 0: 00 0 0 0 - 0 0 0 [ 0: 0G] unused %0a%3c 1: 00 0 0 0 - 0 0 0 [ 0: 0G] unused %0a%3c 2: 00 0 0 0 - 0 0 0 [ 0: 0G] unused %0a%3c *3: A6 0 1 2 - 66836 254 63 [ 64: 512G] OpenBSD %0a%3c @]%0a%3c %0a%3c If everything looks good, %0a%3c %0a%3c [@%0a%3c sd0: 1> quit%0a%3c @]%0a---%0a> I can then proceed to use [[Disklabel/Usage|disklabel]], then [[newfs/usage|newfs]].%0a
31 host:1712792984=104.167.242.140
32 author:1712792496=jrmu
33 diff:1712792496:1712792064:=20,26c20,24%0a%3c In this case, the disk I want to format is sd1, a [[Vmctl/Disk|new disk]] I added for additional storage:%0a%3c %0a%3c [@%0a%3c $ doas fdisk -iy sd1%0a%3c @]%0a%3c %0a%3c I can then proceed to use [[Disklabel/Usage|disklabel]], then [[newfs/usage|newfs]].%0a---%0a> In this case, the disk I want to format%0a> %0a> $ doas fdisk -iy sd0%0a> %0a> Consult the man pages for fdisk(8), [[https://man.openbsd.org/disklabel|disklabel(8)]], and [[https://man.openbsd.org/fstab|fstab(5)]]. If you are familiar with Linux, read these twice, because they work a little differently in OpenBSD.%0a
34 host:1712792496=104.167.242.140
35 author:1712792064=jrmu
36 diff:1712792064:1622783087:=3,24c3,7%0a%3c [[https://man.openbsd.org/fdisk|fdisk(8)]] is a disk partitioning%0a%3c utility. It is called when installing OpenBSD to change the default%0a%3c partition layout of the disk. It can also be called manually later on if you want to add a new disk.%0a%3c %0a%3c !! Whole Disk for OpenBSD%0a%3c %0a%3c If you want to set aside a whole disk for OpenBSD, it's relatively easy. First, find the correct disk using [[dmesg/usage|dmesg]]:%0a%3c %0a%3c [@%0a%3c $ dmesg | grep -E '(wd|sd)[0-9]'%0a%3c sd0 at scsibus1 targ 0 lun 0: %3cVirtIO, Block Device, >%0a%3c sd0: 20480MB, 512 bytes/sector, 41943040 sectors%0a%3c sd1 at scsibus2 targ 0 lun 0: %3cVirtIO, Block Device, >%0a%3c sd1: 256000MB, 512 bytes/sector, 524288000 sectors%0a%3c root on sd0a (5f6d0b5c9f65249d.a) swap on sd0b dump on sd0b%0a%3c @]%0a%3c %0a%3c In this case, the disk I want to format%0a%3c %0a%3c $ doas fdisk -iy sd0%0a%3c %0a%3c Consult the man pages for fdisk(8), [[https://man.openbsd.org/disklabel|disklabel(8)]], and [[https://man.openbsd.org/fstab|fstab(5)]]. If you are familiar with Linux, read these twice, because they work a little differently in OpenBSD.%0a---%0a> [[https://man.openbsd.org/fdisk|fdisk(8)]] is a disk partitioning utility. It is optionally used when installing OpenBSD to change the default partition layout of the disk.%0a> %0a> !!Usage%0a> %0a> Consult the man pages for fdisk(8), [[https://man.openbsd.org/disklabel|disklabel(8)]], and [[https://man.openbsd.org/fstab|fstab(5)]]. If you are familiar with Linux, read these twice, because they work a little differently in OpenBSD.%0a\ No newline at end of file%0a
37 host:1712792064=104.167.242.140
38 author:1622783087=jrmu
39 diff:1622783087:1622783087:=1,7d0%0a%3c (:title fdisk:)%0a%3c %0a%3c [[https://man.openbsd.org/fdisk|fdisk(8)]] is a disk partitioning utility. It is optionally used when installing OpenBSD to change the default partition layout of the disk.%0a%3c %0a%3c !!Usage%0a%3c %0a%3c Consult the man pages for fdisk(8), [[https://man.openbsd.org/disklabel|disklabel(8)]], and [[https://man.openbsd.org/fstab|fstab(5)]]. If you are familiar with Linux, read these twice, because they work a little differently in OpenBSD.%0a\ No newline at end of file%0a
40 host:1622783087=125.231.28.9