root ディスク拡張 & 追加データボリューム & Block storage のシステムリストア例¶
はじめに¶
- rootディスク拡張 & 追加データボリューム & Block strorage 構成のシステムリストア検証結果、手順を記載します。
- 今回の検証構成
システムリストア 元構成 | システムリストア 先構成 | |||||
ブロックデバイス | mount | 備考 | ブロックデバイス | mount | 備考 | |
vda | /boot | 500MB | ⇒ | vda | /mnt/boot | 500MB |
/ | 残り全て | /mnt | 残り全て | |||
/var | 50GB | /mnt/var | 50GB | |||
swap | 8GB | swap | 8GB | |||
vdb | /var/log1 | additional disk(15GB) | vdb | temporary os | ||
vdc | /mnt/var/log1 | additional disk(15GB) | ||||
sda
sdb
|
/var/log2 | src 側iscsi | sda
sdb
|
/mnt/var/log2 | dest側iscsi |
事前準備¶
バックアップ元vmの構築¶
- OSイメージ: RedHatEnterpriseLinux-7.3_64_include-license_virtual-server_12
- root disk: ディスクを100GBとしたいので、イメージ直接起動ではなく100GBボリュームにイメージをマウントし、ブータブルボリュームを作成します。
- 追加データボリューム: 15GB空ディスク
- Block Storage: 100GB
手順¶
- 現状の構成と空き領域を確認します。(100GBボリュームでオフィシャルテンプレートを起動しても、40GBまでしか領域がない)
[root@test ~]# parted /dev/vda
GNU Parted 3.1
Using /dev/vda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit MB
(parted) print
Model: Virtio Block Device (virtblk)
Disk /dev/vda: 107374MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1.05MB 525MB 524MB primary ext4 boot
2 525MB 42950MB 42424MB primary lvm
(parted) print free
Model: Virtio Block Device (virtblk)
Disk /dev/vda: 107374MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
0.03MB 1.05MB 1.02MB Free Space
1 1.05MB 525MB 524MB primary ext4 boot
2 525MB 42950MB 42424MB primary lvm
42950MB 107374MB 64425MB Free Space
(parted)
- #2のパーティションを削除して、free space を使って、パーティションを切りなおします。
(parted) rm 2
Error: Partition(s) 2 on /dev/vda have been written, but we have been unable to inform the kernel of the change, probably because
it/they are in use. As a result, the old partition(s) will remain in use. You should reboot now before making further changes.
Ignore/Cancel? Ignore
(parted) print
Model: Virtio Block Device (virtblk)
Disk /dev/vda: 107374MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1.05MB 525MB 524MB primary ext4 boot
(parted) print free
Model: Virtio Block Device (virtblk)
Disk /dev/vda: 107374MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
0.03MB 1.05MB 1.02MB Free Space
1 1.05MB 525MB 524MB primary ext4 boot
525MB 107374MB 106849MB Free Space
(parted) mkpart primary 525 107374
Error: Partition(s) 2 on /dev/vda have been written, but we have been unable to inform the kernel of the change, probably because
it/they are in use. As a result, the old partition(s) will remain in use. You should reboot now before making further changes.
Ignore/Cancel? Ignore
(parted) print
Model: Virtio Block Device (virtblk)
Disk /dev/vda: 107374MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1.05MB 525MB 524MB primary ext4 boot
2 525MB 107374MB 106849MB primary
- 作成したパーティションにて lvm フラグをONにします。
(parted) set 2 lvm on
Error: Partition(s) 2 on /dev/vda have been written, but we have been unable to inform the kernel of the change, probably because
it/they are in use. As a result, the old partition(s) will remain in use. You should reboot now before making further changes.
Ignore/Cancel? Ignore
(parted) print
Model: Virtio Block Device (virtblk)
Disk /dev/vda: 107374MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1.05MB 525MB 524MB primary ext4 boot
2 525MB 107374MB 106849MB primary lvm
(parted)
- pvscan でlvmのサイズ確認。この時点ではまだ拡張前のサイズが表示されます。
[root@test ~]# pvscan
PV /dev/vda2 VG rhel lvm2 [39.51 GiB / 0 free]
Total: 1 [39.51 GiB] / in use: 1 [39.51 GiB] / in no VG: 0 [0 ]
- pvresize および OS再起動しlvmのサイズ拡張します。
[root@test ~]# pvresize /dev/vda2
Physical volume "/dev/vda2" changed
1 physical volume(s) resized / 0 physical volume(s) not resized
[root@test ~]# reboot
- reboot完了後、拡張後サイズ確認します。
[root@test ~]# pvscan
PV /dev/vda2 VG rhel lvm2 [99.51 GiB / 60.00 GiB free]
Total: 1 [99.51 GiB] / in use: 1 [99.51 GiB] / in no VG: 0 [0 ]
- 論理ボリュームを拡張します。(/var は50GB、 / は残りすべて)
[root@test ~]# lvextend -L50G /dev/mapper/rhel-var
Size of logical volume rhel/var changed from 10.00 GiB (2560 extents) to 50.00 GiB (12800 extents).
Logical volume rhel/var successfully resized.
[root@test ~]# lvextend -l +100%FREE /dev/mapper/rhel-root
Size of logical volume rhel/root changed from 21.51 GiB (5506 extents) to 41.51 GiB (10626 extents).
Logical volume rhel/root successfully resized.
[root@test ~]# display -C
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
root rhel -wi-ao---- 41.51g
swap rhel -wi-ao---- 8.00g
var rhel -wi-ao---- 50.00g
- ファイルシステムを確認し拡張します。
[root@test ~]# df -T
Filesystem Type 1K-blocks Used Available Use% Mounted on
/dev/mapper/rhel-root ext4 22067024 1051120 19871892 6% /
devtmpfs devtmpfs 1947132 0 1947132 0% /dev
tmpfs tmpfs 1957928 0 1957928 0% /dev/shm
tmpfs tmpfs 1957928 8528 1949400 1% /run
tmpfs tmpfs 1957928 0 1957928 0% /sys/fs/cgroup
/dev/mapper/rhel-var ext4 10190100 83832 9565596 1% /var
/dev/vda1 ext4 487634 109629 348309 24% /boot
tmpfs tmpfs 391588 0 391588 0% /run/user/0
[root@test ~]# resize2fs /dev/mapper/rhel-var
resize2fs 1.42.9 (28-Dec-2013)
Filesystem at /dev/mapper/rhel-var is mounted on /var; on-line resizing required
old_desc_blocks = 2, new_desc_blocks = 7
The filesystem on /dev/mapper/rhel-var is now 13107200 blocks long.
[root@test ~]# resize2fs /dev/mapper/rhel-root
resize2fs 1.42.9 (28-Dec-2013)
Filesystem at /dev/mapper/rhel-root is mounted on /; on-line resizing required
old_desc_blocks = 3, new_desc_blocks = 6
The filesystem on /dev/mapper/rhel-root is now 10881024 blocks long.
[root@test ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rhel-root 41G 1.1G 38G 3% /
devtmpfs 1.9G 0 1.9G 0% /dev
tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs 1.9G 8.4M 1.9G 1% /run
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
/dev/mapper/rhel-var 50G 98M 47G 1% /var
/dev/vda1 477M 108M 341M 24% /boot
tmpfs 383M 0 383M 0% /run/user/0
- データディスク15GB(/dev/vdb)をアタッチしてマウントします。
[root@test ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rhel-root 41G 1.1G 38G 3% /
devtmpfs 1.9G 0 1.9G 0% /dev
tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs 1.9G 8.4M 1.9G 1% /run
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
/dev/mapper/rhel-var 50G 99M 47G 1% /var
/dev/vda1 477M 108M 341M 24% /boot
tmpfs 383M 0 383M 0% /run/user/0
[root@test ~]# fdisk -l
Disk /dev/vda: 107.4 GB, 107374182400 bytes, 209715200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000d7819
Device Boot Start End Blocks Id System
/dev/vda1 * 2048 1026047 512000 83 Linux
/dev/vda2 1026048 209715199 104344576 8e Linux LVM
Disk /dev/mapper/rhel-var: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/rhel-root: 44.6 GB, 44568674304 bytes, 87048192 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/rhel-swap: 8589 MB, 8589934592 bytes, 16777216 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/vdb: 16.1 GB, 16106127360 bytes, 31457280 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
[root@test ~]# /sbin/mkfs.ext4 /dev/vdb
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
983040 inodes, 3932160 blocks
196608 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2151677952
120 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
[root@test ~]# blkid
/dev/vda1: UUID="(root diskのUUIDを表示)" TYPE="ext4"
/dev/vda2: UUID="(root diskのUUIDを表示)" TYPE="LVM2_member"
/dev/mapper/rhel-var: UUID="(lvmのUUIDを表示)" TYPE="ext4"
/dev/mapper/rhel-root: UUID="(lvmのUUIDを表示)" TYPE="ext4"
/dev/mapper/rhel-swap: UUID="(lvmのUUIDを表示)" TYPE="swap"
/dev/vdb: UUID="(追加ボリュームのUUID)" TYPE="ext4"
[root@test ~]# mkdir /var/log1
[root@test ~]# mount -t ext4 UUID="(追加ボリュームのUUIDを表示)" /var/log1
[root@test ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rhel-root 41G 1.1G 38G 3% /
devtmpfs 1.9G 0 1.9G 0% /dev
tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs 1.9G 8.4M 1.9G 1% /run
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
/dev/mapper/rhel-var 50G 99M 47G 1% /var
/dev/vda1 477M 108M 341M 24% /boot
tmpfs 383M 0 383M 0% /run/user/0
/dev/vdb 15G 41M 14G 1% /var/log1
- 同様にブロックストレージをアタッチしてマウントする。ブロックストレージの チュートリアル に従って、multipath の設定まで実施しておきます。
[root@test ~]# fdisk -l
Disk /dev/vda: 107.4 GB, 107374182400 bytes, 209715200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000d7819
Device Boot Start End Blocks Id System
/dev/vda1 * 2048 1026047 512000 83 Linux
/dev/vda2 1026048 209715199 104344576 8e Linux LVM
Disk /dev/vdb: 16.1 GB, 16106127360 bytes, 31457280 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/rhel-var: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/rhel-root: 44.6 GB, 44568674304 bytes, 87048192 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/rhel-swap: 8589 MB, 8589934592 bytes, 16777216 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/sdb: 107.4 GB, 107389255680 bytes, 209744640 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 4096 bytes / 65536 bytes
Disk /dev/sda: 107.4 GB, 107389255680 bytes, 209744640 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 4096 bytes / 65536 bytes
Disk /dev/mapper/(ブロックストレージUUID): 107.4 GB, 107389255680 bytes, 209744640 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 4096 bytes / 65536 bytes
[root@test ~]# mkfs.ext4 /dev/mapper/(ブロックストレージUUID)
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=16 blocks
6561792 inodes, 26218080 blocks
1310904 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2174746624
801 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872
Allocating group tables: 0/801 done
Writing inode tables: 0/801 done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: 0/801 done
[root@test ~]# mkdir /var/log2
[root@test ~]# blkid
/dev/vda1: UUID="(root diskのUUIDを表示)" TYPE="ext4"
/dev/vda2: UUID="(root diskのUUIDを表示)" TYPE="LVM2_member"
/dev/mapper/rhel-var: UUID="(lvmのUUIDを表示)" TYPE="ext4"
/dev/vdb: UUID="(追加ボリュームのUUID)" TYPE="ext4"
/dev/mapper/rhel-root: UUID="(lvmのUUIDを表示)" TYPE="ext4"
/dev/mapper/rhel-swap: UUID="(lvmのUUIDを表示)" TYPE="swap"
/dev/mapper/(ブロックストレージUUID): UUID="(ブロックストレージボリュームUUID)" TYPE="ext4"
[oot@test ~]# mount -t ext4 UUID="(ブロックストレージボリュームUUID)" /var/log2
[oot@test ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rhel-root 41G 1.1G 38G 3% /
devtmpfs 1.9G 0 1.9G 0% /dev
tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs 1.9G 8.4M 1.9G 1% /run
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
/dev/mapper/rhel-var 50G 1.4G 46G 3% /var
/dev/vda1 477M 107M 341M 24% /boot
/dev/vdb 15G 41M 14G 1% /var/log1
tmpfs 383M 0 383M 0% /run/user/0
/dev/mapper/(ブロックストレージUUID) 99G 61M 94G 1% /var/log2
リストア先vmの構築¶
- OSイメージ: Full-System-Restore_for_RHEL_v2.0
- root disk: ディスクを100GBとしたいので、イメージ直接起動ではなく100GBボリュームにイメージをマウントし、ブータブルボリュームを作成します。
- 追加データボリューム: 15GB空ディスク
- Block storage: 100GB
手順¶
- rootディスクのパーティション#1を削除し、新たに boot 領域500MBを作成します。
[root@test2(FSR)]# parted /dev/vda
GNU Parted 3.1
Using /dev/vda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit B
(parted) print
Model: Virtio Block Device (virtblk)
Disk /dev/vda: 107374182400B
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1048576B 10738466815B 10737418240B primary xfs boot
(parted) rm 1
(parted) print
Model: Virtio Block Device (virtblk)
Disk /dev/vda: 107374182400B
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
(parted)
(parted) mkpart primary 1048576B 525336575B
(parted) print
Model: Virtio Block Device (virtblk)
Disk /dev/vda: 107374182400B
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1048576B 525336575B 524288000B primary xfs # file system が xfs になっているが、後でext4 に変更行う。
(parted) set 1 boot on
print
Model: Virtio Block Device (virtblk)
Disk /dev/vda: 107374182400B
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1048576B 525336575B 524288000B primary xfs boot
(parted)
- rootディスクの free space を lvm 化します。
[root@test2(FSR)]# parted /dev/vda
GNU Parted 3.1
Using /dev/vda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print free
Model: Virtio Block Device (virtblk)
Disk /dev/vda: 107374MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
0.03MB 1.05MB 1.02MB Free Space
1 1.05MB 525MB 524MB primary xfs boot
525MB 107374MB 106849MB Free Space
(parted) mkpart primary 525MB 107374MB
(parted) print
Model: Virtio Block Device (virtblk)
Disk /dev/vda: 107374MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1.05MB 525MB 524MB primary xfs boot
2 525MB 107374MB 106849MB primary
(parted) set 2 lvm on
(parted) print
Model: Virtio Block Device (virtblk)
Disk /dev/vda: 107374MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1.05MB 525MB 524MB primary xfs boot
2 525MB 107374MB 106849MB primary lvm
(parted)
- bootのファイルシステムを ext4 へ変換します。
[root@test2(FSR)]# mkfs -t ext4 /dev/vda1
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
128016 inodes, 512000 blocks
25600 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=34078720
63 block groups
8192 blocks per group, 8192 fragments per group
2032 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409
Allocating group tables: done
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
- PV(Physical Volume)および VG(Volume Group)を作成します。
[root@test2(FSR)]# pvcreate /dev/vda2
Physical volume "/dev/vda2" successfully created.
[root@test2(FSR)]# pvscan
PV /dev/vda2 lvm2 [99.51 GiB]
Total: 1 [99.51 GiB] / in use: 0 [0 ] / in no VG: 1 [99.51 GiB]
[root@test2(FSR)]# vgcreate rhel /dev/vda2
[root@test2(FSR)]# pvscan
PV /dev/vda2 VG rhel lvm2 [99.51 GiB / 99.51 GiB free]
Total: 1 [99.51 GiB] / in use: 1 [99.51 GiB] / in no VG: 0 [0 ]
- LV(Logical Volume)を作成します。
[root@test2(FSR)]# lvcreate --name var 50G rhel
Logical volume "var" created.
[root@test2(FSR)]# lvcreate --name swap --size 8G rhel
Logical volume "swap" created.
[root@test2(FSR)]# lvcreate --name root -l 100%FREE rhel
Logical volume "root" created.
- swap領域の作成します。
[root@test2(FSR)]# mkswap /dev/rhel/swap
Setting up swapspace version 1, size = 8388604 KiB
no label, UUID=(root diskのUUIDを表示)
[root@test2(FSR)]# swapon /dev/rhel/swap
[root@test2(FSR)]# free
total used free shared buff/cache available
Mem: 3915860 136276 3579488 49588 200096 3529108
Swap: 8388604 0 8388604
[root@test2(FSR)]# cat /proc/swaps
Filename Type Size Used Priority
/dev/dm-1 partition 8388604 0 -1
- ファイルシステムの作成します。
[root@test2(FSR)]# mkfs -t ext4 /dedev/rhel/root
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
2722608 inodes, 10881024 blocks
544051 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2160066560
333 block groups
32768 blocks per group, 32768 fragments per group
8176 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624
Allocating group tables: 0/333 done
Writing inode tables: 0/333 done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: 0/333 done
[root@test2(FSR)]# mkfs -t ext4 /dev/rhel/var
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
3276800 inodes, 13107200 blocks
655360 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2162163712
400 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424
Allocating group tables: 0/400 done
Writing inode tables: 0/400 done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: 0/400 done
- ファイルシステムのマウントします。
[root@test2(FSR) ~]# mount /dev/rhel/root /mnt
[root@test2(FSR) ~]# mkdir /mnt/boot
[root@test2(FSR) ~]# mount /dev/vda1 /mnt/boot
[root@test2(FSR) ~]# mkdir /mnt/var
[root@test2(FSR) ~]# mount /dev/rhel/var /mnt/var
[root@test2(FSR) ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vdb1 15G 1.1G 14G 8% /
devtmpfs 1.8G 0 1.8G 0% /dev
tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs 1.9G 8.4M 1.9G 1% /run
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
tmpfs 383M 0 383M 0% /run/user/0
/dev/mapper/rhel-root 41G 49M 39G 1% /mnt
/dev/vda1 477M 2.3M 445M 1% /mnt/boot
/dev/mapper/rhel-var 50G 53M 47G 1% /mnt/var
- 追加データボリュームをアタッチし、マウントします。
[root@test2(FSR) ~]# /sbin/mkfs.ext4 /dev/vdc
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
983040 inodes, 3932160 blocks
196608 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2151677952
120 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208
Allocating group tables: 0/120 done
Writing inode tables: 0/120 done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: 0/120 done
[root@test2(FSR) ~]# mkdir /mnt/var/log1
[root@test2(FSR) ~]# blkid
/dev/vda1: UUID="(root diskのUUIDを表示)" TYPE="ext4"
/dev/vdb1: UUID="(root diskのUUIDを表示)" TYPE="ext2"
/dev/vda2: UUID="(root diskのUUIDを表示)" TYPE="LVM2_member"
/dev/mapper/rhel-var: UUID="(lvmのUUIDを表示)" TYPE="ext4"
/dev/mapper/rhel-swap: UUID="(lvmのUUIDを表示)" TYPE="swap"
/dev/mapper/rhel-root: UUID="(lvmのUUIDを表示)" TYPE="ext4"
/dev/vdc: UUID="(追加ボリュームのUUID)" TYPE="ext4"
[root@test2(FSR) ~]# mount -t ext4 UUID="(追加ボリュームのUUID)" /mnt/var/log1
[root@test2(FSR) ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vdb1 15G 1.1G 14G 8% /
devtmpfs 1.8G 0 1.8G 0% /dev
tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs 1.9G 8.4M 1.9G 1% /run
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
tmpfs 383M 0 383M 0% /run/user/0
/dev/mapper/rhel-root 41G 49M 39G 1% /mnt
/dev/vda1 477M 2.3M 445M 1% /mnt/boot
/dev/mapper/rhel-var 50G 53M 47G 1% /mnt/var
/dev/vdc 15G 41M 14G 1% /mnt/var/log1
- 同様にブロックスストレージをマウントします。ブロックストレージの チュートリアル に従って、multipath の設定まで実施しておきます。
[root@test2(FSR) ~]# mkfs.ext4 /dev/mapper/(ブロックストレージUUID)
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=16 blocks
6561792 inodes, 26218080 blocks
1310904 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2174746624
801 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872
Allocating group tables: 0/801 done
Writing inode tables: 0/801 done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: 0/801 done
[root@test2(FSR) ~]# mkdir /mnt/var/log2
[root@test2(FSR) ~]# mount /dev/mapper/(ブロックストレージUUID) /mnt/var/log2
[root@test2(FSR) ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vdb1 15G 1.1G 13G 8% /
devtmpfs 1.8G 0 1.8G 0% /dev
tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs 1.9G 8.4M 1.9G 1% /run
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
tmpfs 383M 0 383M 0% /run/user/0
/dev/mapper/rhel-root 41G 49M 39G 1% /mnt
/dev/vda1 477M 2.3M 445M 1% /mnt/boot
/dev/mapper/rhel-var 50G 53M 47G 1% /mnt/var
/dev/vdc 15G 41M 14G 1% /mnt/var/log1
/dev/mapper/(ブロックストレージUUID) 99G 61M 94G 1% /mnt/var/log2
システムリストアの実行¶
- システムリストアを実行する。なお、Config preset は "custom settings”を選択します。
- リストア先を reboot する前に /mnt/etc/fstab (reboot後の /etc/fstab) を開き、ブロックストレージのマウントオプションで "_netdev" を指定します。
[root@test2(FSR) ~]# /mnt/etc/fstab
UUID=(lvmのUUIDを表示) / ext4 defaults 1 1
UUID=(root diskのUUIDを表示) /boot ext4 defaults 0 0
UUID=(lvmのUUIDを表示)d /var ext4 defaults 0 0
UUID=(追加ボリュームのUUID)/var/log1 ext4 defaults 0 0
/dev/mapper/(lvmのUUIDを表示) /var/log2 ext4 _netdev 0 0
UUID=(lvmのUUIDを表示) swap swap defaults 0 0
- /mnt/etc/iscsi/initiatorname.iscsi の initiatorname(元々はリストア先ブロックストレージに設定されていたもの) がリストア先のブロックストレージに設定されていること、バックアップ元のブロックストレージに設定されていないことを確認する。(リストア先, バックアップ元両方に同じ initiatornameが設定されているとmultipath 設定ができません。)
- OS起動後、ブロックストレージの チュートリアル に従って、multipath 設定をします。