How to shrink the root volume on a Scientific Linux (RHEL6) installation:
- Make backups first. This could trash your Linux installation if something goes wrong.
- Get the appropriate rescue disk (boot.iso) fromhttp://www.scientificlinux.org/download/. In my case, this was this file
- Burn it to CD.
- Boot your server from the rescue CD
- Choose the ‘rescue installed system’ option
- When prompted about mounting system partitions, choose to ‘Skip’.
Once you get a shell, do something like the following:
# Bring up the volume group
vgchange -a y# fsck the root filesystem
e2fsck -f /dev/<vgname>/<lvname># shrink the root filesystem (ensuring you leave enough space for its data, obviously)
resize2fs /dev/<vgname><lvname> <size>G# shrink the logical volume
lvreduce -L<size>G /dev/<vgname>/<lvname>- Reboot and check it has worked okay.
------------------------------------------------------------------------------------------------------------
How to resize root file system on RHEL 6
Here is the list of steps to reduce the root file system (lv_root) on a RHEL 6 Linux server:
- Boot the system into rescue mode. Do not mount the file systems (select the option to 'Skip' in the rescue mode and start a shell)
- Bring the Volume Group online
- #lvm vgchange -a -y
- Run fsck on the FS
- #e2fsck -f /dev/vg_myhost/lv_root
- Resize the file system with new size
- #resize2fs -f /dev/vg_myhost/lv_root 20G
- Reduce the Logical Volume of the FS with the new size
- #lvreduce -L20G /dev/vg_myhost/lv_root
- Run fsck to make sure the FS is still ok
- #e2fsck -f /dev/vg_myhost/lv_root
- Optionally mount the file system in the rescue mode
- #mkdir -p /mnt/sysimage/root
- #mount -t ext4 /dev/mapper/vg_myhost-lv_root /mnt/sysimage/root
- #cd /mnt/sysimage/root
- Unmount the FS
- #cd
- #umount /mnt/sysimage/root
- Exit rescue mode and boot the system from the hard disk
- #exit
- Select the reboot option from the recue mode
'OS > Linux' 카테고리의 다른 글
Windows 파일공유(SMB) 대체를 위한 SSHFS (0) | 2018.07.26 |
---|---|
[RHEL] RHEL 네트워크 설정 파일 파라미터 설명 (0) | 2017.03.26 |
[RHEL] RHEL7 네트워크 가이드 (0) | 2017.03.26 |
[REHL] Change display resolution in Linux (해상도 조정하는 방법) (0) | 2017.01.02 |
rfc1337 파라미터에 대해 (0) | 2016.05.23 |
[RHEL] /proc/sys/net/ipv4/* Variables (0) | 2014.12.26 |
[RHEL] TCP Parameter - ip_local_reserved_ports (0) | 2014.12.26 |
[RHEL] RHEL6 설치시 GUI Login (0) | 2014.08.28 |
[RHEL] What should go in password-auth vs system-auth in RHEL6? (0) | 2014.08.28 |
[RHEL] How to configure pam_tally2 to lock user account after certain number of failed login attempts ? (0) | 2014.08.28 |