Last active
February 27, 2020 20:31
-
-
Save prateekpandey14/f2a30b3f246fd5b44fdfb545185f78b4 to your computer and use it in GitHub Desktop.
Revisions
-
prateekpandey14 revised this gist
Apr 24, 2019 . 1 changed file with 10 additions and 31 deletions.There are no files selected for viewing
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 @@ -22,26 +22,13 @@ cstor-5be1d388-60d3-11e9-8e67-42010aa00fcf 9.94G 220K 9.94G - 0% $ zpool set autoexpand=on cstor-5be1d388-60d3-11e9-8e67-42010aa00fcf` ``` ### 4. Resize the disk used by the pool If this is done already, that's fine. ### 5. Get the expanded device name that is in-use with pool using `fdisk -l` command and use `parted /dev/<device-name>` to lists partition layout on device. Just after this command, type `Fix` at prompt to use new available space. ```sh $ parted /dev/sdb print Warning: Not all of the space available to /dev/sdb appears to be used, you can fix the GPT to use all of the space (an extra 20971520 blocks) or continue with @@ -75,22 +62,10 @@ sh: 1: udevadm: not found Information: You may need to update /etc/fstab. ``` ### 8. Check the parted size again using `parted /dev/<device-name> print` ```sh $ parted /dev/sdb print Model: Google PersistentDisk (scsi) Disk /dev/sdb: 21.5GB @@ -110,3 +85,7 @@ Note: Replace the disk name below by get disk name using `zpool status` command. zpool online -e cstor-5be1d388-60d3-11e9-8e67-42010aa00fcf /dev/disk/by-id/scsi-0Google_PersistentDisk_pdisk2 ``` ### 10. Restart the NDM pods schedeuled on same node with pool to reflect the updated size in `Disk` customresource After restart make sure NDM pod comes in `Running` state. -
prateekpandey14 revised this gist
Apr 19, 2019 . 1 changed file with 29 additions and 14 deletions.There are no files selected for viewing
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,24 +1,35 @@ ### 1. Do kubectl exec inside the cstor-pool-mgmt using command and install `parted` Get the pool pod name using `kubectl get pods -n openebs` command and exec inside the container. Install the `parted` tool using `apt-get install parted` after execing into the `cstor-pool-mgmt` container. ```sh $ kubectl exec -it cstor-pool-1fth-7fbbdfc747-sh25t -n openebs -c cstor-pool-mgmt bash ``` ### 2. zpool list (get the pool name) ```sh $ zpool list NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT cstor-5be1d388-60d3-11e9-8e67-42010aa00fcf 9.94G 220K 9.94G - 0% 0% 1.00x ONLINE - ``` ### 3. Set your zpool with `autoextend on` (it defaults to off) ```sh $ zpool set autoexpand=on cstor-5be1d388-60d3-11e9-8e67-42010aa00fcf` ``` ### 4. Resize the disk use by the pool and restart the NDM pods schedeuled on same node For a example purpose, have changed the disk size from 10GB to 20 GB. After restart make sure NDM pod comes in `Running` state. ### 5. Use command `parted -l` to lists partition layout on all block devices. after this command, type `Fix` at prompt to use new available space. ```sh $ parted -l Model: Google PersistentDisk (scsi) Disk /dev/sda: 107GB @@ -47,23 +58,26 @@ Number Start End Size File system Name Flags 9 10.7GB 10.7GB 8389kB ``` ### 6. Remove the buffering partition ```sh parted /dev/sdb rm 9 ``` ### 7. Expand partition holding zpool ```sh $ parted /dev/sdb resizepart 1 100% sh: 1: udevadm: not found sh: 1: udevadm: not found Information: You may need to update /etc/fstab. ``` ### 8. Check the parted size again using `parted -l` ```sh $ parted -l Model: Google PersistentDisk (scsi) @@ -88,10 +102,11 @@ Number Start End Size File system Name Flags 1 1049kB 21.5GB 21.5GB zfs zfs-d97901ec3aa0fb69 ``` ### 9. Size is changed from 10GB to 20GB, Now we have to tell the zpool to bring specified physical device online using following command. Note: Replace the disk name below by get disk name using `zpool status` command. ```sh zpool online -e cstor-5be1d388-60d3-11e9-8e67-42010aa00fcf /dev/disk/by-id/scsi-0Google_PersistentDisk_pdisk2 ``` -
prateekpandey14 revised this gist
Apr 17, 2019 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 @@ -13,8 +13,8 @@ cstor-5be1d388-60d3-11e9-8e67-42010aa00fcf 9.94G 220K 9.94G - 0% ```sh $ zpool set autoexpand=on cstor-5be1d388-60d3-11e9-8e67-42010aa00fcf` ``` ## 4. Resize the disk related to the above pool and restart the NDM pods scheduled in same node as pool. Just for testing purpose, i have changed the disk size from 10GB to 20 GB ## 5. Use command `parted -l` to lists partition layout on all block devices. after this command, type ‘Fix’ at prompt to use new availble space. ```sh -
prateekpandey14 revised this gist
Apr 17, 2019 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewing
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 @@ -88,8 +88,9 @@ Number Start End Size File system Name Flags 1 1049kB 21.5GB 21.5GB zfs zfs-d97901ec3aa0fb69 ``` ## 9. Size is changed from 10GB to 20GB, Now we have to tell the zpool to bring specified physical device online using following command. Note: Replace the disk name below by get disk name using `zpool status` command. ```sh zpool online -e cstor-5be1d388-60d3-11e9-8e67-42010aa00fcf /dev/disk/by-id/scsi-0Google_PersistentDisk_pdisk2 -
prateekpandey14 revised this gist
Apr 17, 2019 . 1 changed file with 10 additions and 9 deletions.There are no files selected for viewing
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,23 +1,22 @@ ## 1. Do kubectl exec inside the cstor-pool-mgmt using command and install `parted` using `apt-get install parted` ```sh $ kubectl exec -it cstor-pool-1fth-7fbbdfc747-sh25t -n openebs -c cstor-pool-mgmt bash ``` ## 2. zpool list (get the pool name) ```sh $ zpool list NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT cstor-5be1d388-60d3-11e9-8e67-42010aa00fcf 9.94G 220K 9.94G - 0% 0% 1.00x ONLINE - ``` ## 3. Set your zpool with `autoextend on` (it defaults to off) ```sh $ zpool set autoexpand=on cstor-5be1d388-60d3-11e9-8e67-42010aa00fcf` ``` ## 4. Resize the disk related to the above pool and restart the NDM pods on that node.(use other terminal) For just for testing, changed the disk size from 10GB to 20 GB ## 5. Use command `parted -l` to lists partition layout on all block devices. after this command, type ‘Fix’ at prompt to use new availble space. ```sh $ parted -l @@ -56,15 +55,17 @@ parted /dev/sdb rm 9 ``` ## 7. Expand partition holding zpool ```sh $ parted /dev/sdb resizepart 1 100% sh: 1: udevadm: not found sh: 1: udevadm: not found Information: You may need to update /etc/fstab. ``` ## 8. Check the parted size again using `parted -l` ``` $ parted -l Model: Google PersistentDisk (scsi) Disk /dev/sda: 107GB Sector size (logical/physical): 512B/4096B -
prateekpandey14 revised this gist
Apr 17, 2019 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
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 @@ -87,7 +87,8 @@ Number Start End Size File system Name Flags 1 1049kB 21.5GB 21.5GB zfs zfs-d97901ec3aa0fb69 ``` ## 9. Size is changed from 10GB to 20GB, Now we have to tell the zpool brings the specified physical device online using following command. Replace the disk name below by get disk name using `zpool status` command ```sh zpool online -e cstor-5be1d388-60d3-11e9-8e67-42010aa00fcf /dev/disk/by-id/scsi-0Google_PersistentDisk_pdisk2 -
prateekpandey14 created this gist
Apr 17, 2019 .There are no files selected for viewing
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,94 @@ ## 1. Do kubectl exec inside the cstor-pool-mgmt using command and install `parted` using `apt-get install parted` ```sh kubectl exec -it cstor-pool-1fth-7fbbdfc747-sh25t -n openebs -c cstor-pool-mgmt bash ``` ## 2. zpool list (get the pool name) ```sh zpool list NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT cstor-5be1d388-60d3-11e9-8e67-42010aa00fcf 9.94G 220K 9.94G - 0% 0% 1.00x ONLINE - ``` ## 3. Set your zpool with `autoextend on` (it defaults to off) ```sh zpool set autoexpand=on cstor-5be1d388-60d3-11e9-8e67-42010aa00fcf` ``` ## 4. Resize the disk related to the above pool and restart the NDM pods on that node.(use other terminal) For just for testing, changed the disk size from 10GB to 20 GB ## 5. Use command `parted -l` to lists partition layout on all block devices. after this command, type ‘Fix’ at prompt to take advantage of new space. ```sh $ parted -l Model: Google PersistentDisk (scsi) Disk /dev/sda: 107GB Sector size (logical/physical): 512B/4096B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 14 1049kB 5243kB 4194kB bios_grub 15 5243kB 116MB 111MB fat32 boot, esp 1 116MB 107GB 107GB ext4 Warning: Not all of the space available to /dev/sdb appears to be used, you can fix the GPT to use all of the space (an extra 20971520 blocks) or continue with the current setting? Fix/Ignore? Fix Model: Google PersistentDisk (scsi) Disk /dev/sdb: 21.5GB Sector size (logical/physical): 512B/4096B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 1 1049kB 10.7GB 10.7GB zfs zfs-d97901ec3aa0fb69 9 10.7GB 10.7GB 8389kB ``` --------------------------------------------------------------------------------------- ## 6. Remove the buffering partition ```sh parted /dev/sdb rm 9 ``` ## 7. Expand partition holding zpool parted /dev/sdb resizepart 1 100% ``` sh: 1: udevadm: not found sh: 1: udevadm: not found Information: You may need to update /etc/fstab. ``` ## 8. Check the parted size again ``` root@cstor-pool-1fth-7fbbdfc747-sh25t:/# parted -l Model: Google PersistentDisk (scsi) Disk /dev/sda: 107GB Sector size (logical/physical): 512B/4096B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 14 1049kB 5243kB 4194kB bios_grub 15 5243kB 116MB 111MB fat32 boot, esp 1 116MB 107GB 107GB ext4 Model: Google PersistentDisk (scsi) Disk /dev/sdb: 21.5GB Sector size (logical/physical): 512B/4096B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 1 1049kB 21.5GB 21.5GB zfs zfs-d97901ec3aa0fb69 ``` ## 9. Size is changed from 10GB to 20GB, Now we have to tell the zpool to expand/online using following command. ```sh zpool online -e cstor-5be1d388-60d3-11e9-8e67-42010aa00fcf /dev/disk/by-id/scsi-0Google_PersistentDisk_pdisk2 ```