Difference between revisions of "LVM2"


From Knoppix Documentation Wiki
Jump to: navigation, search
(fixed markup)
 
(9 intermediate revisions by 5 users not shown)
Line 1: Line 1:
If you want to use LVM2 in Knoppix you have to load and install the kernel module and some programs.
+
*<u>If you use an old Knoppix version</u> you may need to install LVM tools first. Version 5.0.1 and later (at least) already have the packages and dm-mod module loaded, and the following first steps are not necessary.
To activate it just type as root
+
  
 
  # modprobe dm-mod
 
  # modprobe dm-mod
 
  # apt-get update
 
  # apt-get update
 
  # apt-get install lvm-common lvm2
 
  # apt-get install lvm-common lvm2
 
+
Remember that the tools are in /lib/lvm-200 but if you don't want to type the complete path, you may link them into /usr/bin.
+
If you needed the above steps, remember that the tools are in /lib/lvm-200  
 
+
but if you don't want to type the complete path, you may link them into /usr/bin.
 +
 
  # lndir /lib/lvm-200/ /usr/sbin/
 
  # lndir /lib/lvm-200/ /usr/sbin/
  
  
To use existing volume groups you have to activate them.
+
*To use existing volume groups you have to activate them.
 +
-----
  
 
  # vgscan
 
  # vgscan
 
  # vgchange -a y
 
  # vgchange -a y
  
 +
*To mount a logical volume first find out what it is called, unless you know already. Use lvs or vgdisplay/lvdisplay for this.
 +
-----
 +
# lvs
 +
LV  VG  Attr  LSize Origin Snap%  Move Log Copy%
 +
home vg  -wi-ao 2.09G
 +
var  vg  -wi-ao 1.32G
  
 +
*In this example, the volume group 'vg' contains two logical volumes, called 'home' and 'var'. To mount the 'home' volume:
 +
-----
  
 +
# mount /dev/vg/home /mnt/tmp
 +
# ls /mnt/tmp
 +
lost+found  fuzzy  joe  mp3
  
<div id="wikitikitavi" style="overflow:auto; height: 1px; ">
+
*The volumes can be accessed with names '''/dev/<vg>/<lv>''' or '''/dev/mapper/vg-lv'''. For example, the file /dev/vg/home is a symbolic link to /dev/mapper/vg-home, and you can use either name to mount it.
[[http://WTHP1.disney.com] [WTHPD1]]
+
[http://WTHP2.disney.com  WTHPD2]
+
[WTHPD3](http://WTHP3.disney.com)
+
[http://WTHP4.disney.com | WTHPD4]
+
[WTHPD5 | http://WTHP5.disney.com]
+
</div>
+

Latest revision as of 19:18, 3 May 2008

  • If you use an old Knoppix version you may need to install LVM tools first. Version 5.0.1 and later (at least) already have the packages and dm-mod module loaded, and the following first steps are not necessary.
# modprobe dm-mod
# apt-get update
# apt-get install lvm-common lvm2

If you needed the above steps, remember that the tools are in /lib/lvm-200 
but if you don't want to type the complete path, you may link them into /usr/bin.

# lndir /lib/lvm-200/ /usr/sbin/


  • To use existing volume groups you have to activate them.

# vgscan
# vgchange -a y
  • To mount a logical volume first find out what it is called, unless you know already. Use lvs or vgdisplay/lvdisplay for this.

# lvs
LV   VG   Attr   LSize Origin Snap%  Move Log Copy%
home vg   -wi-ao 2.09G
var  vg   -wi-ao 1.32G
  • In this example, the volume group 'vg' contains two logical volumes, called 'home' and 'var'. To mount the 'home' volume:

# mount /dev/vg/home /mnt/tmp
# ls /mnt/tmp
lost+found   fuzzy   joe   mp3
  • The volumes can be accessed with names /dev/<vg>/<lv> or /dev/mapper/vg-lv. For example, the file /dev/vg/home is a symbolic link to /dev/mapper/vg-home, and you can use either name to mount it.