LVMシステムでの論理ボリュームの名前変更

スポンサーリンク

LVMシステム上にある論理ボリュームの名前変更の方法です。

検証した環境

$ cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
$ uname -r
5.15.56-v8+

論理ボリュームの名前変更

$ sudo lvdisplay /dev/vg00/lvdata1
  --- Logical volume ---
  LV Path                /dev/vg00/lvdata1
  LV Name                lvdata1
  VG Name                vg00
  LV UUID                xxxxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxxxx
  LV Write Access        read/write
  LV Creation host, time localhost, 2022-08-31 23:04:18 +0900
  LV Status              available
  # open                 1
  LV Size                1.00 GiB
  Current LE             256
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:4
   
$ sudo lvrename /dev/vg00/lvdata1 /dev/vg00/lvdata2
  Renamed "lvdata1" to "lvdata2" in volume group "vg00"
$ sudo lvdisplay /dev/vg00/lvdata2
  --- Logical volume ---
  LV Path                /dev/vg00/lvdata2
  LV Name                lvdata2
  VG Name                vg00
  LV UUID                xxxxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxxxx
  LV Write Access        read/write
  LV Creation host, time localhost, 2022-08-31 23:04:18 +0900
  LV Status              available
  # open                 1
  LV Size                1.00 GiB
  Current LE             256
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:4