Other Disklabel Operations


The disklabel editor is extraordinarily powerful and will let you do many things. Most of these functions should never be necessary, but are available if you need them. disklabel(8) also has many functions that are not intended for use when installing a system, but are useful when working with disks on a running system.

Expert Mode

Expert mode gives the advanced UNIX user access to some of the less-frequently tweaked options in the disklabel setup, such as the ability to change the block and fragment size. Most people do not need this, and would actually find the options simply clutter. (It's not as if disklabel isn't complicated enough already!)

Access expert mode by entering a capital X at a disklabel prompt. You won't see anything immediately, but it will make other commands produce more output and provide more options.

Changing Basic Drive Parameters

You remember all that stuff at the top of the disklabel that recorded basic physical characteristics of the drive? You can change all that. This is almost never necessary — in fact, if you think of doing it as a solution to a problem, you're probably on the completely wrong track.

If you enter "e", the disklabel program will walk you through each entry on the upper part of the disklabel. The existing values will be presented as defaults, allowing you to quickly walk through the variables until you reach the one you want to change.

 > e Changing device parameters for /dev/rwd0c: disk type: [ESDI] label name: [SAMSUNG SV2011H ] ... 

Edit this information at your own risk! You can render your disk unbootable or your partitions unusable by changing this information. Certain parts of the disklabel describe physical characteristics of the hard drive, and by changing them you are lying to your computer. Computers do not like being lied to and will go utterly ballistic if they catch you lying about basic hardware.

Deleting Existing Partitions

If you find that you have made a mistake on a partition, you might just want to blow it away. Delete partitions with the "d" command.

 > d partition to delete: [] e > 

That's it! There are no warnings, no prompts, no "are you sure?" dialog boxes, so be sure before you enter the partition letter!

Modifying Existing Partitions

You can modify an existing partition with the "m" command. Disklabel will walk you through each of the values you entered when creating the disk, offering your original values as defaults and giving you an opportunity to change them. As usual, just hit ENTER to take the defaults.

In most cases, it's easier to just delete and recreate the partitions. In this example, though, we correct a very obvious mistake with the mount point of the partition.

 > m partition to modify: [] a FS type: [4.2BSD] offset: [63] size: [1024065] mount point: [/usr] / > 

Deleting Existing Disklabels

You might screw up the disklabel badly enough that you just want to erase it all and start over. Or, you might be recycling disks from another operating system, and want to clear away any old disklabels or partitioning information. That's very easy to do with the "z" command.

 >z > 

Again, there is no chance to change your mind. Disklabel assumes that if you entered "z" you meant "z", and that's that. If you want an "Are You Sure?" prompt, get another operating system.

Online Help

You can enter a single question mark (?) to get a brief listing of disklabel commands.

If you want more detailed help, the "M" command will display the man page for disklabel(8).




Absolute Openbsd(c) Unix for the Practical Paranoid
Absolute OpenBSD: Unix for the Practical Paranoid
ISBN: 1886411999
EAN: 2147483647
Year: 2005
Pages: 298

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net