diff -urN -X /home/joe/packages/dontdiff linux-2.2.18-raw/CREDITS linux-2.2.18-raw-lvm0.9/CREDITS --- linux-2.2.18-raw/CREDITS Wed Dec 13 15:08:12 2000 +++ linux-2.2.18-raw-lvm0.9/CREDITS Wed Dec 13 11:20:11 2000 @@ -1441,6 +1441,13 @@ S: 2300 Copenhagen S S: Denmark +N: Heinz Mauelshagen +E: mge@EZ-Darmstadt.Telekom.de +D: Logical Volume Manager +S: Bartningstr. 12 +S: 64289 Darmstadt +S: Germany + N: Mike McLagan E: mike.mclagan@linux.org W: http://www.invlogic.com/~mmclagan diff -u linux/Documentation/Configure.help.orig linux/Documentation/Configure.help --- linux/Documentation/Configure.help.orig Fri Jan 12 00:44:44 2001 +++ linux/Documentation/Configure.help Thu Feb 1 13:58:27 2001 @@ -1318,6 +1318,21 @@ called on26.o. You must also have a high-level driver for the type of device that you want to support. +Logical Volume Manager (LVM) support +CONFIG_BLK_DEV_LVM + This driver lets you combine several hard disks, hard disk partitions, + multiple devices or even loop devices (for evaluation purposes) into + a volume group. Imagine a volume group as a kind of virtual disk. + Logical volumes, which can be thought of as virtual partitions, + can be created in the volume group. You can resize volume groups and + logical volumes after creation time, corresponding to new capacity needs. + Logical volumes are accessed as block devices named + /dev/VolumeGroupName/LogicalVolumeName. + + For details see /usr/src/linux/Documentaion/LVM-HOWTO. + + To get the newest software see . + Multiple devices driver support CONFIG_BLK_DEV_MD This driver lets you combine several hard disk partitions into one diff -urN -X /home/joe/packages/dontdiff linux-2.2.18-raw/Documentation/LVM-HOWTO linux-2.2.18-raw-lvm0.9/Documentation/LVM-HOWTO --- linux-2.2.18-raw/Documentation/LVM-HOWTO Thu Jan 1 01:00:00 1970 +++ linux-2.2.18-raw-lvm0.9/Documentation/LVM-HOWTO Wed Dec 13 11:20:11 2000 @@ -0,0 +1,118 @@ +Heinz Mauelshagen's LVM (Logical Volume Manager) howto. 01/28/1999 + + +Abstract: +--------- +The LVM adds a kind of virtual disks and virtual partitions functionality +to the Linux operating system + +It achieves this by adding an additional layer between the physical peripherals +and the i/o interface in the kernel. + +This allows the concatenation of several disk partitions or total disks +(so-called physical volumes or PVs) or even multiple devices +to form a storage pool (so-called Volume Group or VG) with +allocation units called physical extents (called PE). +You can think of the volume group as a virtual disk. +Please see scenario below. + +Some or all PEs of this VG then can be allocated to so-called Logical Volumes +or LVs in units called logical extents or LEs. +Each LE is mapped to a corresponding PE. +LEs and PEs are equal in size. +Logical volumes are a kind of virtual partitions. + + +The LVs can be used through device special files similar to the known +/dev/sd[a-z]* or /dev/hd[a-z]* named /dev/VolumeGroupName/LogicalVolumeName. + +But going beyond this, you are able to extend or reduce +VGs _AND_ LVs at runtime! + +So... +If for example the capacity of a LV gets too small and your VG containing +this LV is full, you could add another PV to that VG and simply extend +the LV afterwards. +If you reduce or delete a LV you can use the freed capacity for different +LVs in the same VG. + + +The above scenario looks like this: + + /------------------------------------------\ + | /--PV2---\ VG 1 /--PVn---\ | + | |-VGDA---| |-VGDA-- | | + | |PE1PE2..| |PE1PE2..| | + | | | ...... | | | + | | | | | | + | | /-----------------------\ | | + | | \-------LV 1------------/ | | + | | ..PEn| | ..PEn| | + | \--------/ \--------/ | + \------------------------------------------/ + +PV 1 could be /dev/sdc1 sized 3GB +PV n could be /dev/sde1 sized 4GB +VG 1 could be test_vg +LV 1 could be /dev/test_vg/test_lv +VGDA is the volume group descriptor area holding the LVM metadata +PE1 up to PEn is the number of physical extents on each disk(partition) + + + +Installation steps see INSTALL and insmod(1)/modprobe(1), kmod/kerneld(8) +to load the logical volume manager module if you did not bind it +into the kernel. + + +Configuration steps for getting the above scenario: + +1. Set the partition system id to 0xFE on /dev/sdc1 and /dev/sde1. + +2. do a "pvcreate /dev/sd[ce]1" + For testing purposes you can use more than one partition on a disk. + You should not use more than one partition because in the case of + a striped LV you'll have a performance breakdown. + +3. do a "vgcreate test_vg /dev/sd[ce]1" to create the new VG named "test_vg" + which has the total capacity of both partitions. + vgcreate activates (transfers the metadata into the LVM driver in the kernel) + the new volume group too to be able to create LVs in the next step. + +4. do a "lvcreate -L1500 -ntest_lv test_vg" to get a 1500MB linear LV named + "test_lv" and it's block device special "/dev/test_vg/test_lv". + + Or do a "lvcreate -i2 -I4 -l1500 -nanother_test_lv test_vg" to get a 100 LE + large logical volume with 2 stripes and stripesize 4 KB. + +5. For example generate a filesystem in one LV with + "mke2fs /dev/test_vg/test_lv" and mount it. + +6. extend /dev/test_vg/test_lv to 1600MB with relative size by + "lvextend -L+100 /dev/test_vg/test_lv" + or with absolute size by + "lvextend -L1600 /dev/test_vg/test_lv" + +7. reduce /dev/test_vg/test_lv to 900 logical extents with relative extents by + "lvreduce -l-700 /dev/test_vg/test_lv" + or with absolute extents by + "lvreduce -l900 /dev/test_vg/test_lv" + +9. rename a VG by deactivating it with + "vgchange -an test_vg" # only VGs with _no_ open LVs can be deactivated! + "vgrename test_vg whatever" + and reactivate it again by + "vgchange -ay whatever" + +9. rename a LV after closing it by + "lvchange -an /dev/whatever/test_lv" # only closed LVs can be deactivated + "lvrename /dev/whatever/test_lv /dev/whatever/whatvolume" + or by + "lvrename whatever test_lv whatvolume" + and reactivate it again by + "lvchange -ay /dev/whatever/whatvolume" + +10. if you have the resize2fs program from e2fsprogs 1.19 or later and/or the + GNU ext2resize tools, you are able to resize the ext2 type filesystems + contained in logical volumes without destroying the data by + "e2fsadm -L+100 /dev/test_vg/another_test_lv" diff -u linux/drivers/block/Config.in.orig linux/drivers/block/Config.in --- linux/drivers/block/Config.in.orig Fri Jan 12 00:44:44 2001 +++ linux/drivers/block/Config.in Fri Jan 12 13:45:41 2001 @@ -182,6 +182,7 @@ comment 'Additional Block Devices' +tristate 'Logical volume manager (LVM) support' CONFIG_BLK_DEV_LVM N tristate 'Loopback device support' CONFIG_BLK_DEV_LOOP if [ "$CONFIG_NET" = "y" ]; then tristate 'Network block device support' CONFIG_BLK_DEV_NBD diff -urN -X /home/joe/packages/dontdiff linux-2.2.18-raw/drivers/block/Makefile linux-2.2.18-raw-lvm0.9/drivers/block/Makefile --- linux-2.2.18-raw/drivers/block/Makefile Wed Dec 13 15:08:14 2000 +++ linux-2.2.18-raw-lvm0.9/drivers/block/Makefile Wed Dec 13 11:20:11 2000 @@ -266,6 +266,14 @@ endif endif +ifeq ($(CONFIG_BLK_DEV_LVM),y) +L_OBJS += lvm.o lvm-snap.o lvm-fs.o +else + ifeq ($(CONFIG_BLK_DEV_LVM),m) + M_OBJS += lvm-mod.o + endif +endif + ifeq ($(CONFIG_BLK_DEV_MD),y) LX_OBJS += md.o @@ -321,6 +329,9 @@ endif include $(TOPDIR)/Rules.make + +lvm-mod.o: lvm.o lvm-snap.o lvm-fs.o + $(LD) -r -o $@ lvm.o lvm-snap.o lvm-fs.o ide-mod.o: ide.o $(IDE_OBJS) $(LD) $(LD_RFLAG) -r -o $@ ide.o $(IDE_OBJS) diff -urN -X /home/joe/packages/dontdiff linux-2.2.18-raw/drivers/block/README.lvm linux-2.2.18-raw-lvm0.9/drivers/block/README.lvm --- linux-2.2.18-raw/drivers/block/README.lvm Thu Jan 1 01:00:00 1970 +++ linux-2.2.18-raw-lvm0.9/drivers/block/README.lvm Wed Dec 13 11:20:11 2000 @@ -0,0 +1,8 @@ + +This is the Logical Volume Manager driver for Linux, + +Tools, library that manage logical volumes can be found +at . + +There you can obtain actual driver versions too. + diff -urN -X /home/joe/packages/dontdiff linux-2.2.18-raw/drivers/block/genhd.c linux-2.2.18-raw-lvm0.9/drivers/block/genhd.c --- linux-2.2.18-raw/drivers/block/genhd.c Wed Dec 13 15:08:14 2000 +++ linux-2.2.18-raw-lvm0.9/drivers/block/genhd.c Wed Dec 13 11:20:11 2000 @@ -54,6 +54,11 @@ le32_to_cpu(__a); \ }) +#if defined CONFIG_BLK_DEV_LVM || defined CONFIG_BLK_DEV_LVM_MODULE +#include +void ( *lvm_hd_name_ptr) ( char *, int) = NULL; +#endif + struct gendisk *gendisk_head = NULL; static int current_minor = 0; @@ -135,6 +140,14 @@ break; case MD_MAJOR: unit -= 'a'-'0'; + break; +#if defined CONFIG_BLK_DEV_LVM || defined CONFIG_BLK_DEV_LVM_MODULE + case LVM_BLK_MAJOR: + *buf = 0; + if ( lvm_hd_name_ptr != NULL) + ( lvm_hd_name_ptr) ( buf, minor); + return buf; +#endif } part = minor & ((1 << hd->minor_shift) - 1); if (hd->major >= SCSI_DISK1_MAJOR && hd->major <= SCSI_DISK7_MAJOR) { diff -urN -X /home/joe/packages/dontdiff linux-2.2.18-raw/kernel/ksyms.c linux-2.2.18-raw-lvm0.9/kernel/ksyms.c --- linux-2.2.18-raw/kernel/ksyms.c Wed Dec 13 15:08:32 2000 +++ linux-2.2.18-raw-lvm0.9/kernel/ksyms.c Wed Dec 13 11:20:11 2000 @@ -85,6 +85,11 @@ #endif EXPORT_SYMBOL(get_options); +#ifdef CONFIG_BLK_DEV_LVM_MODULE + extern void (*lvm_hd_name_ptr) ( char*, int); + EXPORT_SYMBOL(lvm_hd_name_ptr); +#endif + /* process memory management */ EXPORT_SYMBOL(do_mmap); EXPORT_SYMBOL(do_munmap); @@ -112,6 +117,7 @@ EXPORT_SYMBOL(mem_map); EXPORT_SYMBOL(remap_page_range); EXPORT_SYMBOL(max_mapnr); +EXPORT_SYMBOL(num_physpages); EXPORT_SYMBOL(high_memory); EXPORT_SYMBOL(update_vm_cache); EXPORT_SYMBOL(update_vm_cache_conditional);