Last active
          September 20, 2024 09:18 
        
      - 
      
- 
        Save jalaziz/bcfe2f71e3f7e8fe42a9c294c1e9279f to your computer and use it in GitHub Desktop. 
Revisions
- 
        jalaziz revised this gist Oct 21, 2019 . 2 changed files with 2 additions and 3 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,12 +1,10 @@ [Unit] Description=Reload AWS EBS NVMe rules Before=user-config.target DefaultDependencies=no [Service] Type=oneshot RemainAfterExit=yes ExecStart=/usr/bin/udevadm control --reload-rules ExecStart=/usr/bin/udevadm trigger -y "nvme[0-9]*n[0-9]*" ExecStart=/usr/bin/udevadm settle This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,6 +3,7 @@ Description=Formats /dev/xvdb Before=dbus.service docker.service After=ebs-nvme-udev-trigger.service dev-xvdb.device Wants=ebs-nvme-udev-trigger.service dev-xvdb.device DefaultDependencies=no [Service] Type=oneshot RemainAfterExit=yes 
- 
        jalaziz revised this gist Jun 11, 2018 . 2 changed files with 40 additions and 0 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,2 +1,20 @@ # Copyright (C) 2018 Jameel Al-Aziz # Modified for simplicification and use within CoreOS. # # Copyright (C) 2006-2016 Amazon.com, Inc. or its affiliates. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompanying this file. This file is # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS # OF ANY KIND, either express or implied. See the License for the # specific language governing permissions and limitations under the # License. # ebs nvme devices KERNEL=="nvme[0-9]*n[0-9]*", ENV{DEVTYPE}=="disk", ATTRS{model}=="Amazon Elastic Block Store", PROGRAM="/opt/bin/ebs-nvme-mapping /dev/%k", SYMLINK+="%c" This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,26 @@ #!/bin/bash # This file has been modified from # https://github.com/oogali/ebs-automatic-nvme-mapping/blob/master/ebs-nvme-mapping.sh # # Copyright (c) 2018 Omachonu Ogali # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. vol=$(nvme id-ctrl --raw-binary "$1" | cut -c3073-3104 | tr -s ' ' | sed 's/ $//g') vol=${vol#/dev/} 
- 
        jalaziz renamed this gist Apr 9, 2018 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewingFile renamed without changes.
- 
        jalaziz revised this gist Apr 9, 2018 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,8 @@ [Unit] Description=Formats /dev/xvdb Before=dbus.service docker.service After=ebs-nvme-udev-trigger.service dev-xvdb.device Wants=ebs-nvme-udev-trigger.service dev-xvdb.device [Service] Type=oneshot RemainAfterExit=yes 
- 
        jalaziz revised this gist Apr 9, 2018 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,8 @@ [Unit] Description=Formats /dev/xvdb Before=dbus.service docker.service After=dev-xvdb.device ebs-nvme-udev-trigger.service Wants=dev-xvdb.device ebs-nvme-udev-trigger.service [Service] Type=oneshot RemainAfterExit=yes 
- 
        jalaziz revised this gist Apr 9, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ [Unit] Description=Formats /dev/xvdb Before=dbus.service docker.service After=dev-xvdb.device Wants=dev-xvdb.device 
- 
        jalaziz revised this gist Apr 9, 2018 . 2 changed files with 21 additions and 0 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ [Unit] Description=Reload AWS EBS NVMe rules Requires=coreos-setup-environment.service After=coreos-setup-environment.service Before=user-config.target [Service] Type=oneshot RemainAfterExit=yes EnvironmentFile=-/etc/environment ExecStart=/usr/bin/udevadm control --reload-rules ExecStart=/usr/bin/udevadm trigger -y "nvme[0-9]*n[0-9]*" ExecStart=/usr/bin/udevadm settle This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ [Unit] Description=Formats /var/lib Before=dbus.service docker.service After=dev-xvdb.device Wants=dev-xvdb.device [Service] Type=oneshot RemainAfterExit=yes ExecStart=/bin/bash -c '(blkid -t TYPE=ext4 /dev/xvdb) || (/usr/sbin/mkfs.ext4 -F /dev/xvdb)' 
- 
        jalaziz created this gist Apr 9, 2018 .There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ # ebs nvme devices KERNEL=="nvme[0-9]*n[0-9]*", ENV{DEVTYPE}=="disk", ATTRS{model}=="Amazon Elastic Block Store", PROGRAM="/opt/bin/ebs-nvme-mapping /dev/%k", SYMLINK+="%c" This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ #!/bin/bash vol=$(nvme id-ctrl --raw-binary "$1" | cut -c3073-3104 | tr -s ' ' | sed 's/ $//g') vol=${vol#/dev/} if [[ -n "$vol" ]]; then echo ${vol/xvd/sd} ${vol/sd/xvd} fi