Code Monkey home page Code Monkey logo

megamap's Introduction

logo

megamap

MegaRAID™ Linux drive mapper

Usage

Run the megamap script and it will produce a map of MegaRAID drive ID to Linux drive sd* and also displays the WWN from Linux.

Requirements

  • you need the megacli tool which needs to be run as root
  • Readonly Perl module (debian package libreadonly-perl)

Usage

megamap takes no arguments and outputs a table of drive mappings such as:

$ sudo megamap
0       sdc     0x5000cca02ab9e1a0
1       sdf     0x5000cca02ab9b548
2       sde     0x5000cca02ab9bad0
3       sdd     0x5000cca02ab9b928
4       sdh     0x5000cca02ab9b5e8
5       sdg     0x5000cca02ab9b86c
6       sdj     0x5000cca02ab9b8c0
7       sdi     0x5000cca02ab9dde8
8       sdn     0x5000cca02ab9b34c
9       sdk     0x5000cca02ab9e7d8
10      sdl     0x5000cca02ab9e0c0
11      sdm     0x5000cca02ab9b350

megablink takes arguments of linux drives like /dev/sda or without the full path such as sdb and starts that drive blinking. Unblinking happens when the drive is replaced automatically, but there is also a megaunblink in case you accidentally blink the wrong drive. megablink -u also unblinks a drive.

$ sudo ./megablink /dev/sdn
blinking drive 8 (sdn), running megacli -PdLocate -start -physdrv[0:8] -a0
                                 
Adapter: 0: Device at EnclId-0 SlotId-8  -- PD Locate Start Command was successfully sent to Firmware 

Exit Code: 0x00

array

Notes

Support

Please file a new issue on github with the output from:

  • megacli -pdlist -a0 | egrep 'Slot|^SAS'
  • ls -l /dev/disk/by-id
  • uname -a
  • lsb_release -a

The included script megatrouble will give you all of this in a format ready to post into an issue.

Debug Mode

If you set the MEGAMAP_DEBUG environment variable it won't run megacli or ls directly, but instead it will pull the data out of static files /tmp/megacli.out and /tmp/ls.out. If everything is working properly you should be able to generate those files like so:

megacli -pdlist -a0 | egrep 'Slot|^SAS' > /tmp/megacli.out
ls -l /dev/disk/by-id | grep -v part > /tmp/ls.out

Ideas

  • docs in POD
  • verify that it works on a system with more than 26 attached drives (the author does not currently have access to such a system)
  • support multiple adapters through command line arguments or environment variables

megamap's People

Contributors

chicks-net avatar scottvrable avatar sodabrew avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.