LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to find out the serial number of my hard disk through command line on OpenSuse 11.2 ? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-find-out-the-serial-number-of-my-hard-disk-through-command-line-on-opensuse-11-2-a-819367/)

TheIndependentAquarius 07-12-2010 05:13 AM

How to find out the serial number of my hard disk through command line on OpenSuse 11.2 ?
 
I read this thread but
Code:

anisha@linux-uitj:~> su
Password:
linux-uitj:/home/anisha # lshw
If 'lshw' is not a typo you can use command-not-found to lookup the package that contains it, like this:
    cnf lshw
linux-uitj:/home/anisha # cnf lshw
lshw: command not found

Any other way out ?
Kindly guide !

alli_yas 07-12-2010 05:20 AM

Hi

I suspect you need to install the lshw package - I know it does not come standard on RHEL/Fedora; perhaps its the same for OpenSuse?

On my Fedora machine:

Code:

# yum install lshw
did the trick!

brianL 07-12-2010 05:21 AM

You can probably install lshw via your package manager.
Or, there may be a cover on the base of your laptop that enables you to access the hard drive and read its label.

TheIndependentAquarius 07-12-2010 05:24 AM

Thanks to both of you !

But AFAIK cnf saying command not found means that there is no such command because if the command can be installed cnf says "You can install it through zypper ..."

OK I shall try the package manager.

brianL 07-12-2010 05:26 AM

I'd be surprised if it wasn't available for OpenSuse.

TheIndependentAquarius 07-12-2010 05:27 AM

Quote:

Originally Posted by brianL (Post 4030682)
I'd be surprised if it wasn't available for OpenSuse.

Here is something to surprise you:
Code:

linux-uitj:/home/anisha # zypper install lshw
Retrieving repository 'KDE:KDE3' metadata [done]
Building repository 'KDE:KDE3' cache [done]
Retrieving repository 'X11:lxde' metadata [done]
Building repository 'X11:lxde' cache [done]
Retrieving repository 'openSUSE-11.2-Update' metadata [done]
Building repository 'openSUSE-11.2-Update' cache [done]
Loading repository data...
Reading installed packages...
'lshw' not found.
Resolving package dependencies...

Nothing to do.


brianL 07-12-2010 05:30 AM

Time to change your distro! :)

alli_yas 07-12-2010 05:30 AM

Have a look at this: http://linuxpoison.blogspot.com/2009...-in-linux.html

TheIndependentAquarius 07-12-2010 05:31 AM

I should change my distro just to know the hard disk number ????

brianL 07-12-2010 05:33 AM

It's as good a reason as any. :)

TheIndependentAquarius 07-12-2010 06:01 AM

Well I searched Google and found this thread:
http://forums.opensuse.org/archives/...ml#post1787445

Running hwinfo command has given me a extremely long output, a small part of it i have presented here:

I do not know how to find out the hard disk serial number from this.

Code:

linux-uitj:/home/anisha # hwinfo
============ start debug info ============                     
libhd version 16.10 (x86-64)                                   
using /var/lib/hardware                                       
kernel version is 2.6                                         
----- /proc/cmdline -----                                     
  root=/dev/disk/by-id/ata-ST3250310AS_6RYNQEXY-part5 resume=/dev/disk/by-id/ata-ST3250310AS_6RYNQEXY-part2 splash=silent quiet vga=0x31a                                                                                                                   
----- /proc/cmdline end -----                                                                                                 
hd.ids line 278: invalid info                                                                                                 
debug = 0xff7ffff7                                                                                                           
probe = 0x1d938fcdaa17fcf9fffe (+memory +pci +isapnp +net +floppy +misc +misc.serial +misc.par +misc.floppy +serial +cpu +bios +monitor +mouse +scsi +usb -usb.mods +modem +modem.usb +parallel +parallel.lp +parallel.zip -isa -isa.isdn +isdn +kbd +prom +sbus +int +braille +braille.alva +braille.fhp +braille.ht -ignx11 +sys -bios.vbe -isapnp.old -isapnp.new -isapnp.mod +braille.baum -manual +fb +pppoe -scan +pcmcia +fork -parallel.imm +s390 +cpuemu -sysfs -s390disks +udev +block +block.cdrom +block.part +edd +edd.mod -bios.ddc -bios.fb -bios.mode +input +block.mods +bios.vesa -cpuemu.debug -scsi.noserial +wlan -bios.crc -hal +bios.vram +bios.acpi -bios.ddc.ports=0 +modules.pata +net.eeprom +x86emu=dump -max -lxrc)                                         
shm: attached segment 9666567 at 0x7fbe92b63000                                                                               
>> hal.1: read hal data                                                                                                       
  hal: connected to: :1.123                                                                                                   
----- hal device list -----                                                                                                   
  0: udi = '/org/freedesktop/Hal/devices/pci_8086_27d8_sound_card_0_oss_pcm_0_0'                                             
  info.udi = '/org/freedesktop/Hal/devices/pci_8086_27d8_sound_card_0_oss_pcm_0_0'                                           
  linux.hotplug_type = 2 (0x2)                                                                                               
  linux.subsystem = 'sound'                                                                                                   
  info.subsystem = 'sound'                                                                                                   
  info.product = 'VT1708S Analog OSS PCM Device'                                                                             
  oss.device_file = '/dev/dsp'                                                                                               
  oss.originating_device = '/org/freedesktop/Hal/devices/pci_8086_27d8_sound_card_0'                                         
  linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:1b.0/sound/card0/dsp'                                                   
  info.parent = '/org/freedesktop/Hal/devices/pci_8086_27d8_sound_card_0'                                                     
  oss.card_id = 'HDA Intel'                                                                                                   
  oss.card = 0 (0x0)                                                                                                         
  info.category = 'oss'                                                                                                       
  info.capabilities = { 'oss' }                                                                                               
  oss.type = 'pcm'                                                                                                           
  oss.device = 0 (0x0)                                                                                                       
  oss.device_id = 'VT1708S Analog'                                                                                           
  linux.device_file = '/dev/dsp'


knudfl 07-12-2010 06:13 AM

Hard disk serial no.: # hdparm -i /dev/sda
Or : # hdparm -i /dev/sda | grep -i serial

..

brianL 07-12-2010 06:13 AM

Maybe this:
Quote:

ata-ST3250310AS_6RYNQEXY

TheIndependentAquarius 07-12-2010 06:17 AM

Quote:

Originally Posted by knudfl (Post 4030719)
Hard disk serial no.: # hdparm -i /dev/sda
Or : # hdparm -i /dev/sda | grep -i serial

..

Thanks a lot

I tried this out, see the results !!
Code:

linux-uitj:/home/anisha # hdparm -i /dev/sda | grep -i serial
 Model=ST3250310AS, FwRev=4.AAA, SerialNo=6RYNQEXY


TheIndependentAquarius 07-12-2010 06:20 AM

Quote:

Originally Posted by brianL (Post 4030720)
Maybe this:

Yes Brian you are right, I could never have figured out that output on my own.

Thanks for bothering :)


All times are GMT -5. The time now is 08:54 PM.