Why use lvm in ubuntu




















June 7th, 3. Originally Posted by ajgreeny. Any follow-up information on your issue would be appreciated. Please have the courtesy to report back. June 8th, 4. Distro Ubuntu.

LVM is more for advanced users. It is often used on servers and is required if you want full drive encryption. That erases entire hard drive and converts it to LVM, logical volumes. Add the new LUN's to dm-multipath, pvmove, get rid of the old ones. And of course the common usecase of a physical server with local disks, where LVM helps a lot with managing different partitions.

It's great. I'm nuts enough to have used the serial console and the ability to attach new drive volumes to have replaced the stock install with an LVM-based one on a Google Cloud Platform instance and different filesystem. I like the ability to take snapshots without having to use btrfs or zfs-on-linux. Which I take advantage of for my automated backups. Jim Salter wrote: chalex wrote: default Ubuntu desktop makes an LV for home for all the space available default Ubuntu server makes a 4GB root LV and that's it, leaves the rest unallocated I think they are reasonable defaults.

The point is the sysadmin knows better than the distributor how the disk space needs to be used. FYI AIX does the same thing with its logical volume manager which is conceptually quite similar to that of Linux, except mandatory. So the expectation is for the sysadmin to create and expand out the volume s as expected. In fact one practice is not to use all the space from the start, but to incrementally grow the volumes into the unused physical space.

Presumably the VMs run somewhere, and the distros are general enough to support bare metal. So your thin provisioning has shifted the problem there. And I'm not even sure that any of those tools help me deal with the encryption part of the setup. That's more than a few commands, and each of them have a lengthy list of options. Not to mention all the extra lvm-specific terminology. There's a TON going on there. I'm sure there are plenty of environments where the extra capabilities are useful, but I don't see how you can deny that there's a dramatic increase in the complexity of using it.

Well, it is a whole layer of indirection. So in some cases it is totally unneeded complexity and other times it adds valuable flexibility. If you just have a few local physical disks, that's very different from running on some virtual devices provided by your storage array with its own layers or on some cloud thing where there are all kinds of virtual layers below.

I use it on servers and it has come through more than once, especially with VM's where our vsphere admins treat storage like rare and precious metals, though lately they have been a lot better to deal with. Do you actually use LVM? Ars Scholae Palatinae et Subscriptor. Jim Salter.

Jim Salter wrote:. Ars Praefectus et Subscriptor. Utwig wrote:. Ars Legatus Legionis et Subscriptor. I use LVM everywhere, except where I can't cloud providers.

Tribus: Sr. Sunner wrote:. You should be able to just pvresize the existing pv, no? Last edited by sryan2k1 on Sun Feb 24, pm. Which is useless with modern VMs and thin provisioning.

I don't use LVM on desktop. Posted: Tue Feb 19, am. Posted: Tue Feb 19, pm. Posted: Wed Feb 20, am. Posted: Wed Feb 20, pm. What can I say? Lucky me, right? Registered: Mar 14, Posts: You can display all of the physical devices on your system by using lvmdiskscan with the -l option, which will only return physical volumes:.

The pvscan command is fairly similar to the above, in that it searches all available devices for LVM physical volumes. The output format is a bit different and it include a small amount of additional information:. If you need more detail, the pvs and pvdisplay commands are better options. The pvs command is highly configurable and can display information in many different formats. Because its output can be tightly controlled, it is frequently used in when scripting or automation is needed.

Its basic output provides a useful at-a-glance summary similar to the earlier commands:. For more verbose, human-readable output, the pvdisplay command is usually a better option:.

As you can see the pvdisplay command is often the easiest command for getting detailed information about physical volumes. To discover the logical extents that have been mapped to each volume, pass in the -m option to pvdisplay :.

This can be very useful when trying to determine which data is held on which physical disk for management purposes. The vgscan command can be used to scan the system for available volume groups. It also rebuilds the cache file when necessary. It is a good command to use when you are importing a volume group into a new system:. The command does not output very much information, but it should be able to find every available volume group on the system.

To display more information, the vgs and vgdisplay commands are available. Like its physical volume counterpart, the vgs command is versatile and can display a large amount of information in a variety of formats. Because its output can be manipulated easily, it is frequently used in when scripting or automation is needed.

For example, some helpful output modifications are to show the physical devices and the logical volume path:. For more verbose, human-readable output, the vgdisplay command is a usually the best choice.

Adding the -v flag also provides information about the physical volumes the volume group is built upon, and the logical volumes that were created using the volume group:. The vgdisplay command is useful because it can tie together information about many different elements of the LVM stack.

As with the other LVM components, the lvscan option scans the system and outputs minimal information about the logical volumes it finds:. For more complete information, the lvs command is flexible, powerful, and easy to use in in scripts:.

To find out about the number of stripes and the logical volume type, use the --segments option:. When the -m flag is added, the tool will also display information about how the logical volume is broken down and distributed:. This information is useful if you need to remove that underlying device and wish to move the data off to specific locations.

This section will discuss how to create and expand physical volumes, volume groups, and logical volumes. In order to use storage devices with LVM, they must first be marked as a physical volume.

This specifies that LVM can use the device within a volume group. First, use the lvmdiskscan command to find all block devices that LVM can see and use:. Warning : Make sure that you double-check that the devices you intend to use with LVM do not have any important data already written to them. Using these devices within LVM will overwrite the current contents. If you already have important data on your server, make backups before proceeding. To mark the storage devices as LVM physical volumes, use pvcreate.

You can pass in multiple devices at once:. To create a new volume group from LVM physical volumes, use the vgcreate command. You will have to provide a volume group name, followed by at least one LVM physical volume:. This example will create your volume group with a single initial physical volume. Usually you will only need a single volume group per server.

All LVM-managed storage can be added to that pool and then logical volumes can be allocated from that. One reason you may wish to have more than one volume group is if you feel you need to use different extent sizes for different volumes. Usually you will not have to set the extent size the default size of 4M is adequate for most uses , but if you need to, you can do so upon volume group creation by passing the -s option:.

To expand a volume group by adding additional physical volumes, use the vgextend command. This command takes a volume group followed by the physical volumes to add. The physical volume will be added to the volume group, expanding the available capacity of the storage pool.

To a logical volume from a volume group storage pool, use the lvcreate command. Specify the size of the logical volume with the -L option, specify a name with the -n option, and pass in the volume group to allocate the space from. Provided that the volume group has enough free space to accommodate the volume capacity, the new logical volume will be created.



0コメント

  • 1000 / 1000