On 12/20/12 22:17, Indunil Jayasooriya wrote:
> HI,
> 
> I would like to know How to list available all hard disks in OpenBSD ?
> 
> If I run below 2 commands, it will give an output.
> 
> dmesg |grep wd0
> 
> fdisk wd0

If you want USEFUL, you might use:

dmesg |grep "^[sw]d"

if you care about floppies and/or cdrom drives, add a "cf" in there,
too. actually, if you want to script it, you will want to lock it down a
lot further...but that gives a nice view for humans to read.

> 
> If I install a new Hard Disk, How to get to know whether it is wd1 or
> anything eles?

well, the numbers aren't picked randomly -- see start of
http://www.openbsd.org/faq/faq14.html
If you know your computer (and read that article a few times with no
preconceptions), you can predict what the next hard disk name will be.

> In Linux, Fdisk -l show all the available hard disks. In OpenBSD what's the
> command for it?

One of linux's many non-charming displays.


Try this:

$ sysctl hw.diskcount
hw.diskcount=9

$ sysctl hw.disknames
hw.disknames=sd0:4b8432d7819c0c85,cd0:,sd1:954c43c63da1e128,sd2:d9f3f58824ed9e20,sd3:4b8432d7819c0c85,sd4:ef8be159ad6b717f,sd5:eb3971fada5612b9,sd6:e4fc87e6abfa5e45,sd7:e92e54806f9e4124

In case you are wondering...that's a six physical disks and a couple
softraid disks on a sun e250.

(do a "sysctl hw" on your machine...in many cases, you will be amazed)

Or use duids, and don't worry 'bout names.  Keep reading in the above
link. :)

Nick.

Reply via email to