LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Linux partitioning & LVM to be used together (https://www.linuxquestions.org/questions/linux-server-73/linux-partitioning-and-lvm-to-be-used-together-4175503689/)

BhushanPathak 05-02-2014 05:43 AM

Linux partitioning & LVM to be used together
 
Hello All,

I am installing CentOS 6.5 [as a VM] via a kickstart file which I created, available on a local ftp server.

I have a total of 35GB disk space available, which I have partitioned as follows in the kickstart file-

Code:

# Disk partitioning information
part swap --fstype="swap" --size=4096
part / --fstype="ext4" --size=5120
part /var --fstype="ext4" --size=15360
part /opt --fstype="ext4" --size=6144
part /home --fstype="ext4" --size=4096

Now my question is that I need to further partition the /var partition into /var/lib of 10G & rest would be 5G.

How do I achieve that?

I used system-config-kickstart utility on another CentOS server to create the original kickstart file, but it did not give any option to further partition the /var partition.

Do I continue to use the partitions specified in kickstart file & then use LVM to further separate /var into smaller LVs, or create a large LVM of the entire 35G space & use LVM to create all partitions as LVs?

Any other suggestions are welcome.


Thanks

Bhushan Pathak

BhushanPathak 05-02-2014 08:25 AM

I updated the disk partitioning layout manually in the kickstart file as follows -

Code:

# Disk partitioning information
part swap --fstype="swap" --size=4096
part / --fstype="ext4" --size=5120
part /var/lib --fstype="ext4" --size=10240
part /var --fstype="ext4" --size=5120
part /opt --fstype="ext4" --size=6144
part /home --fstype="ext4" --size=4096

This seems to have done the job, but is it correct? Or would any issues arise in future out of it?

MensaWater 05-02-2014 09:13 AM

Generally I prefer to use LVM over partitioning for most purposes.

With LVM:
1) You can add additional disks or partitions to the Volume Group (VG) later to expand what is already there.
2) With LVM order isn't important so you can expand logical volumes (LVs) later even if there are other LVs added after the one you wish to expand. You can also shrink LVs to free up space for other LVs to be expanded.

On the other hand if you have partitions you have to remove everything beyond the one you have if you want to expand a given partition.

Of course /boot is generally on a partition rather than in LVM.

There might be *some* edge cases where having contiguous space might be important but they're fairly rare in my experience. We've run Oracle, MySQL and Postgres DBs in LVM with no problems for years.

gauravgoel1989 05-29-2014 03:20 AM

It is correct. Since you require this partition standard to be applied to your new server, better you make changes in your kickstart file.


All times are GMT -5. The time now is 01:55 PM.