Re: How to list available all hard disks in OpenBSD

2012-12-21 Thread Alexander Hall
Alexander Hall alexan...@beard.se wrote:

On 12/21/12 04: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 I install a new Hard Disk, How to get to know whether it is wd1 or
 anything eles?

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

$ sysctl -n hw.disknames
cd0:,sd0:3ae78cd65d4ba8f8

$ sysctl -n hw.disknames | sed 's/:[^,]*//g;s/,/ /'
cd0 sd0

and also see hotplugd(8)

...and add a 'g' at the appropriate place in the sed expression...



How to list available all hard disks in OpenBSD

2012-12-20 Thread Indunil Jayasooriya
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 I install a new Hard Disk, How to get to know whether it is wd1 or
anything eles?

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






-- 
Thank you
Indunil Jayasooriya



Re: How to list available all hard disks in OpenBSD

2012-12-20 Thread Nick Holland
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.



Re: How to list available all hard disks in OpenBSD

2012-12-20 Thread Wesley

Hi,

you can try this :


/usr/sbin/sysctl hw.disknames

Cheers,
Wesley


Le 2012-12-21 7:17, Indunil Jayasooriya a écrit :

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 I install a new Hard Disk, How to get to know whether it is wd1 or
anything eles?

In Linux, Fdisk -l show all the available hard disks. In OpenBSD 
what's the

command for it?




Re: How to list available all hard disks in OpenBSD

2012-12-20 Thread Indunil Jayasooriya
Hi misc

Thanks a lot



On Fri, Dec 21, 2012 at 10:07 AM, Wesley open...@e-solutions.re wrote:

 Hi,

 you can try this :


 /usr/sbin/sysctl hw.disknames

 Cheers,
 Wesley


 Le 2012-12-21 7:17, Indunil Jayasooriya a écrit :

  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 I install a new Hard Disk, How to get to know whether it is wd1 or
 anything eles?

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





--
Thank you
Indunil Jayasooriya



Re: How to list available all hard disks in OpenBSD

2012-12-20 Thread Raymond Lillard

Hi,

Sometimes I just can't let well enough alone ;-)

Add this to your .profile

Fdisk-l ()  { sysctl hw.disknames | sed -e 's/[,=]/\
  /g' ; }



From my laptop command line:

ryl@smag {~} Fdisk-l
hw.disknames
  sd0:f07ccfaba910bc8e
  cd0:
  sd1:21a268bf64300a23
ryl@smag {~} vi .profile


just to feel at home ;-)

BTW, I've never seen the command Fdisk -l and the
fdisk -l I know requires a device name to list
the device's partition table.

Knowing Linux though, it wouldn't surprise me to
hear that some distro has a Fdisk command that
behaves as you describe.

Best,
Ray


On 12/20/2012 08:46 PM, Indunil Jayasooriya wrote:

Hi misc

Thanks a lot



On Fri, Dec 21, 2012 at 10:07 AM, Wesley open...@e-solutions.re wrote:


Hi,

you can try this :


/usr/sbin/sysctl hw.disknames

Cheers,
Wesley


Le 2012-12-21 7:17, Indunil Jayasooriya a écrit :

  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 I install a new Hard Disk, How to get to know whether it is wd1 or
anything eles?

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







--
Thank you
Indunil Jayasooriya




Re: How to list available all hard disks in OpenBSD

2012-12-20 Thread Alexander Hall

On 12/21/12 04: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 I install a new Hard Disk, How to get to know whether it is wd1 or
anything eles?

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


$ sysctl -n hw.disknames
cd0:,sd0:3ae78cd65d4ba8f8

$ sysctl -n hw.disknames | sed 's/:[^,]*//g;s/,/ /'
cd0 sd0

and also see hotplugd(8)

/Alexander