Bài đăng

Hiển thị các bài đăng có nhãn LVM

Fix Redhat/CentOS use only 6GB for root space

I have marked the steps with <<#>> in the block below, so the are not a part of the command. You need root permissions, so do a "sudo sh" if you are not root. <<1>> Look at the filesystem, it is 6G <<2>> Look at the disk and the partition, the disk is 21.5 GB but the partition is 6 GB (6291456 blocks) <<3>> Start fdisk for that disk (xvda, so not the partition xvda1) <<4>> Switch to sector display. <<5>> Print the partition(s), and remember the start sector (2048 in the example). <<6>> Delete the partition. <<7>> Create a new partition. <<8>> Make it primary. <<9>> First partition. <<10>> Enter the old start sector, do NOT make any typo here!!! (2048 in the example)  <<11>> Hit enter to accept the default (this is the remainder of the disk) <<12>> Print the changes and make sure the start sector is ok, if not restart at ...

How to resize LVM logical volumes with ext4 as filesystem

Ever been in the situation where you needed to save some important files to a server and your greeted with “Not enough space left on device”-kind messages? No? Well, as that happened too often too me for my liking, I decided to do it right this time when I set up my home server and use logical volume manager (LVM) straight from the start. So basically, all I had to do was to shrink a filesystem that had free space in it and its partition (logical volume (LV) to be precisely) afterwards and then to resize the logical volume/filesystem where I needed the space. As all the necessary tools are available normally on a system with LVM support, I could dive right in:   # Unmount the filesystem and check its' LV umount /mnt/foo e2fsck -f /dev/mapper/vg0-foo   # Shrink ext4 and then the LV to the desired size resize2fs -p /dev/mapper/vg0-foo 40G lvreduce -L 40G /dev/mapper/vg0-foo   # Before continuing, run e2fsck. If it bails because the parti...

How to resize or expand LVM partitions

A few week ago, I installed FC6 on my laptop and my slash (/) partition started to run out of space. So I decided that I would shrink my big partition and expand my / partition. Fortunately, I installed FC6 using LVM2 (Logical Volume Manager) which makes it very easy to resize partitions without even rebooting. Here is how I did. My partition was like this: Filesystem                  1K-blocks    Used    Available    Use%    Mounted on /dev/mapper/VolGroup00-LogVol00    7935392    6773500    752292    91%    / /dev/sda5                    497829      20904    451223      5%     ...

How to Increase the size of a Linux LVM by expanding the virtual machine disk

Hình ảnh
This post will cover how to increase the disk space for a VMware virtual machine running Linux that is using logical volume manager (LVM). Firstly we will be increasing the size of the actual disk on the VMware virtual machine, so at the hardware level – this is the VM’s .vmdk file. Once this is complete we will get into the virtual machine and make the necessary changes through the operating system in order to take advantage of the additional space that has been provided by the hard drive being extended. This will involve creating a new partition with the new space, expanding the volume group and logical group, then finally resizing the file system. As there are a number of different ways to increase disk space I have also posted some different methods here: Use GParted to increase disk size of a Linux native partition – In this article the virtual disk is expanded, however there is no LVM here just a Linux native partition that is expanded with the GParted live C...