{"id":3020,"date":"2023-01-29T21:48:51","date_gmt":"2023-01-29T12:48:51","guid":{"rendered":"http:\/\/192.168.20.1\/?p=3020"},"modified":"2023-01-29T21:48:51","modified_gmt":"2023-01-29T12:48:51","slug":"ubuntu-add-new-raid-1-array-to-extend-existing-lvm-space","status":"publish","type":"post","link":"https:\/\/rlab.cavtime.net\/?p=3020","title":{"rendered":"Ubuntu Add New RAID 1 Array to extend existing LVM space"},"content":{"rendered":"<h2>Overview<\/h2>\n<p>\u65e2\u5b58\u306e LVM Volume Group \u306b\u65b0\u306b\u8ffd\u52a0\u3057\u305f RAID 1 Array (md1) \u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<h2>Storage Diagram<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/rlab.cavtime.net\/wp-content\/uploads\/2023\/01\/LVM_RAID_NewNAS-847x375.png\" alt=\"\" width=\"847\" height=\"375\" class=\"img-responsive right-block\" \/><\/p>\n<h2>Reference<\/h2>\n<ul>\n<li><a href=\"https:\/\/rlab.cavtime.net\/?p=3003\" target=\"_blank\" rel=\"noopener\">Ubuntu LVM on RAID1<\/a><\/li>\n<\/ul>\n<h2>Environment<\/h2>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Bash\"><code># uname -a\r\nLinux nas 5.15.0-58-generic #64-Ubuntu SMP Thu Jan 5 11:43:13 UTC 2023 x86_64 x86_64 x86_64 GNU\/Linux\r\n# cat \/etc\/os-release\r\nPRETTY_NAME=\"Ubuntu 22.04.1 LTS\"\r\nNAME=\"Ubuntu\"\r\nVERSION_ID=\"22.04\"\r\nVERSION=\"22.04.1 LTS (Jammy Jellyfish)\"\r\nVERSION_CODENAME=jammy\r\nID=ubuntu\r\nID_LIKE=debian\r\nHOME_URL=\"https:\/\/www.ubuntu.com\/\"\r\nSUPPORT_URL=\"https:\/\/help.ubuntu.com\/\"\r\nBUG_REPORT_URL=\"https:\/\/bugs.launchpad.net\/ubuntu\/\"\r\nPRIVACY_POLICY_URL=\"https:\/\/www.ubuntu.com\/legal\/terms-and-policies\/privacy-policy\"\r\nUBUNTU_CODENAME=jammy\r\n# <\/code><\/pre>\n<\/div>\n<h2>Summary<\/h2>\n<p>RAID<\/p>\n<p>LVM<\/p>\n<h2>Check Storage<\/h2>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Bash\"><code># fdisk -l\r\nDisk \/dev\/loop0: 61.96 MiB, 64970752 bytes, 126896 sectors\r\nUnits: sectors of 1 * 512 = 512 bytes\r\nSector size (logical\/physical): 512 bytes \/ 512 bytes\r\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\r\n\r\n\r\nDisk \/dev\/loop1: 79.95 MiB, 83832832 bytes, 163736 sectors\r\nUnits: sectors of 1 * 512 = 512 bytes\r\nSector size (logical\/physical): 512 bytes \/ 512 bytes\r\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\r\n\r\n\r\nDisk \/dev\/loop2: 49.83 MiB, 52248576 bytes, 102048 sectors\r\nUnits: sectors of 1 * 512 = 512 bytes\r\nSector size (logical\/physical): 512 bytes \/ 512 bytes\r\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\r\n\r\n\r\nDisk \/dev\/loop3: 63.27 MiB, 66347008 bytes, 129584 sectors\r\nUnits: sectors of 1 * 512 = 512 bytes\r\nSector size (logical\/physical): 512 bytes \/ 512 bytes\r\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\r\n\r\n\r\nDisk \/dev\/loop4: 111.95 MiB, 117387264 bytes, 229272 sectors\r\nUnits: sectors of 1 * 512 = 512 bytes\r\nSector size (logical\/physical): 512 bytes \/ 512 bytes\r\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\r\n\r\n\r\nDisk \/dev\/sda: 10 GiB, 10737418240 bytes, 20971520 sectors\r\nDisk model: VBOX HARDDISK   \r\nUnits: sectors of 1 * 512 = 512 bytes\r\nSector size (logical\/physical): 512 bytes \/ 512 bytes\r\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\r\nDisklabel type: gpt\r\nDisk identifier: FA6120DA-07AF-4E7F-BAFD-B3F929BBFFCF\r\n\r\nDevice       Start      End  Sectors  Size Type\r\n\/dev\/sda1     2048     4095     2048    1M BIOS boot\r\n\/dev\/sda2     4096  3674111  3670016  1.8G Linux filesystem\r\n\/dev\/sda3  3674112 20969471 17295360  8.2G Linux filesystem\r\n\r\n\r\nDisk \/dev\/mapper\/ubuntu--vg-ubuntu--lv: 8.25 GiB, 8854175744 bytes, 17293312 sectors\r\nUnits: sectors of 1 * 512 = 512 bytes\r\nSector size (logical\/physical): 512 bytes \/ 512 bytes\r\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\r\n\r\n\r\nDisk \/dev\/sdb: 10 GiB, 10737418240 bytes, 20971520 sectors\r\nDisk model: HARDDISK        \r\nUnits: sectors of 1 * 512 = 512 bytes\r\nSector size (logical\/physical): 512 bytes \/ 512 bytes\r\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\r\nDisklabel type: gpt\r\nDisk identifier: F2A8B7FB-DA02-4B16-9B13-D4AC1AAC69C5\r\n\r\nDevice     Start      End  Sectors Size Type\r\n\/dev\/sdb1   2048 20969471 20967424  10G Linux RAID\r\n\r\n\r\nDisk \/dev\/sdc: 10 GiB, 10737418240 bytes, 20971520 sectors\r\nDisk model: HARDDISK        \r\nUnits: sectors of 1 * 512 = 512 bytes\r\nSector size (logical\/physical): 512 bytes \/ 512 bytes\r\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\r\nDisklabel type: gpt\r\nDisk identifier: 088CEDE5-A558-485C-9F7C-97C8EBF6D20F\r\n\r\nDevice     Start      End  Sectors Size Type\r\n\/dev\/sdc1   2048 20969471 20967424  10G Linux RAID\r\n\r\n\r\nDisk \/dev\/sdd: 10 GiB, 10737418240 bytes, 20971520 sectors\r\nDisk model: HARDDISK        \r\nUnits: sectors of 1 * 512 = 512 bytes\r\nSector size (logical\/physical): 512 bytes \/ 512 bytes\r\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\r\n\r\n\r\nDisk \/dev\/sde: 10 GiB, 10737418240 bytes, 20971520 sectors\r\nDisk model: HARDDISK        \r\nUnits: sectors of 1 * 512 = 512 bytes\r\nSector size (logical\/physical): 512 bytes \/ 512 bytes\r\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\r\n\r\n\r\nDisk \/dev\/md0: 9.99 GiB, 10725883904 bytes, 20948992 sectors\r\nUnits: sectors of 1 * 512 = 512 bytes\r\nSector size (logical\/physical): 512 bytes \/ 512 bytes\r\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\r\n\r\n\r\nDisk \/dev\/mapper\/share_vg-share_lv: 9.99 GiB, 10724835328 bytes, 20946944 sectors\r\nUnits: sectors of 1 * 512 = 512 bytes\r\nSector size (logical\/physical): 512 bytes \/ 512 bytes\r\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\r\n# \r\n# ls -l \/dev\/sd[de]\r\nbrw-rw---- 1 root disk 8, 48 Jan 29 11:05 \/dev\/sdd\r\nbrw-rw---- 1 root disk 8, 64 Jan 29 11:05 \/dev\/sde\r\n# <\/code><\/pre>\n<\/div>\n<h2>RAID [ Partition ]<\/h2>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Bash\"><code># parted \/dev\/sdd\r\nGNU Parted 3.4\r\nUsing \/dev\/sdd\r\nWelcome to GNU Parted! Type 'help' to view a list of commands.\r\n(parted) unit GB                                                          \r\n(parted) mklabel gpt                                                      \r\n(parted) mkpart primary                                                   \r\nFile system type?  [ext2]? ext4\r\nStart? 0%\r\nEnd? 100%                                                                 \r\n(parted) set 1 raid on                                                    \r\n(parted) p                                                                \r\nModel: VBOX HARDDISK (scsi)\r\nDisk \/dev\/sdd: 10.7GB\r\nSector size (logical\/physical): 512B\/512B\r\nPartition Table: gpt\r\nDisk Flags: \r\n\r\nNumber  Start   End     Size    File system  Name     Flags\r\n 1      0.00GB  10.7GB  10.7GB  ext4         primary  raid\r\n\r\n(parted) quit                                                             \r\nInformation: You may need to update \/etc\/fstab.\r\n\r\n# parted \/dev\/sde\r\nGNU Parted 3.4\r\nUsing \/dev\/sde\r\nWelcome to GNU Parted! Type 'help' to view a list of commands.\r\n(parted) unit GB                                                          \r\n(parted) mkpart primary                                                   \r\nError: \/dev\/sde: unrecognised disk label\r\n(parted) mklabel gpt\r\n(parted) mkpart primary\r\nFile system type?  [ext2]? ext4                                           \r\nStart? 0%                                                                 \r\nEnd? 100%                                                                 \r\n(parted) set 1 raid on                                                    \r\n(parted) p                                                                \r\nModel: VBOX HARDDISK (scsi)\r\nDisk \/dev\/sde: 10.7GB\r\nSector size (logical\/physical): 512B\/512B\r\nPartition Table: gpt\r\nDisk Flags: \r\n\r\nNumber  Start   End     Size    File system  Name     Flags\r\n 1      0.00GB  10.7GB  10.7GB  ext4         primary  raid\r\n\r\n(parted) quit                                                             \r\nInformation: You may need to update \/etc\/fstab.\r\n\r\n# \r\n# \r\n# ls -l \/dev\/sd[de]*\r\nbrw-rw---- 1 root disk 8, 48 Jan 29 11:12 \/dev\/sdd\r\nbrw-rw---- 1 root disk 8, 49 Jan 29 11:12 \/dev\/sdd1\r\nbrw-rw---- 1 root disk 8, 64 Jan 29 11:13 \/dev\/sde\r\nbrw-rw---- 1 root disk 8, 65 Jan 29 11:13 \/dev\/sde1\r\n# <\/code><\/pre>\n<\/div>\n<h2>RAID [ Array ]<\/h2>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Bash\"><code># mdadm --create \/dev\/md1 --level=raid1 --raid-devices=2 \/dev\/sdd1 \/dev\/sde1\r\nmdadm: Note: this array has metadata at the start and\r\n    may not be suitable as a boot device.  If you plan to\r\n    store '\/boot' on this device please ensure that\r\n    your boot-loader understands md\/v1.x metadata, or use\r\n    --metadata=0.90\r\nContinue creating array? y\r\nmdadm: Defaulting to version 1.2 metadata\r\nmdadm: array \/dev\/md1 started.\r\n# cat \/proc\/mdstat\r\nPersonalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10] \r\nmd1 : active raid1 sde1[1] sdd1[0]\r\n      10474496 blocks super 1.2 [2\/2] [UU]\r\n      [===&gt;.................]  resync = 19.1% (2001920\/10474496) finish=0.7min speed=200192K\/sec\r\n      \r\nmd0 : active raid1 sdc1[1] sdb1[0]\r\n      10474496 blocks super 1.2 [2\/2] [UU]\r\n      \r\nunused devices: <none>\r\n# cat \/proc\/mdstat\r\nPersonalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10] \r\nmd1 : active raid1 sde1[1] sdd1[0]\r\n      10474496 blocks super 1.2 [2\/2] [UU]\r\n      [==========&gt;..........]  resync = 54.3% (5691584\/10474496) finish=0.3min speed=203270K\/sec\r\n      \r\nmd0 : active raid1 sdc1[1] sdb1[0]\r\n      10474496 blocks super 1.2 [2\/2] [UU]\r\n      \r\nunused devices: <none>\r\n# \r\n# cat \/proc\/mdstat\r\nPersonalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10] \r\nmd1 : active raid1 sde1[1] sdd1[0]\r\n      10474496 blocks super 1.2 [2\/2] [UU]\r\n      \r\nmd0 : active raid1 sdc1[1] sdb1[0]\r\n      10474496 blocks super 1.2 [2\/2] [UU]\r\n      \r\nunused devices: <none>\r\n# \r\n# mdadm --misc --detail \/dev\/md1\r\n\/dev\/md1:\r\n           Version : 1.2\r\n     Creation Time : Sun Jan 29 11:15:26 2023\r\n        Raid Level : raid1\r\n        Array Size : 10474496 (9.99 GiB 10.73 GB)\r\n     Used Dev Size : 10474496 (9.99 GiB 10.73 GB)\r\n      Raid Devices : 2\r\n     Total Devices : 2\r\n       Persistence : Superblock is persistent\r\n\r\n       Update Time : Sun Jan 29 11:16:19 2023\r\n             State : clean \r\n    Active Devices : 2\r\n   Working Devices : 2\r\n    Failed Devices : 0\r\n     Spare Devices : 0\r\n\r\nConsistency Policy : resync\r\n\r\n              Name : nas:1  (local to host nas)\r\n              UUID : 60b7ba70:94ed3937:3942a50e:306e664b\r\n            Events : 17\r\n\r\n    Number   Major   Minor   RaidDevice State\r\n       0       8       49        0      active sync   \/dev\/sdd1\r\n       1       8       65        1      active sync   \/dev\/sde1\r\n# <\/none><\/none><\/none><\/code><\/pre>\n<\/div>\n<h2>mdadm.conf<\/h2>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Bash\"><code># mdadm --detail --scan &gt;&gt; \/etc\/mdadm\/mdadm.conf\r\n# \r\n# vim \/etc\/mdadm\/mdadm.conf\r\n# \r\n# cat \/etc\/mdadm\/mdadm.conf\r\n# mdadm.conf\r\n#\r\n# !NB! Run update-initramfs -u after updating this file.\r\n# !NB! This will ensure that initramfs has an uptodate copy.\r\n#\r\n# Please refer to mdadm.conf(5) for information about this file.\r\n#\r\n\r\n# by default (built-in), scan all partitions (\/proc\/partitions) and all\r\n# containers for MD superblocks. alternatively, specify devices to scan, using\r\n# wildcards if desired.\r\n#DEVICE partitions containers\r\n\r\n# automatically tag new arrays as belonging to the local system\r\nHOMEHOST <system>\r\n\r\n# instruct the monitoring daemon where to send mail alerts\r\nMAILADDR root\r\n\r\n# definitions of existing MD arrays\r\n\r\n# This configuration was auto-generated on Tue, 09 Aug 2022 11:56:48 +0000 by mkconf\r\n#ARRAY \/dev\/md0 UUID=6f52cdb8:efcbb936:e1a859a4:ef6e60ab\r\nARRAY \/dev\/md0 metadata=1.2 name=nas:0 UUID=6f52cdb8:efcbb936:e1a859a4:ef6e60ab\r\nARRAY \/dev\/md1 metadata=1.2 name=nas:1 UUID=60b7ba70:94ed3937:3942a50e:306e664b\r\n# \r\n<\/system><\/code><\/pre>\n<\/div>\n<h2>initramfs update<\/h2>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Bash\"><code># update-initramfs -u\r\nupdate-initramfs: Generating \/boot\/initrd.img-5.15.0-58-generic\r\n# cat \/proc\/mdstat\r\nPersonalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10] \r\nmd1 : active raid1 sde1[1] sdd1[0]\r\n      10474496 blocks super 1.2 [2\/2] [UU]\r\n      \r\nmd0 : active raid1 sdc1[1] sdb1[0]\r\n      10474496 blocks super 1.2 [2\/2] [UU]\r\n      \r\nunused devices: <none>\r\n#<\/none><\/code><\/pre>\n<\/div>\n<h2>LVM [ Physical Volume ]<\/h2>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Bash\"><code># pvcreate \/dev\/md1\r\n  Physical volume \"\/dev\/md1\" successfully created.\r\n# <\/code><\/pre>\n<\/div>\n<h2>LVM [ Volume Group Extended ]<\/h2>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Bash\"><code># vgextend share_vg \/dev\/md1\r\n  Volume group \"share_vg\" successfully extended\r\n# vgdisplay -v\r\n  --- Volume group ---\r\n  VG Name               ubuntu-vg\r\n  System ID             \r\n  Format                lvm2\r\n  Metadata Areas        1\r\n  Metadata Sequence No  2\r\n  VG Access             read\/write\r\n  VG Status             resizable\r\n  MAX LV                0\r\n  Cur LV                1\r\n  Open LV               1\r\n  Max PV                0\r\n  Cur PV                1\r\n  Act PV                1\r\n  VG Size               &lt;8.25 GiB\r\n  PE Size               4.00 MiB\r\n  Total PE              2111\r\n  Alloc PE \/ Size       2111 \/ &lt;8.25 GiB\r\n  Free  PE \/ Size       0 \/ 0   \r\n  VG UUID               VhSrss-EZMH-UllN-KJ3e-t01T-1pra-LE2cPa\r\n   \r\n  --- Logical volume ---\r\n  LV Path                \/dev\/ubuntu-vg\/ubuntu-lv\r\n  LV Name                ubuntu-lv\r\n  VG Name                ubuntu-vg\r\n  LV UUID                QcRHWC-mFve-QL2e-Exi4-C6j3-PKnR-AhJjuY\r\n  LV Write Access        read\/write\r\n  LV Creation host, time ubuntu-server, 2023-01-23 12:05:30 +0000\r\n  LV Status              available\r\n  # open                 1\r\n  LV Size                &lt;8.25 GiB\r\n  Current LE             2111\r\n  Segments               1\r\n  Allocation             inherit\r\n  Read ahead sectors     auto\r\n  - currently set to     256\r\n  Block device           253:0\r\n   \r\n  --- Physical volumes ---\r\n  PV Name               \/dev\/sda3     \r\n  PV UUID               4PjQ16-zoHj-rdHz-nNRB-y3RE-veOF-OpBF0h\r\n  PV Status             allocatable\r\n  Total PE \/ Free PE    2111 \/ 0\r\n   \r\n  Archiving volume group \"ubuntu-vg\" metadata (seqno 2).\r\n  Creating volume group backup \"\/etc\/lvm\/backup\/ubuntu-vg\" (seqno 2).\r\n  --- Volume group ---\r\n  VG Name               share_vg\r\n  System ID             \r\n  Format                lvm2\r\n  Metadata Areas        2\r\n  Metadata Sequence No  3\r\n  VG Access             read\/write\r\n  VG Status             resizable\r\n  MAX LV                0\r\n  Cur LV                1\r\n  Open LV               1\r\n  Max PV                0\r\n  Cur PV                2\r\n  Act PV                2\r\n  VG Size               &lt;19.98 GiB\r\n  PE Size               4.00 MiB\r\n  Total PE              5114\r\n  Alloc PE \/ Size       2557 \/ &lt;9.99 GiB\r\n  Free  PE \/ Size       2557 \/ &lt;9.99 GiB\r\n  VG UUID               dOSwDU-aF0S-DXsw-0dMt-7Coj-qZKB-3iPmPo\r\n   \r\n  --- Logical volume ---\r\n  LV Path                \/dev\/share_vg\/share_lv\r\n  LV Name                share_lv\r\n  VG Name                share_vg\r\n  LV UUID                tWiGhf-0pQ3-TLcO-XCco-747i-Kj1y-gu2Mox\r\n  LV Write Access        read\/write\r\n  LV Creation host, time nas, 2023-01-29 01:10:01 +0000\r\n  LV Status              available\r\n  # open                 1\r\n  LV Size                &lt;9.99 GiB\r\n  Current LE             2557\r\n  Segments               1\r\n  Allocation             inherit\r\n  Read ahead sectors     auto\r\n  - currently set to     256\r\n  Block device           253:1\r\n   \r\n  --- Physical volumes ---\r\n  PV Name               \/dev\/md0     \r\n  PV UUID               MIB5IS-shvC-0upD-XtHA-DnHG-ZcvU-V6IKOJ\r\n  PV Status             allocatable\r\n  Total PE \/ Free PE    2557 \/ 0\r\n   \r\n  PV Name               \/dev\/md1     \r\n  PV UUID               3qr5un-Psa4-B31h-Jn11-H7qD-QgxW-OO58Rz\r\n  PV Status             allocatable\r\n  Total PE \/ Free PE    2557 \/ 2557\r\n   \r\n# \r\n# df -h\r\nFilesystem                         Size  Used Avail Use% Mounted on\r\ntmpfs                              198M  1.2M  197M   1% \/run\r\n\/dev\/mapper\/ubuntu--vg-ubuntu--lv  8.1G  4.3G  3.4G  57% \/\r\ntmpfs                              988M     0  988M   0% \/dev\/shm\r\ntmpfs                              5.0M     0  5.0M   0% \/run\/lock\r\n\/dev\/sda2                          1.7G  127M  1.5G   8% \/boot\r\n\/dev\/mapper\/share_vg-share_lv      9.8G   24K  9.3G   1% \/mnt\/share\r\ntmpfs                              198M  4.0K  198M   1% \/run\/user\/1000\r\n# \r\n<\/code><\/pre>\n<\/div>\n<h2>LVM [ Logical Volume extend ]<\/h2>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Bash\"><code># lvdisplay\r\n  --- Logical volume ---\r\n  LV Path                \/dev\/ubuntu-vg\/ubuntu-lv\r\n  LV Name                ubuntu-lv\r\n  VG Name                ubuntu-vg\r\n  LV UUID                QcRHWC-mFve-QL2e-Exi4-C6j3-PKnR-AhJjuY\r\n  LV Write Access        read\/write\r\n  LV Creation host, time ubuntu-server, 2023-01-23 12:05:30 +0000\r\n  LV Status              available\r\n  # open                 1\r\n  LV Size                &lt;8.25 GiB\r\n  Current LE             2111\r\n  Segments               1\r\n  Allocation             inherit\r\n  Read ahead sectors     auto\r\n  - currently set to     256\r\n  Block device           253:0\r\n   \r\n  --- Logical volume ---\r\n  LV Path                \/dev\/share_vg\/share_lv\r\n  LV Name                share_lv\r\n  VG Name                share_vg\r\n  LV UUID                tWiGhf-0pQ3-TLcO-XCco-747i-Kj1y-gu2Mox\r\n  LV Write Access        read\/write\r\n  LV Creation host, time nas, 2023-01-29 01:10:01 +0000\r\n  LV Status              available\r\n  # open                 1\r\n  LV Size                &lt;9.99 GiB\r\n  Current LE             2557\r\n  Segments               1\r\n  Allocation             inherit\r\n  Read ahead sectors     auto\r\n  - currently set to     256\r\n  Block device           253:1\r\n   \r\n# \r\n# lvextend -l +100%FREE \/dev\/share_vg\/share_lv\r\n  Size of logical volume share_vg\/share_lv changed from &lt;9.99 GiB (2557 extents) to &lt;19.98 GiB (5114 extents).\r\n  Logical volume share_vg\/share_lv successfully resized.\r\n# <\/code><\/pre>\n<\/div>\n<h2>LVM [ Logical Volume Resize ]<\/h2>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Bash\"><code># df -h\r\nFilesystem                         Size  Used Avail Use% Mounted on\r\ntmpfs                              198M  1.2M  197M   1% \/run\r\n\/dev\/mapper\/ubuntu--vg-ubuntu--lv  8.1G  4.3G  3.4G  57% \/\r\ntmpfs                              988M     0  988M   0% \/dev\/shm\r\ntmpfs                              5.0M     0  5.0M   0% \/run\/lock\r\n\/dev\/sda2                          1.7G  127M  1.5G   8% \/boot\r\n\/dev\/mapper\/share_vg-share_lv      9.8G   24K  9.3G   1% \/mnt\/share\r\ntmpfs                              198M  4.0K  198M   1% \/run\/user\/1000\r\n# \r\n# resize2fs \/dev\/share_vg\/share_lv\r\nresize2fs 1.46.5 (30-Dec-2021)\r\nFilesystem at \/dev\/share_vg\/share_lv is mounted on \/mnt\/share; on-line resizing required\r\nold_desc_blocks = 2, new_desc_blocks = 3\r\nThe filesystem on \/dev\/share_vg\/share_lv is now 5236736 (4k) blocks long.\r\n\r\n# \r\n# df -h\r\nFilesystem                         Size  Used Avail Use% Mounted on\r\ntmpfs                              198M  1.2M  197M   1% \/run\r\n\/dev\/mapper\/ubuntu--vg-ubuntu--lv  8.1G  4.3G  3.4G  57% \/\r\ntmpfs                              988M     0  988M   0% \/dev\/shm\r\ntmpfs                              5.0M     0  5.0M   0% \/run\/lock\r\n\/dev\/sda2                          1.7G  127M  1.5G   8% \/boot\r\n\/dev\/mapper\/share_vg-share_lv       20G   24K   19G   1% \/mnt\/share\r\ntmpfs                              198M  4.0K  198M   1% \/run\/user\/1000\r\n# \r\n<\/code><\/pre>\n<\/div>\n<h2>reboot and check<\/h2>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Bash\"><code># cat \/proc\/mdstat\r\nPersonalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10] \r\nmd1 : active raid1 sde1[1] sdd1[0]\r\n      10474496 blocks super 1.2 [2\/2] [UU]\r\n      \r\nmd0 : active raid1 sdb1[0] sdc1[1]\r\n      10474496 blocks super 1.2 [2\/2] [UU]\r\n      \r\nunused devices: <none>\r\n# ls -l \/dev\/md*\r\nbrw-rw---- 1 root disk 9, 0 Jan 29 12:41 \/dev\/md0\r\nbrw-rw---- 1 root disk 9, 1 Jan 29 12:41 \/dev\/md1\r\n# \r\n# df -h\r\nFilesystem                         Size  Used Avail Use% Mounted on\r\ntmpfs                              198M  1.2M  197M   1% \/run\r\n\/dev\/mapper\/ubuntu--vg-ubuntu--lv  8.1G  4.3G  3.4G  57% \/\r\ntmpfs                              988M     0  988M   0% \/dev\/shm\r\ntmpfs                              5.0M     0  5.0M   0% \/run\/lock\r\n\/dev\/sda2                          1.7G  127M  1.5G   8% \/boot\r\n\/dev\/mapper\/share_vg-share_lv       20G   24K   19G   1% \/mnt\/share\r\ntmpfs                              198M  4.0K  198M   1% \/run\/user\/1000\r\n# <\/none><\/code><\/pre>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Overview \u65e2\u5b58\u306e LVM Volume Group \u306b\u65b0\u306b\u8ffd\u52a0\u3057\u305f RAID 1 Array (md1) \u3092\u8ffd\u52a0\u3059\u308b\u3002 Storage Diagram Reference Ubuntu LVM on RAID1  [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[148,156],"tags":[],"class_list":["post-3020","post","type-post","status-publish","format-standard","hentry","category-lvm","category-raid"],"_links":{"self":[{"href":"https:\/\/rlab.cavtime.net\/index.php?rest_route=\/wp\/v2\/posts\/3020","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rlab.cavtime.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rlab.cavtime.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rlab.cavtime.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/rlab.cavtime.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3020"}],"version-history":[{"count":1,"href":"https:\/\/rlab.cavtime.net\/index.php?rest_route=\/wp\/v2\/posts\/3020\/revisions"}],"predecessor-version":[{"id":3021,"href":"https:\/\/rlab.cavtime.net\/index.php?rest_route=\/wp\/v2\/posts\/3020\/revisions\/3021"}],"wp:attachment":[{"href":"https:\/\/rlab.cavtime.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3020"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rlab.cavtime.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3020"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rlab.cavtime.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3020"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}