LVM: Logical Volume Manager Summary LVM was working fine, handling one big drive, video cyberspace. It's not currently used. Software and guides
Installation history Looking ahead to 2.6 I'm starting to get my video drives in order, and there may come a point where I'd like to use a LVM again. Here's the scoop on the changes for 2.6: In 2.6.x there is just support for Device Mapper. From "Multi-device September troubles In late September 2002, I issued
and got a severe hang. I had to do a soft reset and the LVM volume was corrupt on boot. Get information on the Logical Volume Manager setup.
RAID information?
Recovering a Lost Partition Table: http://www.oz.net/~trav/linux/lost_partition.html
I tried fdisk -l -- note that it took a while:
So we see the DeskStar is fine -- the initial occasion for the problem has never misbehaved.
The main drive is also fine -- this is where the operating system is, and what I'm using now. A treat, really, to be able to worry about a problem disk with the full power of the operating system.
Here's the problem -- the disk device has been correctly identified as having 14946 cylinders, 255 heads, and 63 sectors. But the file system partition "does not end on a cylinder boundary". It doesn't look like corrupt data. Here's the harddrive output from dmesg:
Now, note that hdb, the /dev/sys/vc drive currently having problems, has the CHS=14946/255/63 -- that is to say, it has 255 heads. It only has one partition, hdb1, which is what is used in LVM as /dev/sys/vc. So the guys says to get gpart: http://www.stud.uni-hannover.de/user/76201/gpart/
I did make and make install and ran man gpart -- this has some really interesting information:
So why didn't you know this a long time ago? I tell you, Linux... I then ran gpart /dev/sys/vc: It just sits there for a long time, so I interrupt it. I try to mount the volume with mount /dev/sys/vc /mnt/vc -- it's not listed in fstab. It mounts fine. The files are there. I mount the IBM drive. It waits a bit and mounts. I issue a command to copy all the 66GB of files on /vc over to /vd -- at least I won't lose the stuff. I started around 3:15pm -- I wonder what speeds I'm getting -- it looks like something a bit less than a GB a minute. http://www.r-tt.com/RLinux.shtml -- disk recovery for ext2 file systems:
In the end, I just emptied the LVM volume and reformatted it as an ext3 drive. This is really better for my purposes anyway. July installation On 18 June 2002, I install a new 120GB drive on cyberspace; the first bootup detects it (see dmesg). I decide to define it using Logical Volume Manager. This is not useful right at the outset, but it allows me to learn how LVM works and prepares for running several disks on one machine with a flexible set of partitions. In Yast2, I select Hardware and Partitioner. I then expressed an interest in using the Logical Volume Manager, or LVM. The response says,
I followed these instructions for the new 120GB /dev/hdb, setting the filesystem ID to 0x8e Linux LVM -- apparently its own format. Here's some background on LVM from its home page, http://www.sistina.com/products_lvm.htm
Now, ftp://ftp.gwdg.de/pub/linux/misc/lvm/ -- which is the ftp server I use for SuSE 7.3 updates -- has a mirror updated daily of the main LVM site, so I may be able to get the update through a SuSE update. Logical Volume Manager HOWTO http://www.tldp.org/HOWTO/LVM-HOWTO.html (I have glibc-1.20020505 -- it's just possible this could cause a problem). I proceed through Yast2. I OK the creation of the LVM filesystem, which gets set at 114.5GB, identical to the detected drive. I then get this:
I change the group name to sys. I then get to the Logical Volume Manager -- Physical Volume Setup screen. I see Volume Group system (there are no other choices) at size 0 MB and a choice to add or remove group. I see a device column that lists /dev/hdb1 with a size of 114.5GB. The type is Linux LVM. The Volume Group is --. I have the choice to add or remove volume. So it looks like Volume Group is a logical creation, and Volume is a physical resource. When I click on "Add volume," the Volume Group column for /dev/hdb1 gets filled in with "sys." On top, the Volume Group size has now changed to 114.5GB. I click Next. The screen shows Logical Volume Manager on top. Under Volume group it now lists -- against a blue background -- two lines: free and 114.5 GB.Below is a table of all hard drives on the system -- in the case of cyberspace, just the partitions of /dev/hda, namely /hda1 for /boot, /hda2 for /swap, and /hda3 for /. At the bottom is a box checked that says, "View all mount points, not just the current volume group." Should I add them all to LVM, or just /hda3? /hda3 has 9 GB -- I mark it and click Add. However, this is apparently not an option -- I only get asked what I want do do with /hdb. The heading reads Create Logical Volume. The sidebar help says,
I believe that what this means is that you haven't yet created a partition -- you've just set up the logical volume manager. I simply click Max and put ext2 on the whole thing. Note that you can define "Stripes" -- in effect, a virtual RAID system? It looks like it. I don't give it a mount point -- this is just going to be a video drive, not interlacing with the existing drive on this machine. Presumably LVM will allow me later to create partitions if I want to. I don't even give it a volume name, though I was tempted to call it video. Hopefully this can also be changed later if it seems a good idea. Even though I'd just clicked Max, I get an error: The size you have entered is too large. But this is a bug -- 114.5 GB is exactly right. I lower it to 114.49 GB and it accepts it as 114.4 GB, but now it demands a volume name; I give it video. Back in the Logical Volume Manager -- Logical Volumes screen, I now have Volume group system listed as "used" and "114,4 GB". Below, the new drive is listed as /dev/lvm/video, the type is LV. I say Next and go into the Expert Partitioner. Here /dev/sys/video1 is given as 114.5 GB. I press OK and get the execute screen; I confirm and it formats the drive. I get an error message: vgcreate -- volume group or file already exists. This is because I first allowed it to name the volume group "system". I say OK and reboot. After the first attempt, aborted, I rebooted. I got this from dmesg:
Then in /var/log/boot.msg I got this:
I reenter Yast2. Since the LVM module is now loaded, I run an online system update, manual. This is getting to be a bit tricky, since I've now made lots of non-rpm modifications to the system. I see nothing of interest showing up and abort. I name the logical volume group sys and the volume vc, for video cyberspace. So the new 115 GB drive can now be referred to as /dev/sys/vc -- nice and easy. This time it really formats. I don't think I really had a name for the giant drive -- I change references to giant and call it vm, or video gubbio. This will be easy to change later. I then modified the mount points on cyberspace and gubbio to be /mnt/vc and /mnt/vm for video cyberspace (the 120 GB drive) and video gubbio (the 160 GB drive). These modifications were made in /etc/fstab, /etc/exports, and in the directories /mnt and /home/steen/mnt (in the latter I added symlinks). We should be all ready to go. I reboot cyberspace and fix the new drive with screws. With a bit of fiddling -- gubbio has a hard time reloading /etc/exports -- I mount /mnt/vc and /mnt/vm on both gubbio and cyberspace, and I suddenly have another 100 or so gigabytes.
|
|
|
|
|||||
Maintained by Francis F. Steen, Communication Studies, University of California Los Angeles |