Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: (OT) how to identify a partition

by walto (Pilgrim)
on Apr 18, 2008 at 16:25 UTC ( #681549=note: print w/replies, xml ) Need Help??


in reply to (OT) how to identify a partition

I am not sure that I understood what you need but maybe Sys::Filesystem fits your needs.

Update:
After you specified your question this could be helpful
#!/usr/bin/perl -w # # use strict; my $partitions = `hdparm -i /dev/hda|grep Model`; my ($model,$firmware,$serial_no)=split /,/,$partitions; my @model = split /=/,$model; my @serial_no=split /=/,$serial_no; my @firmware=split /=/,$firmware; print "Model = $model[1]\tFirmware=$firmware[1]\tSerial No=$serial_no[ +1]\n";
The script must be run with root priviliges. If you use sudo you can use
my $partitions = `sudo hdparm -i /dev/hda|grep Model`;

Replies are listed 'Best First'.
Re^2: (OT) how to identify a partition
by leocharre (Priest) on Apr 20, 2008 at 19:03 UTC

    Sys::Filesystem is a little bit helpful, yes.

    Your suggestion hdparm is spectacularly useful. I can get a serial id off the drive this way! This helps identify a drive, marvelously.

    I'm still looking into identifying an actual partition. I have a hack to identify a filesystem, via the filesystem. But there must be something in the fs format that has this as well.

    Thank you, very useful!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://681549]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2021-01-25 01:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?