Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I'm having a hell of a time here, not sure what is needed. So I've created a Centos VM on VirtualBox with the original HDD size of 8GB. I've since needed to make it larger, which was made to 25GB. After trying to increase the
"/dev/mapper/VolGroup-lv_root" filesystem I get the following error:
[user@services ~]$ sudo lvextend -L+5GB /dev/mapper/VolGroup-lv_root
Extending logical volume lv_root to 11.71 GiB
Insufficient free space: 1280 extents needed, but only 0 available
What am I missing here? I see that "/dev/sda" has increased but nothing to "/dev/mapper/VolGroup-lv_root". I'm lost of what needs to be completed.
Yes, the (virtualised) /dev/sda is partitioned into 2 partitions - presumably sda1 for /boot, and sda2 is for your LVM vg (currently holding lvs root and swap). For what you need to do, re-read post #2, then have a look at Logical_Volume_Manager_Administration on the RHEL site for a description of the LVM architecture as well as commands for admin. LVM is another layer of (device) virtualisation on top of everything else you've got virtualised.
/dev/sda is the drive, and it contains the partitions /dev/sda1 (a small boot partition with a file system containing the kernel and an initrd) and /dev/sda2 (an LVM Physical Volume).
The device nodes in /dev/mapper represent virtual LVM devices, and do not point to physical drives. The names indicate that you have one Volume Group called "VolGroup", and from this volume group, two Logical Volumes have been created: "VolGroup-lv_root" (must be the root file system) and "VolGroup-lv_swap" (a swap partition).
So you have one drive with two partitions, the latter of which is an LVM Physical Volume, serving as the only member of a Volume Group.
According to fdisk, the 2nd partition starts at block 64 and ends at block 7875584. You need to alter this partition so that it still starts at block 64, but covers the entire disk. Here's how you can do that:
Start fdisk with fdisk /dev/sda
Delete partition 2 by typing
d [Enter] (delete partition)
2 [Enter] (the partition number)
Recreate partition 2 by typing
n [Enter] (new partition)
p [Enter] (primary partition)
2 [Enter] (the partition number)
64 [Enter] (the start sector)
[Enter] (the end sector; the default is the end of the disk)
View the partition table with p [Enter]
If all looks OK, write the partition table to disk with w [Enter]
The partition has now been extended. fdisk doesn't touch the actual data on the disk when partitions are deleted and created, so as long as you create a new partition with the same number (2) starting at the same sector (64), the data inside that partition will still be valid.
The next step is to extend the data structures inside the Physical Volume to cover the entire partition, but you'll probably have to reboot first. You could try running partprobe, but you'll most likely get a message saying the partitions are in use, so the kernel will still be using the old partition table.