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!
Notices
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I did a clean install of redhat 6, taking all defaults.
I will need to use lvm to create separate partitions for /tmp and /home. Below is my /etc/fstab. Did the install create logical volumes for /home, / and /swap without asking? do I have enough space to create more logical volumes.
you can start with pvscan and lvscan to find your physical volumes and logical volumes. a df -h will show you the sizes. its a start. sorry im very new to LVM's as well.
I did a clean install of redhat 6, taking all defaults.
I will need to use lvm to create separate partitions for /tmp and /home. Below is my /etc/fstab. Did the install create logical volumes for /home, / and /swap without asking? do I have enough space to create more logical volumes.
Yes default installation of RHEL6 goes with LVM if you do not manually create the partition schema during installation. Looking at your fstab file shows that /root, /home and swap are on Volume Group named vg_server1 with three logical volumes lv_root, lv_home and lv_swap for /root, /home and swap respectively.
Use "df -h" to see how much space each filesystem is occupying and how much space you are left with. If you have enough space follow the steps below mentioned below to create Logical volume.
1. Use fdisk <hard-drive name>
2. Create a new partition and set the system id to Linux LVM
3. Now use pvcreate to create a Physical volume from that raw partition.
4. use vgcreate to create a volume group.
5. Finally create logical volume using lvcreate
6. Now create filesystem on this logical volume using mkfs.ext4 command.
7. Now mount the logical volume on /tmp directory and place an entry in fstab file if you want it to be mounted at boot.
I would suggest to look at man pages of each of these commands if you are not very familiar with them for details. Also take a look at the below article.
Yes 72-(32+22+6+0.5) gives you almost 10.5G. Fdisk runs on disk (not partition), so you would use fdisk /dev/sda. Use exactly the following steps:
1. Choose "n" to create a new partition.
2. select "p" for primary partition.
3. Then give the partition number as 3
4. Then it will ask you starting cylinder- choose default
5. Then give the size as +10G
6. Then press t to change the partition Id and change it to 8e.
7. Now press w to write the changes.
Now use pvcreate, vgcreate and lvcreate to create logical volume and then finally make filesystem and mount it.
No. df only looks at the available space within the file system not what is unallocated or free space on the disk or within the LVM partiton. In this case it would provide some information on what space can be freed by resizing the existing logical volumes.
Look at the output of the command:
fdisk -l (must be root to run command and that is a small L)
You should see 2 partitions sda1 which is your /boot and sda2 which is the LVM that contains / and /home. All the space inside the LVM should be allocated. I also assume there isn't any free space on the disk either.
Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 64 8921 71139328 8e Linux LVM
Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 64 8921 71139328 8e Linux LVM
Steinz,
The remaining 10G is available in your /dev/sda2 which has a volume group on it. If you can look at the fdisk output you have a total of 8920 cylinders, out of which 63 cylinders were used by /dev/sad1 and remaining by /dev/sda2. So it would not be possible to create lvm now considering your scenario since all the cylinders have been used up and there is no unallocated space on your hard drive and you need to have unallocated space to create a raw partition.
6 g to sda1 - all used
67 g to sda2 - 54g in lvm
and 10g in sda2, but unallocated to anything.
so to use the 10 g, could I fdisk and create a third partition and then use it in lvm
or extend sda2 by 10 g and use lvm
or just format the third partition (sda3) and use that for /home and /var/log
6 g to sda1 - all used
67 g to sda2 - 54g in lvm
and 10g in sda2, but unallocated to anything.
so to use the 10 g, could I fdisk and create a third partition and then use it in lvm
or extend sda2 by 10 g and use lvm
or just format the third partition (sda3) and use that for /home and /var/log
Hey Steinz,
Once some space is allocated to a partition then it no longer remains unallocated to create a new partition. On your system you have sda2 of 67G but i suspect that all 67G is already assigned to Volume group though you have only 54G used as logical volumes. Run vgdisplay command and it would show you the volume group details or you can use vgs command it will show total Volume group size and free size for each volume group you have on your system.
Now if there is any free space on the volume group then just create a new logical volume in the same volume group using the lvcreate command, here is an example of that.
lvcreate -L 10G -n tmp_lv <name of the volume group>
Oops... I didn't mention swap in my first post which is also part of the LVM is some of that missing space. The output of the pvscan will display the information of all physical volumes and their sizes including free space. The output of the lvscan command will display all of the logical volumes and their sizes. Post the output.
You can not create a third partition or extend an existing partition since all of the disk space is allocated. The output from the commands. will show if there is free space available inside the LVM. However, you can re-size existing LVs to create some free space for another LV. I posted a link that documents the GUI LVM tool. Backup any and all important data first.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.