Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
LVM questions
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
gimp2x
Tux's lil' helper
Tux's lil' helper


Joined: 30 Jun 2002
Posts: 112
Location: Atlanta, GA

PostPosted: Tue Jul 30, 2002 10:33 pm    Post subject: LVM questions Reply with quote

i have a 120GB drive (ide)
i have a 40GB drive (ide)

the 120GB is partitioned as follows

Disk /dev/hda: 255 heads, 63 sectors, 14589 cylinders
Units = cylinders of 16065 * 512 bytes

Device Boot Start End Blocks Id System
/dev/hda1 1 4 32098+ de Dell Utility
/dev/hda2 * 5 12761 102470602+ 7 HPFS/NTFS
/dev/hda3 12762 12767 48195 83 Linux
/dev/hda4 12768 14589 14635215 f Win95 Ext'd (LBA)
/dev/hda5 12768 14335 12594928+ 83 Linux
/dev/hda6 14336 14589 2040223+ 82 Linux swap

the other is blank/free

how can I convert my system to LVM without having to start off fresh again?

can i somehow make a vg on my 40gb drive and then drag all the contents from the regular drive over to the vg, boot
from it, erase all the crap on the extra partions on the 120GB drive, merge the free space into the rootvg and then
have a partially LVM 120GB drive and a full LVM 40GB drive

err, and also i need an ext2 boot partition, someone wanna coach me through this?


also, the purpose of this is to stripe between the two drives...so i also probably need to figure out how to do that too
Back to top
View user's profile Send private message
gimp2x
Tux's lil' helper
Tux's lil' helper


Joined: 30 Jun 2002
Posts: 112
Location: Atlanta, GA

PostPosted: Thu Aug 01, 2002 1:31 am    Post subject: Reply with quote

nobody? can someone move this to the appropriate thread?
Back to top
View user's profile Send private message
mglauche
Retired Dev
Retired Dev


Joined: 25 Apr 2002
Posts: 564
Location: Germany

PostPosted: Thu Aug 01, 2002 9:37 am    Post subject: Reply with quote

you can do it with lvm.

Once you've created a physical volume with a vg on it, you can move this physiacal volume around, resize it, etc.

example:
2 hardrives, with one big vg, buy a new harddrive, "move" vg away from one of the old harddrives, then expand it to the size of the new harddrive. (hope this is what you mean)
Back to top
View user's profile Send private message
chavez
n00b
n00b


Joined: 29 May 2002
Posts: 35
Location: Austin, Texas

PostPosted: Fri Aug 02, 2002 2:02 pm    Post subject: Reply with quote

Take a look at EVMS, http://evms.sf.net. The gentoo kernel has support for evms and you can emerge evms to get the evms user space utilties. The user space comes with a GTK gui that can help make some of the LVM configuring easier.

That is, you would create a Linux LVM container (EVMS speak for a VG) using whatever segments (EVMS speak for partitions) or disk you want then create regions (EVMS speak for an LV) from the container.

Make the the LV into volumes so you end up with /dev/evms/lvm/vg/lv nodes. Copy the data over. Later after wiping out your original disk. You can use the "Expand Container" command in EVMS to allow the VG to consume the disk. Then you can expand your volumes if you want or as you need to consume more space. The real nice feature is that if there is an FSIM (File System Interface Modules) available for your filesystem (EVMS 1.1 supports ext2/ext3/, fat16, reseirfs and jfs) then expansion of the volume storage and the expansion of the filesystem will be coordinated by EVMS.

Visit the #evms IRC channel on openprojects.net if you have any questions.
_________________
regards,

Luciano Chavez
Back to top
View user's profile Send private message
gimp2x
Tux's lil' helper
Tux's lil' helper


Joined: 30 Jun 2002
Posts: 112
Location: Atlanta, GA

PostPosted: Sat Aug 03, 2002 7:38 pm    Post subject: Reply with quote

thanks for all the help, i'll look into this
Back to top
View user's profile Send private message
BigRedDog
n00b
n00b


Joined: 31 Jul 2002
Posts: 7

PostPosted: Sun Aug 04, 2002 6:32 am    Post subject: Reply with quote

I've been messing with EVMS. It looks good so far. I have no idea how it compares (performance-wise) to LVM, but it has some nice features. I like how the kernel recognizes the volumes at startup without having to run some userspace utility like vgscan. That should make it really easy to put my root filesystem under EVMS.

However, LVM does have much better documentation. The only way I learned EVMS was by messing around with it, which isn't really an option when you're dealing with important data.

Is there a way to use EVMS during the initial stages of the Gentoo install? Or do I have to install to another partition and copy everything over?
Back to top
View user's profile Send private message
chavez
n00b
n00b


Joined: 29 May 2002
Posts: 35
Location: Austin, Texas

PostPosted: Mon Aug 05, 2002 6:53 pm    Post subject: Reply with quote

BigRedDog,

Hopefully I can respond to your three questions. If have you have
further questions pleast post them on the evms-devel mailing (the three you asked are all good):

We realized a while back that our docs needed improvement. Our
documenation person is working on a new user's guide that offers a more task oriented approach, i.e. I want to build a software RAID 5 object for use by LVM on top...how do I do that?, as well as recommendations on what you want to start. In other words, I need fault tolerance but not necessarily performance, in this case RAID 1 (mirroring) may be was is recommended and so on.

As for performance comparison, there have been a couple of performance benchmarks comparisons between LVM and EVMS posted on the web. Unfortunetly, I can't find them all at the moment. Watch http://lse.sf.net/benchmarks/evms for new comparison reports.

Lastly, funny you ask about Gentoo installation. The command line
utility could be used assuming you have the user space engine and
necessary engine plugins installed (as well as the EVMS kernel side
built). At the moment, we are working with one of the Gentoo developers on creating Python language bindings around the EVMS application API in order for it to be used by their future installer. Neat, huh?

We're pleased that you've taken the time to try and like EVMS.
_________________
regards,

Luciano Chavez
Back to top
View user's profile Send private message
arkane
l33t
l33t


Joined: 30 Apr 2002
Posts: 918
Location: Phoenix, AZ

PostPosted: Mon Aug 05, 2002 7:12 pm    Post subject: Reply with quote

Quote:

However, LVM does have much better documentation. The only way I learned EVMS was by messing around with it, which isn't really an option when you're dealing with important data.


Maybe you can enlighten me a little. (no sarcasm intended at all)
What is EVMS, anyway? I've tried to figure that out throughout this thread, but all that I can get is that it's something to do with LVM, or a comparision thereof...

I use LVM right now for all my partitions, what could it do that LVM can't?
Back to top
View user's profile Send private message
chavez
n00b
n00b


Joined: 29 May 2002
Posts: 35
Location: Austin, Texas

PostPosted: Tue Aug 06, 2002 2:55 pm    Post subject: Reply with quote

arkane wrote:
Quote:

However, LVM does have much better documentation. The only way I learned EVMS was by messing around with it, which isn't really an option when you're dealing with important data.


Maybe you can enlighten me a little. (no sarcasm intended at all)
What is EVMS, anyway? I've tried to figure that out throughout this thread, but all that I can get is that it's something to do with LVM, or a comparision thereof...

I use LVM right now for all my partitions, what could it do that LVM can't?


Good question! EVMS is much more than LVM. Here is the abstract from the project page.

Quote:
The EVMS Project uses a layered, plug-in model to provide unparalleled flexibility and extensibility in managing storage. This allows for easy expansion or customization of various levels of volume management.


Basically, it's an entire integrated volume management system. It offers in-kernel discovery of volumes with a suite of user space tools to handle the management (creation, resizing, etc.) of new storage objects.

These storage objects can be compatibility type objects like AIX LVM, Linux LVM, or Linux MD devices managed by plug-ins exclusively written to emulate each.

You can also create new types of storage objects with EVMS Feature plug-ins such as with the Snapshot, DriveLinking and BBR (Bad Block Relocation) plug-ins. You can convert compatibility volume to EVMS volume which allows for add features to it as well as allowing it to have a persistent name and minor number.

EVMS allows easy stacking of storage objects. You can create a volume out of a raw disk or partition, created RAID objects, LVM objects, and stack them all together if you want.

EVMS also offers File System Interface Modules (FSIMs) that help with file system specific tasks such as when expanding and shrinking volumes or with a mkfs, fsck, etc. There are FSIMs for ReseirFS, FAT, Ext2/Ext3, JFS, Swap, and coming soon XFS.

We also offer support for other partition schemes like GPT (used on IA64 systems) besides DOS paritioning scheme.

There is support for PPC 32 and 64, S/390, IA64 and it just keeps getting better.

There is a shared library called the EVMS Engine that allows new plug-ins as well as user interface to be written as well.

It supports DevFS altough it is not required.

In summary, EVMS is much more than LVM although a small part (a couple of plug-ins) offers a complete emulation package for it (even some ports of the LVM command line utilties written to use the EVMS API). It is an entire, integrated volume management framework/system.

I suggest you visit http://evms.sf.net for more information and screenshots of the GUI.
_________________
regards,

Luciano Chavez
Back to top
View user's profile Send private message
arkane
l33t
l33t


Joined: 30 Apr 2002
Posts: 918
Location: Phoenix, AZ

PostPosted: Wed Aug 07, 2002 12:36 am    Post subject: Reply with quote

Wow... yet another world of technology to explore...
*sigh*

For this particular instance, I think just LVM would be the answer. After looking at EVMS, it's a great tool for systems requiring it. However, it might be a "golden hammer" so to speak for someone just looking for LVM's capabilities.

Am I right, or missing the point? (considering LVM is in the kernel, no need to patch, is fairly simple to install... etc)
Back to top
View user's profile Send private message
BigRedDog
n00b
n00b


Joined: 31 Jul 2002
Posts: 7

PostPosted: Wed Aug 07, 2002 1:58 am    Post subject: Reply with quote

[quote="arkane"For this particular instance, I think just LVM would be the answer. After looking at EVMS, it's a great tool for systems requiring it. However, it might be a "golden hammer" so to speak for someone just looking for LVM's capabilities.
[/quote]

I was kind of wondering that myself. EVMS seems to have a lot of capability, but I just want something so that I don't have to worry about getting my partition sizes right. My plan was to start off using 1/4 my drive and add more as needed. Using EVMS, the only way I could figure out how to do this was by using a "Linux LVM" container. It makes me wonder if I'm adding unnecessary complexity.

Either way, you're probably going to have to upgrade. According to the EVMS web site, LVM is going to be dropped from the kernel. So it looks like the choice is going to be between EVMS and LVM2.
Back to top
View user's profile Send private message
chidrob
n00b
n00b


Joined: 07 Aug 2002
Posts: 17

PostPosted: Wed Aug 07, 2002 3:22 am    Post subject: Reply with quote

I vote for LVM with Gentoo. This is my "mount":

> /dev/hdc6 on / type ext2 (rw,noatime)
> proc on /proc type proc (rw)
> none on /dev type devfs (rw)
> tmpfs on /mnt/.init.d type tmpfs (rw,mode=0644,size=1024k)
> /dev/vg_base/home on /home type ext3 (rw)
> /dev/vg_base/var on /var type ext3 (rw,noatime)
> /dev/vg_base/tmp on /tmp type ext3 (rw,noatime)
> /dev/vg_base/vartmp on /var/tmp type ext3 (rw,noatime)
> /dev/vg_base/usr on /usr type ext3 (rw,noatime)
> /dev/vg_base/portage on /usr/portage type ext3 (rw,noatime)
> /dev/vg_base/distfil on /usr/distfiles type ext3 (rw,noatime)
> /dev/vg_base/opt on /opt type ext3 (rw,noatime)
> /dev/vg_prod/pub on /pub type ext3 (rw,noatime,data=writeback)
> /dev/vg_prod/cvs on /pub/cvs_mirror type ext3 (rw,noatime,data=writeback)
> /dev/vg_prod/cvsup on /pub/cvsup_mirror type ext3 (rw,noatime,data=writeback)
> /dev/vg_prod/ftp on /pub/ftp_mirror type ext3 (rw,noatime,data=writeback)
> /dev/vg_prod/isoimag on /pub/iso_images type ext3 (rw,noatime,data=writeback)
> /dev/vg_prod/hercule on /pub/hercules type ext3 (rw,noatime,data=writeback)
> /dev/vg_prod/ware on /pub/ware type ext3 (rw,noatime,data=writeback)
> /dev/vg_prod/pendent on /pub/pendent type ext3 (rw,noatime,data=writeback)
> /dev/vg_test/qhercul on /zfast/hercules type ext3 (rw,noatime,data=writeback)
> /dev/vg_test/qware on /zfast/vmware type ext3 (rw,noatime,data=writeback)
> bash-2.05a$

vg_prod, vg_test and vg_base are LVM volumes.

I'm using LVM with gentoo for four months now, without problems (but this is a workstation, not a server). In fact, I'm doing stripping, for better perfomance with hercules, althougth without any success.

Thanks to LVM, my Gentoo system is going well after all these months, including the upgrade from two to four hard disks practically "online". I have resize some partitions, etc, also.

In fact, I upgraded to 2.4.19 (vanilla-sources) yesterday without any problem. And I have some appls with "special" modules: dri, vmware, alsa and LVM, of course. You can see that /usr/src is on a LVM partition.
Back to top
View user's profile Send private message
ghost_o
Tux's lil' helper
Tux's lil' helper


Joined: 10 Jul 2002
Posts: 119

PostPosted: Thu Aug 08, 2002 3:12 am    Post subject: Reply with quote

chavez wrote:
Basically, it's an entire integrated volume management system. It offers in-kernel discovery of volumes with a suite of user space tools to handle the management (creation, resizing, etc.) of new storage objects.


Sounds like an affordable EMC in the works.! Are there plans to do any of the advance features that EMC and others do on their platforms like "Split and Backup" utilities, or Time based mirroring utilities?

I have used EMC almost exclusively at work for the past few years, and while completely impressed, I hate to have to put the 3 million in the budget for a new one every year...!

-G
Back to top
View user's profile Send private message
chavez
n00b
n00b


Joined: 29 May 2002
Posts: 35
Location: Austin, Texas

PostPosted: Thu Aug 08, 2002 4:09 pm    Post subject: Reply with quote

ghost_o wrote:
chavez wrote:
Basically, it's an entire integrated volume management system. It offers in-kernel discovery of volumes with a suite of user space tools to handle the management (creation, resizing, etc.) of new storage objects.


Sounds like an affordable EMC in the works.! Are there plans to do any of the advance features that EMC and others do on their platforms like "Split and Backup" utilities, or Time based mirroring utilities?

I have used EMC almost exclusively at work for the past few years, and while completely impressed, I hate to have to put the 3 million in the budget for a new one every year...!

-G


I am not familar with EMC's products or the terms you mentioned so I can't say. EVMS does offer a Snapshot feature (asynchronous with optional read-only, read-write snapshots as well as rollback support) to allow backing up online devices. We don't provide backup utilities though. I can only guess what you mean by "Time based mirrors". To me they sound like snapshots with the exception that the backing store device does not contain a full image of the source just sectors that have been modified since the snapshot began. We do offer Linux MD support for n-way mirroring and the capability to mark and remove mirror devices.

I think if you have more detailed questions, you should post them to the evms-devel on sourceforge.net, see http://sourceforge.net/mail/?group_id=25076. I am currently the only team member that peruses the Gentoo forums so this way you'll have the opportunity to get more people to answer your questions.
_________________
regards,

Luciano Chavez
Back to top
View user's profile Send private message
sanity
n00b
n00b


Joined: 19 May 2002
Posts: 39
Location: Iowa

PostPosted: Thu Nov 21, 2002 2:30 am    Post subject: Reply with quote

EVMS looks very cool. Couple things, though:

It has a lot of new terminology. I have a spare hard drive to play around with, and the ncurses interface makes it easy to do that. Still, it's a lot to learn, and so far all I'm using it for is LVM. Of course, there's always room to grow...

GPT support in EVMS is one thing. GPT support in the boot loader is quite another. I've looked (but haven't found) a patched LILO, and I'd rather use GRUB anyhow, but it only sees the protective MBR. I've tried adding a partition to the protective MBR, and in fact I've even tried messing with the -t flag of fdisk (which doesn't understand gpt) to turn on and off the use of GPT on the drive. It fails, because at any change in the GPT partition table, the protective MBR is overwritten. The only other solution I can think of is kernel-on-a-floppy -- not fun.

It does seem to have unneeded complexity. Does LVM really need to be on a partition? Of course it does, if I intend to have a separate /boot partition. But still, there do seem to be too many layers there -- or at least to many neccessary layers. Am I wrong, or missing something?

And finally, from the looks of resize_reiserfs, I have to shrink partitions offline. This shouldn't matter too much (at least for my system), and I know it's up to Reiser, not EVMS, to implement it. It would be nice, though, and the reiser source is available. Maybe create a big enough file, in the right spot?

Also, a question:

From what LVM looks like, everything is "logical". This must mean there's a possibility for defragmentation. Is there an LVM defragmenter? If so, it should be accessable from EVMS.
_________________
Every time you read a signature, God kills a kitten.
Back to top
View user's profile Send private message
arkane
l33t
l33t


Joined: 30 Apr 2002
Posts: 918
Location: Phoenix, AZ

PostPosted: Thu Nov 21, 2002 9:32 pm    Post subject: Reply with quote

sanity wrote:


It does seem to have unneeded complexity. Does LVM really need to be on a partition? Of course it does, if I intend to have a separate /boot partition. But still, there do seem to be too many layers there -- or at least to many neccessary layers. Am I wrong, or missing something?


Well, don't confuse LVM with EVMS. LVM was brought around initially to swap in and swap out partitions and disks easily, along with resizing. The nicest (and biggest selling point IMHO) is the fact that it works around the 4 physical partition limit of the harddrive on IBM compat machines.
Problem is, it does this by taking one single partition, and splitting it up logically by itself. That means the bios nor the bootloader will understand any information that partition. That's why you have to have a seperate /boot partition, to have a clean filesystem that is readable by the bootloader. There is only really one extra layer added for LVM, and that is LVM itself. You can always not use LVM or EVMS, and hardcode the size of each partition into fdisk...

Quote:

And finally, from the looks of resize_reiserfs, I have to shrink partitions offline. This shouldn't matter too much (at least for my system), and I know it's up to Reiser, not EVMS, to implement it. It would be nice, though, and the reiser source is available. Maybe create a big enough file, in the right spot?


While we're at it, let's make XFS able to shrink...
:(

Quote:

From what LVM looks like, everything is "logical". This must mean there's a possibility for defragmentation. Is there an LVM defragmenter? If so, it should be accessable from EVMS.


I've been running on the same partitioning scheme (no reformats) for months now, with no slowdowns... the filesystems themselves are taking care of themselves, and everything is contingous other wise. The actual "partitions" of LVM never really change, unless you change them yourself.. it's the data within the filesystems that changes, and the filesystems take care of that. Defragmentation, as far as I know, is only viable for filesystems. Am I right in this thinking?
Back to top
View user's profile Send private message
sanity
n00b
n00b


Joined: 19 May 2002
Posts: 39
Location: Iowa

PostPosted: Fri Nov 22, 2002 12:12 am    Post subject: Reply with quote

By "defragmentation" I meant the partitions themselves. How does LVM manage when you change the size of the partitions? I thought that was the whole point of LVM -- they are "logical volumes" so you don't need to know or care where they are on disk. But what happens if you've got a 20 gig hd, and you've got a 2 gig partition, a 3 gig partition, and a 5 gig partition, created in that order, and you delete the 3 gig and make a 17 gig?

Seems to me that either you'd have to wait for LVM to move at least 2 gigs of data around, or you'd have to have one of those partitions "fragmented" into two parts. Now, this probably won't be a performance hit for most people under most conditions, but eventually (it always happens) the system will break down. It would be nice if, whenever I had my system down, I could have LVM automatically re-sort those partitions, even separate them for speed by amount used (for example, putting var and swap on faster-spinning areas of the disk). It also doesn't seem like it would be too hard to implement, even online -- Reiser seems to be attempting that one, defragmenting partitions when there's little or no disk i/o.

Of course, I could be wrong, but it does look something like software RAID. Software RAID is fast in theory and in benchmarks, but in practice it does use the CPU and therefore slows the system down. I'm hoping that LVM/EVMS doesn't put too much between the FS and the disk.
_________________
Every time you read a signature, God kills a kitten.
Back to top
View user's profile Send private message
arkane
l33t
l33t


Joined: 30 Apr 2002
Posts: 918
Location: Phoenix, AZ

PostPosted: Sat Nov 23, 2002 4:49 pm    Post subject: Reply with quote

sanity wrote:
By "defragmentation" I meant the partitions themselves. How does LVM manage when you change the size of the partitions? I thought that was the whole point of LVM -- they are "logical volumes" so you don't need to know or care where they are on disk. But what happens if you've got a 20 gig hd, and you've got a 2 gig partition, a 3 gig partition, and a 5 gig partition, created in that order, and you delete the 3 gig and make a 17 gig?


AHHH okay, I understand what your asking now!
Well, I think I do, here's how I understand:
You add in a 20 gig harddisk (single physical partition or even whole disk) to a Volume Group. Then you segment it up into 2 gig, 3 gig, and 5 gig partition. Later, you delete the 3 gig and make a 17 gigger partition... all within LVM. Is that right?

It woud act pretty much like any other partitioning software. Yeah, things wouldn't be contingeous completely. (god I hate spelling that word :) ) However, Your talking about a split of 3 gigs, versus tiny bits. Fragmentation comes when a single file needs to be accessed from several sectors of the disk, instead of being continguous. When it comes to partitions, it really shouldn't matter too much, honestly. Harddisks are fast enough today to compensate for the extra time needed to move from even the center to the outside of the cylinder. It's about on par with having 3 physical partitions set up in fdisk, say /, /var, and /usr. /usr would then be the last in the setup, being the furthest out from the center. (If I understand sector allocation properly). It would only be a performance hit if it was on a slow harddisk... then it would be negligable) Honestly, I've used LVM on my old P-450 (overclocked celeron from 300 to 450) and a slower western digital harddisk. (10 gigger) I've allocated, reallocated, deleted, allocated yet again, never noticed a slowdown whatsoever. So I'm guessing that it lays in the same age old principles of early partitioning.

Quote:

Seems to me that either you'd have to wait for LVM to move at least 2 gigs of data around, or you'd have to have one of those partitions "fragmented" into two parts. Now, this probably won't be a performance hit for most people under most conditions, but eventually (it always happens) the system will break down.

LVM doesn't move the data all the time, it has a thing called phyiscal extents that maps the drive within itself, then segments those into the volume group(s) as needed. Then, the volume groups are split into the respective logical volumes. (well, there are more things below the physical extents than that I believe, but thats the jist of it) About the only way I can see this breaking down is if you continuously delete small partitions, allocate bigger, delete that bigger, make several small ones and a big one, delete the small ones systematically, make a big one again, delete the big one and make small ones and keep doing that for a nice long while. After a while, you'd just have to rethink your strategies of partition allocation because your going haywire with it. Backup your things, delete the logical volumes, create the ones you need, and try to keep the changes down to < 1000 a month :D

It all boils down to the fact that our disks aren't that slow anymore. By optimizing placement on the disk (and wasting an hour achieving this), we only gain a minimal speed increase. (perhaps disk I/O intensive applications primarily) Minimal being by less than a second, unless the disk is majorly slow.
Quote:

Of course, I could be wrong, but it does look something like software RAID. Software RAID is fast in theory and in benchmarks, but in practice it does use the CPU and therefore slows the system down. I'm hoping that LVM/EVMS doesn't put too much between the FS and the disk.
:P

Software RAID falls on it's face for high-bandwidth transactions, honestly. It uses the IDE channels which are inherently slow to begin with. With RAID though, you have the software taking each transaction and splitting it amongst several disks (with the same data), or whatever other RAID implementation you've set up. The end result would be that the software needs to compute for every byte how to go about the disk I/O, and then utilize the IDE bus for all of the disk transactions. (effectively halving/forthing the IDE bus bandwidth for the single transaction for that moment)

Great idea, only problem is that it's a major bummer for servers of high bandwidth. If you have the extra CPU, and need fault tolerance (with a small wallet that is) or even striping, thats the way to go.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum