- Talvez eu comece do começo, então eu tenho o OS Centos 7.3 com o estado abaixo
Resultado da execução do comando df -Th
Filesystem Type Size Used Avail Use% Mounted on /dev/vda1 xfs 30G 942M 30G 4% / devtmpfs devtmpfs 901M 0 901M 0% /dev tmpfs tmpfs 920M 0 920M 0% /dev/shm tmpfs tmpfs 920M 17M 904M 2% /run tmpfs tmpfs 920M 0 920M 0% /sys/fs/cgroup tmpfs tmpfs 184M 0 184M 0% /run/user/1000
e o arquivo grub.cnf
[...] menuentry 'CentOS Linux (3.10.0-514.16.1.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-514.16.1.el7.x86_64-advanced-29342a0b-e20f-4676-9ecf-dfdf02ef6683' { load_video set gfxpayload=keep insmod gzio insmod part_msdos insmod xfs set root='hd0,msdos1' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' 29342a0b-e20f-4676-9ecf-dfdf02ef6683 else search --no-floppy --fs-uuid --set=root 29342a0b-e20f-4676-9ecf-dfdf02ef6683 fi linux16 /boot/vmlinuz-3.10.0-514.16.1.el7.x86_64 root=UUID=29342a0b-e20f-4676-9ecf-dfdf02ef6683 ro console=tty0 console=ttyS0,115200n8 crashkernel=auto console=ttyS0,115200 LANG=en_US.UTF-8 initrd16 /boot/initramfs-3.10.0-514.16.1.el7.x86_64.img } menuentry 'CentOS Linux (0-rescue-8bd05758fdfc1903174c9fcaf82b71ca) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-8bd05758fdfc1903174c9fcaf82b71ca-advanced-29342a0b-e20f-4676-9ecf-dfdf02ef6683' { load_video insmod gzio insmod part_msdos insmod xfs set root='hd0,msdos1' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' 29342a0b-e20f-4676-9ecf-dfdf02ef6683 else search --no-floppy --fs-uuid --set=root 29342a0b-e20f-4676-9ecf-dfdf02ef6683 fi linux16 /boot/vmlinuz-0-rescue-8bd05758fdfc1903174c9fcaf82b71ca root=UUID=29342a0b-e20f-4676-9ecf-dfdf02ef6683 ro console=tty0 console=ttyS0,115200n8 crashkernel=auto console=ttyS0,115200 initrd16 /boot/initramfs-0-rescue-8bd05758fdfc1903174c9fcaf82b71ca.img } [...]
- Na próxima etapa, migro / particiono de boot de / dev / vda1 para uma partição separada (de acordo com link )
Filesystem Type Size Used Avail Use% Mounted on /dev/vda1 xfs 30G 1.1G 29G 4% / devtmpfs devtmpfs 901M 0 901M 0% /dev tmpfs tmpfs 920M 0 920M 0% /dev/shm tmpfs tmpfs 920M 17M 904M 2% /run tmpfs tmpfs 920M 0 920M 0% /sys/fs/cgroup /dev/vdc1 xfs 1020M 144M 877M 15% /boot tmpfs tmpfs 184M 0 184M 0% /run/user/1000
Ele está funcionando corretamente e o grub.cnf de / boot / grub2 se parece com:
[...] menuentry 'CentOS Linux (3.10.0-514.16.1.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-514.16.1.el7.x86_64-advanced-29342a0b-e20f-4676-9ecf-dfdf02ef6683' { load_video set gfxpayload=keep insmod gzio insmod part_msdos insmod xfs if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root b526cf02-6566-4a91-8027-13b3800d177f else search --no-floppy --fs-uuid --set=root b526cf02-6566-4a91-8027-13b3800d177f fi linux16 /vmlinuz-3.10.0-514.16.1.el7.x86_64 root=UUID=29342a0b-e20f-4676-9ecf-dfdf02ef6683 ro console=tty0 crashkernel=auto console=ttyS0,115200 initrd16 /initramfs-3.10.0-514.16.1.el7.x86_64.img } menuentry 'CentOS Linux (0-rescue-8bd05758fdfc1903174c9fcaf82b71ca) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-8bd05758fdfc1903174c9fcaf82b71ca-advanced-29342a0b-e20f-4676-9ecf-dfdf02ef6683' { load_video insmod gzio insmod part_msdos insmod xfs if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root b526cf02-6566-4a91-8027-13b3800d177f else search --no-floppy --fs-uuid --set=root b526cf02-6566-4a91-8027-13b3800d177f fi linux16 /vmlinuz-0-rescue-8bd05758fdfc1903174c9fcaf82b71ca root=UUID=29342a0b-e20f-4676-9ecf-dfdf02ef6683 ro console=tty0 crashkernel=auto console=ttyS0,115200 initrd16 /initramfs-0-rescue-8bd05758fdfc1903174c9fcaf82b71ca.img } if [ "x$default" = 'CentOS Linux (3.10.0-514.16.1.el7.x86_64) 7 (Core)' ]; then default='Advanced options for CentOS Linux>CentOS Linux (3.10.0-514.16.1.el7.x86_64) 7 (Core)'; fi; [...]
- Finnaly eu crio e migro para o LVM root, todos os comandos usados que colei anteriormente.
Comandos extras
$ mount /dev/mapper/vg00-root / $ mount -o rw,remount / $ cp /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.$(date +%m-%d-%H%M%S).bak $ dracut -f -v $ grub2-mkconfig -o /boot/grub2/grub.cfg
Então, o comando df -hT é exibido:
Filesystem Type Size Used Avail Use% Mounted on /dev/mapper/vg00-root xfs 30G 2.1G 28G 7% / devtmpfs devtmpfs 901M 0 901M 0% /dev tmpfs tmpfs 920M 0 920M 0% /dev/shm tmpfs tmpfs 920M 17M 904M 2% /run tmpfs tmpfs 920M 0 920M 0% /sys/fs/cgroup /dev/vdc1 xfs 1020M 179M 842M 18% /boot tmpfs tmpfs 184M 0 184M 0% /run/user/1000
e nas diretivas do arquivo grub.cnf muda para:
menuentry 'CentOS Linux (3.10.0-514.16.1.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-514.16.1.el7.x86_64-advanced-c81176da-6e61-44f0-afbc-93df72820140' { load_video set gfxpayload=keep insmod gzio insmod lvm insmod xfs set root='lvmid/T33gzF-WKVs-rUjx-Pieh-rZIU-pna5-JXF6bF/f0wezp-3C1o-03mr-CfaC-ZlAY-LyKH-Zcx8fg' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint='lvmid/T33gzF-WKVs-rUjx-Pieh-rZIU-pna5-JXF6bF/f0wezp-3C1o-03mr-CfaC-ZlAY-LyKH-Zcx8fg' c81176da-6e61-44f0-afbc-93df72820140 else search --no-floppy --fs-uuid --set=root c81176da-6e61-44f0-afbc-93df72820140 fi linux16 /boot/vmlinuz-3.10.0-514.16.1.el7.x86_64 root=/dev/mapper/vg00-root ro console=tty0 crashkernel=auto console=ttyS0,115200 initrd16 /boot/initramfs-3.10.0-514.16.1.el7.x86_64.img } menuentry 'CentOS Linux (0-rescue-8bd05758fdfc1903174c9fcaf82b71ca) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-8bd05758fdfc1903174c9fcaf82b71ca-advanced-c81176da-6e61-44f0-afbc-93df72820140' { load_video insmod gzio insmod lvm insmod xfs set root='lvmid/T33gzF-WKVs-rUjx-Pieh-rZIU-pna5-JXF6bF/f0wezp-3C1o-03mr-CfaC-ZlAY-LyKH-Zcx8fg' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint='lvmid/T33gzF-WKVs-rUjx-Pieh-rZIU-pna5-JXF6bF/f0wezp-3C1o-03mr-CfaC-ZlAY-LyKH-Zcx8fg' c81176da-6e61-44f0-afbc-93df72820140 else search --no-floppy --fs-uuid --set=root c81176da-6e61-44f0-afbc-93df72820140 fi linux16 /boot/vmlinuz-0-rescue-8bd05758fdfc1903174c9fcaf82b71ca root=/dev/mapper/vg00-root ro console=tty0 crashkernel=auto console=ttyS0,115200 initrd16 /boot/initramfs-0-rescue-8bd05758fdfc1903174c9fcaf82b71ca.img } if [ "x$default" = 'CentOS Linux (3.10.0-514.16.1.el7.x86_64) 7 (Core)' ]
mas agora, quando reinicio o sistema do servidor, inicio com partição antiga / raiz e está no estado RO. Alguma idéia?