no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | fdisk [2013/08/22 18:04] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== fdisk ====== | ||
+ | * [[Filesystems]] | ||
+ | * [[NetBSD]] | ||
+ | * [[OpenBSD]] | ||
+ | * [[disklabel]] | ||
+ | * [[newfs]] | ||
+ | * [[raidctl]] | ||
+ | * [[softraid]] | ||
+ | * [[sysctl]] | ||
+ | |||
+ | * [[http:// | ||
+ | ==== Linux and NetBSD Partitioning ==== | ||
+ | |||
+ | Partitioning drives in NetBSD is different than Linux. | ||
+ | |||
+ | In NetBSD, one partition is created from the original four that are found with an MBR table, then disklabel is used to create it's own form of partitions called slices within the MBR partition. | ||
+ | |||
+ | In other words, running '' | ||
+ | |||
+ | === netbsd-vm Example === | ||
+ | |||
+ | == Linux == | ||
+ | |||
+ | The drives here are IDE drives, so they show up as '' | ||
+ | |||
+ | Here's what '' | ||
+ | |||
+ | < | ||
+ | Disk /dev/sda: 12.9 GB, 12884901888 bytes, 25165824 sectors | ||
+ | Units = sectors of 1 * 512 = 512 bytes | ||
+ | Sector size (logical/ | ||
+ | I/O size (minimum/ | ||
+ | Disk identifier: 0x00000000 | ||
+ | |||
+ | | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | == NetBSD == | ||
+ | |||
+ | '' | ||
+ | |||
+ | < | ||
+ | Disk: /dev/rwd0d | ||
+ | NetBSD disklabel disk geometry: | ||
+ | cylinders: 24966, heads: 16, sectors/ | ||
+ | total sectors: 25165824 | ||
+ | |||
+ | BIOS disk geometry: | ||
+ | cylinders: 1024, heads: 255, sectors/ | ||
+ | total sectors: 25165824 | ||
+ | |||
+ | Partitions aligned to 2048 sector boundaries, offset 2048 | ||
+ | |||
+ | Partition table: | ||
+ | 0: NetBSD (sysid 169) | ||
+ | start 2048, size 25163776 (12287 MB, Cyls 0-1566/ | ||
+ | 1: < | ||
+ | 2: < | ||
+ | 3: < | ||
+ | Bootselector disabled. | ||
+ | First active partition: 0 | ||
+ | </ | ||
+ | ==== Format a NetBSD Hard Drive ==== | ||
+ | |||
+ | There are a lot of different device names for the same thing, so to keep things simple, just use '' | ||
+ | |||
+ | Display status of a disk: | ||
+ | |||
+ | < | ||
+ | fdisk sd0 | ||
+ | </ | ||
+ | |||
+ | == Initialization == | ||
+ | |||
+ | Use '' | ||
+ | |||
+ | Do this before disklabel or newfs: | ||
+ | |||
+ | < | ||
+ | fdisk -u sd0 | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | fdisk: primary partition table invalid, no magic in sector 0 | ||
+ | Disk: /dev/sd1 | ||
+ | NetBSD disklabel disk geometry: | ||
+ | cylinders: 224, heads: 255, sectors/ | ||
+ | total sectors: 3604865 | ||
+ | |||
+ | BIOS disk geometry: | ||
+ | cylinders: 1023, heads: 255, sectors/ | ||
+ | total sectors: 1952448512 | ||
+ | |||
+ | Partitions aligned to 16065 sector boundaries, offset 63 | ||
+ | |||
+ | Do you want to change our idea of what BIOS thinks? [n] n | ||
+ | |||
+ | Partition table: | ||
+ | 0: < | ||
+ | 1: < | ||
+ | 2: < | ||
+ | 3: < | ||
+ | Bootselector disabled. | ||
+ | No active partition. | ||
+ | Which partition do you want to change?: [none] 0 | ||
+ | The data for partition 0 is: | ||
+ | < | ||
+ | sysid: [0..255 default: 169] | ||
+ | start: [0..224cyl default: 63, 0cyl, 0MB] | ||
+ | size: [0..224cyl default: 3604802, 224cyl, 1760MB] | ||
+ | bootmenu: [] | ||
+ | |||
+ | Partition table: | ||
+ | 0: NetBSD (sysid 169) | ||
+ | start 63, size 3604802 (1760 MB, Cyls 0-224/ | ||
+ | PBR is not bootable: All bytes are identical (0x00) | ||
+ | 1: < | ||
+ | 2: < | ||
+ | 3: < | ||
+ | Bootselector disabled. | ||
+ | No active partition. | ||
+ | Which partition do you want to change?: [none] | ||
+ | |||
+ | We haven' | ||
+ | Partition table: | ||
+ | 0: NetBSD (sysid 169) | ||
+ | start 63, size 3604802 (1760 MB, Cyls 0-224/ | ||
+ | PBR is not bootable: All bytes are identical (0x00) | ||
+ | 1: < | ||
+ | 2: < | ||
+ | 3: < | ||
+ | Bootselector disabled. | ||
+ | No active partition. | ||
+ | Should we write new partition table? [n] y | ||
+ | </ | ||
+ | |||
+ | == Partition hard drive == | ||
+ | |||
+ | Edit the NetBSD partitions (slices): | ||
+ | |||
+ | < | ||
+ | disklabel -i -I sd1 | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | Enter '?' | ||
+ | partition> | ||
+ | Filesystem type [?] [4.2BSD]: 4.2BSD | ||
+ | Start offset (' | ||
+ | Partition size (' | ||
+ | partition> | ||
+ | Label disk [n]? y | ||
+ | Label written | ||
+ | partition> | ||
+ | </ |