Re: Storage device enumeration script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 26 May 2011 04:03, Phil Turmel <philip@xxxxxxxxxx> wrote:
> Hi All,
>
> Last November, I shared a shell script that helped me keep track of the specific hot-swap drives I had in the various slots of my servers. ÂAlthough encouraged by Roman and John, I declined to make a project out of it.
>
> I've since kicked it around some more, and thought a bit about supporting more than just the SCSI subsystem. ÂThe latest and greatest is still built around some standard executables: Âblkid, lspci, lsusb, sginfo, and smartctl. ÂThe original was similar to "lsscsi", but with controller details and device serial numbers.
>
> New features:
> Â Â Â ÂSupports non-SCSI storage devices
> Â Â Â ÂDescribes layered block devices
> Â Â Â Â Â Â Â ÂMD raid
> Â Â Â Â Â Â Â ÂLVM
> Â Â Â Â Â Â Â Âgeneric device mapper
> Â Â Â Â Â Â Â Âloop (partial)
> Â Â Â ÂShows UUIDs
> Â Â Â ÂShows mountpoints
> Â Â Â ÂAvoids repeating subtrees when enumerating raid devices
>
> I struggled with the last item, until I gave up on bash. ÂI needed to pass data to subroutines by reference, and bash is sorely lacking in that area. ÂThe new script is in python. ÂI'm releasing this one under the GPL version 2.
>
> Please give it a whirl.
>
> Phil
>

Awesome, however:

$ ./lsdrv.py
  File "./lsdrv.py", line 301
    print "%s  ââVolume Group %s (%s) %s free {%s}" % (indent,
vg.name, ','.join([dev.name for dev in vg.PVs]), vg.free, vg.uuid)
                                                      ^
SyntaxError: invalid syntax

Maybe it's a copy-paste thing from my mail that does it. Could you put
it somewhere, like a pastebin?

cheers,
/M
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux