{"id":21735280,"url":"https://github.com/chicks-net/megamap","last_synced_at":"2025-04-13T01:53:39.658Z","repository":{"id":13235881,"uuid":"15920540","full_name":"chicks-net/megamap","owner":"chicks-net","description":"MegaRAID® Linux drive map","archived":false,"fork":false,"pushed_at":"2023-02-11T16:46:41.000Z","size":690,"stargazers_count":33,"open_issues_count":4,"forks_count":16,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-13T01:52:51.692Z","etag":null,"topics":["drive-mappings","linux","megaraid-drive","perl","wwn"],"latest_commit_sha":null,"homepage":"","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chicks-net.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-01-15T00:42:56.000Z","updated_at":"2023-11-15T16:43:17.000Z","dependencies_parsed_at":"2024-11-26T05:12:56.110Z","dependency_job_id":"baec3f62-0092-460f-aff6-b503cacb446e","html_url":"https://github.com/chicks-net/megamap","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chicks-net%2Fmegamap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chicks-net%2Fmegamap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chicks-net%2Fmegamap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chicks-net%2Fmegamap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chicks-net","download_url":"https://codeload.github.com/chicks-net/megamap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248654052,"owners_count":21140235,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["drive-mappings","linux","megaraid-drive","perl","wwn"],"created_at":"2024-11-26T05:12:40.161Z","updated_at":"2025-04-13T01:53:39.637Z","avatar_url":"https://github.com/chicks-net.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"![logo](art/megamap-final-logo-100.png)\n# megamap\n\nMegaRAID\u0026trade; Linux drive mapper\n\n## Usage\n\nRun the `megamap` script and it will produce a map of MegaRAID drive ID to Linux drive `sd*` and also displays the WWN from Linux.\n\n## Requirements\n\n* you need the [`megacli`](http://askubuntu.com/questions/488612/how-do-i-install-the-lsi-megacli-in-ubuntu) tool which needs to be run as `root`\n* [Readonly](https://metacpan.org/pod/Readonly) Perl module (debian package `libreadonly-perl`)\n\n## Usage\n\n`megamap` takes no arguments and outputs a table of drive mappings such as:\n\n\t$ sudo megamap\n\t0       sdc     0x5000cca02ab9e1a0\n\t1       sdf     0x5000cca02ab9b548\n\t2       sde     0x5000cca02ab9bad0\n\t3       sdd     0x5000cca02ab9b928\n\t4       sdh     0x5000cca02ab9b5e8\n\t5       sdg     0x5000cca02ab9b86c\n\t6       sdj     0x5000cca02ab9b8c0\n\t7       sdi     0x5000cca02ab9dde8\n\t8       sdn     0x5000cca02ab9b34c\n\t9       sdk     0x5000cca02ab9e7d8\n\t10      sdl     0x5000cca02ab9e0c0\n\t11      sdm     0x5000cca02ab9b350\n\n`megablink` takes arguments of linux drives like `/dev/sda` or without the full\npath such as `sdb` and starts that drive blinking.  Unblinking happens when the\ndrive is replaced automatically, but there is also a `megaunblink` in case you\naccidentally blink the wrong drive.  `megablink -u` also unblinks a drive.\n\n\t$ sudo ./megablink /dev/sdn\n\tblinking drive 8 (sdn), running megacli -PdLocate -start -physdrv[0:8] -a0\n                                     \n\tAdapter: 0: Device at EnclId-0 SlotId-8  -- PD Locate Start Command was successfully sent to Firmware \n\n\tExit Code: 0x00\n\n\n![array](art/server-array-final-1000-white.png)\n\n## Notes\n\n* :foggy: the Linux WWN is off-by-one or a few from what `megacli` shows.\n* :clap: thanks to http://serverfault.com/questions/381177/megacli-get-the-dev-sd-device-name-for-a-logical-drive/ for getting me to look in `/dev/disk/by-id`\n* :clap: thanks to http://www.network-administrator.co.uk/?p=575 for providing a handy reference to the `megacli` command structure\n* :snake: [lsidrivemap](https://github.com/louwrentius/lsidrivemap) is similar to `megamap`, but written in python and it has a nice table output format that shows the layout of the drives on the front of the server.\n* :clap: thanks to [Harry Lee](https://github.com/tclh123) for providing my first bug report and testing my eventual fix.  It is really :doughnut: great to know one person is using my project.\n\n## Support\n\nPlease file a new [issue on github](https://github.com/chicks-net/megamap/issues) with\nthe output from:\n\n* `megacli -pdlist -a0 | egrep 'Slot|^SAS'`\n* `ls -l /dev/disk/by-id`\n* `uname -a`\n* `lsb_release -a`\n\nThe included script `megatrouble` will give you all of this in a format ready to post into an issue.\n\n\n## Debug Mode\n\nIf you set the `MEGAMAP_DEBUG` environment variable it won't run `megacli` or\n`ls` directly, but instead it will pull the data out of static files\n`/tmp/megacli.out` and `/tmp/ls.out`.  If everything is working properly you\nshould be able to generate those files like so:\n\n\tmegacli -pdlist -a0 | egrep 'Slot|^SAS' \u003e /tmp/megacli.out\n\tls -l /dev/disk/by-id | grep -v part \u003e /tmp/ls.out\n\n## Ideas\n\n* docs in POD\n* verify that it works on a system with more than 26 attached drives (the author does not currently have access to such a system)\n* support multiple adapters through command line arguments or environment variables\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchicks-net%2Fmegamap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchicks-net%2Fmegamap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchicks-net%2Fmegamap/lists"}