/l3/users/eb/2009/linux3/user :1 :2 :3 :4 :5 :6 :7 :8 :9 :10 :11 :12 :13 :14 :15 |
|
#apt-get install lmv2
Reading package lists... Done Building dependency tree Reading state information... Done E: Couldn't find package lmv2 |
#apt-get install lvm2
Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: portmap Use 'apt-get autoremove' to remove them. The following NEW packages will be installed: lvm2 0 upgraded, 1 newly installed, 0 to remove and 20 not upgraded. Need to get 363kB of archives. ... (Reading database ... 55172 files and directories currently installed.) Unpacking lvm2 (from .../lvm2_2.02.44-3_i386.deb) ... Processing triggers for man-db ... Setting up lvm2 (2.02.44-3) ... ^C dpkg: error processing lvm2 (--configure): subprocess installed post-installation script killed by signal (Interrupt) Errors were encountered while processing: lvm2 E: Sub-process /usr/bin/dpkg returned an error code (1) |
#aoe-stat --help
Usage: grep [OPTION]... PATTERN [FILE]... Search for PATTERN in each FILE or standard input. PATTERN is, by default, a basic regular expression (BRE). Example: grep -i 'hello world' menu.h main.c Regexp selection and interpretation: -E, --extended-regexp PATTERN is an extended regular expression (ERE) -F, --fixed-strings PATTERN is a set of newline-separated fixed strings -G, --basic-regexp PATTERN is a basic regular expression (BRE) -P, --perl-regexp PATTERN is a Perl regular expression -e, --regexp=PATTERN use PATTERN for matching ... -U, --binary do not strip CR characters at EOL (MSDOS) -u, --unix-byte-offsets report offsets as if CRs were not there (MSDOS) `egrep' means `grep -E'. `fgrep' means `grep -F'. Direct invocation as either `egrep' or `fgrep' is deprecated. With no FILE, or when FILE is -, read standard input. If less than two FILEs are given, assume -h. Exit status is 0 if any line was selected, 1 otherwise; if any error occurs and -q was not given, the exit status is 2. Report bugs to: bug-grep@gnu.org GNU Grep home page: <http://www.gnu.org/software/grep/> General help using GNU software: <http://www.gnu.org/gethelp/> |
#apt-cache search raid
aoetools - tools to assist in using ATA over Ethernet array-info - command line tool reporting RAID status for several RAID types boxbackup-server - server for the BoxBackup remote backup system cciss-vol-status - HP SmartArray RAID Volume Status Checker cpqarrayd - monitoring tool for HP (Compaq) SmartArray controllers dmraid - Device-Mapper Software RAID support tool dmsetup - The Linux Kernel Device Mapper userspace library dpt-i2o-raidutils - Adaptec I2O hardware RAID management utilities drbd0.7-module-source - RAID 1 over tcp/ip for Linux module source drbd0.7-utils - RAID 1 over tcp/ip for Linux utilities ... mondo - powerful disaster recovery suite mondo-doc - manual for Mondo, a powerful disaster recovery suite mpt-status - get RAID status out of mpt (and other) HW RAID controllers parchive - Use PAR files to reconstruct missing parts of multi-part archives parted - The GNU Parted disk partition resizing program raidutils - Transition Package for raidutils rename to dpt-i2o-raidutils system-config-lvm - A utility for graphically configuring Logical Volumes testdisk - Partition scanner and disk recovery tool varmon - VA RAID monitor xscreensaver-data-extra - data files to be shared among screensaver frontends |
#apt-get install lvm2
Reading package lists... Done Building dependency tree Reading state information... Done lvm2 is already the newest version. The following packages were automatically installed and are no longer required: portmap Use 'apt-get autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 20 not upgraded. 1 not fully installed or removed. After this operation, 0B of additional disk space will be used. Setting up lvm2 (2.02.44-3) ... Setting up LVM Volume Groups Reading all physical volumes. This may take a while... . |
#pvcreate --help
pvcreate: Initialize physical volume(s) for use by LVM pvcreate [--restorefile file] [-d|--debug] [-f[f]|--force [--force]] [-h|-?|--help] [--labelsector sector] [-M|--metadatatype 1|2] [--metadatacopies #copies] [--metadatasize MetadataSize[kKmMgGtTpPeE]] [--setphysicalvolumesize PhysicalVolumeSize[kKmMgGtTpPeE] [-t|--test] [-u|--uuid uuid] [-v|--verbose] [-y|--yes] [-Z|--zero {y|n}] [--version] PhysicalVolume [PhysicalVolume...] |
#mount
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755) proc on /proc type proc (rw,noexec,nosuid,nodev) sysfs on /sys type sysfs (rw,noexec,nosuid,nodev) procbususb on /proc/bus/usb type usbfs (rw) udev on /dev type tmpfs (rw,mode=0755) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620) rootfs on / type rootfs (rw) /dev/sdb1 on /root/mnt1 type ext3 (rw) |
#pvcreate --help
pvcreate: Initialize physical volume(s) for use by LVM pvcreate [--restorefile file] [-d|--debug] [-f[f]|--force [--force]] [-h|-?|--help] [--labelsector sector] [-M|--metadatatype 1|2] [--metadatacopies #copies] [--metadatasize MetadataSize[kKmMgGtTpPeE]] [--setphysicalvolumesize PhysicalVolumeSize[kKmMgGtTpPeE] [-t|--test] [-u|--uuid uuid] [-v|--verbose] [-y|--yes] [-Z|--zero {y|n}] [--version] PhysicalVolume [PhysicalVolume...] |
#pvcreate /dev/sdb[12]
Can't open /dev/sdb1 exclusively. Mounted filesystem? Physical volume "/dev/sdb2" successfully created |
#mount
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755) proc on /proc type proc (rw,noexec,nosuid,nodev) sysfs on /sys type sysfs (rw,noexec,nosuid,nodev) procbususb on /proc/bus/usb type usbfs (rw) udev on /dev type tmpfs (rw,mode=0755) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620) rootfs on / type rootfs (rw) /dev/sdb1 on /root/mnt1 type ext3 (rw) |
#umount /mnt
umount: /mnt: not mounted |
#umount /root/mnt1
|
#pvcreate /dev/sdb[12]
Physical volume "/dev/sdb1" successfully created Physical volume "/dev/sdb2" successfully created |
#file -s /dev/sdb1
/dev/sdb1: LVM2 (Linux Logical Volume Manager) , UUID: E8grzYXQm6xMlr79eACo1FcPmpZaAH3 |
#file -s /dev/sdb[12]
/dev/sdb1: LVM2 (Linux Logical Volume Manager) , UUID: E8grzYXQm6xMlr79eACo1FcPmpZaAH3 /dev/sdb2: LVM2 (Linux Logical Volume Manager) , UUID: pmK8xNdC2HuAAz3g2V3DQcn3FrnUiLj |
#vgcreate --help
vgcreate: Create a volume group vgcreate [-A|--autobackup {y|n}] [--addtag Tag] [--alloc AllocationPolicy] [-c|--clustered {y|n}] [-d|--debug] [-h|--help] [-l|--maxlogicalvolumes MaxLogicalVolumes] [-M|--metadatatype 1|2] [-p|--maxphysicalvolumes MaxPhysicalVolumes] [-s|--physicalextentsize PhysicalExtentSize[kKmMgGtTpPeE]] [-t|--test] [-v|--verbose] [--version] VolumeGroupName PhysicalVolume [PhysicalVolume...] |
#vgcreate TEST_VG_VOL /dev/sdb[12]
Volume group "TEST_VG_VOL" successfully created |
#pvdisplay
--- Physical volume --- PV Name /dev/sdb1 VG Name TEST_VG_VOL PV Size 9.32 GB / not usable 2.41 MB Allocatable yes PE Size (KByte) 4096 Total PE 2386 Free PE 2386 Allocated PE 0 PV UUID E8grzY-XQm6-xMlr-79eA-Co1F-cPmp-ZaAH3B --- Physical volume --- PV Name /dev/sdb2 VG Name TEST_VG_VOL PV Size 9.32 GB / not usable 2.44 MB Allocatable yes PE Size (KByte) 4096 Total PE 2386 Free PE 2386 Allocated PE 0 PV UUID pmK8xN-dC2H-uAAz-3g2V-3DQc-n3Fr-nUiLjg |
#vgdisplay
--- Volume group --- VG Name TEST_VG_VOL System ID Format lvm2 Metadata Areas 2 Metadata Sequence No 1 VG Access read/write VG Status resizable MAX LV 0 Cur LV 0 Open LV 0 Max PV 0 Cur PV 2 Act PV 2 VG Size 18.64 GB PE Size 4.00 MB Total PE 4772 Alloc PE / Size 0 / 0 Free PE / Size 4772 / 18.64 GB VG UUID evk7UV-cG3i-snTY-BYXK-n8w6-tTaC-fj13i4 |
#lvcreate -l1024 -nvol1 /dev/TEST_VG_VOL
Logical volume "vol1" created |
#lvdisplay
--- Logical volume --- LV Name /dev/TEST_VG_VOL/vol1 VG Name TEST_VG_VOL LV UUID 2rQ2rD-nDBg-cmfk-oLBT-Qbkw-1uJe-c6FnEP LV Write Access read/write LV Status available # open 0 LV Size 4.00 GB Current LE 1024 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 254:2 |
#file /dev/
Display all 185 possibilities? (y or n) |
#file /dev/
Display all 185 possibilities? (y or n) adsp1 loop3 root tty23 tty57 agpgart loop4 rtc tty24 tty58 audio loop5 rtc0 tty25 tty59 audio1 loop6 sda tty26 tty6 block/ loop7 sda1 tty27 tty60 bsg/ MAKEDEV sdb tty28 tty61 bus/ mapper/ sdb1 tty29 tty62 cdrom1 mem sdb2 tty3 tty63 char/ mixer sdb3 tty30 tty7 ... initctl ram15 tty14 tty48 usbdev5.1_ep00 .initramfs/ ram2 tty15 tty49 usbdev5.1_ep81 .initramfs-tools ram3 tty16 tty5 vcs input/ ram4 tty17 tty50 vcs1 kmem ram5 tty18 tty51 vcs7 kmsg ram6 tty19 tty52 vcsa log ram7 tty2 tty53 vcsa1 loop0 ram8 tty20 tty54 vcsa7 loop1 ram9 tty21 tty55 xconsole loop2 random tty22 tty56 zero |
#file -s /dev/mapper/TEST_VG_VOL-vol1
/dev/mapper/TEST_VG_VOL-vol1: data |
#ls -l /dev/mapper/TEST_VG_VOL-vol1
brw-rw---- 1 root disk 254, 2 2009-05-30 18:04 /dev/mapper/TEST_VG_VOL-vol1 |
#fdisk -l /dev/mapper/TEST_VG_VOL-vol1
Disk /dev/mapper/TEST_VG_VOL-vol1: 4294 MB, 4294967296 bytes 255 heads, 63 sectors/track, 522 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x00000000 Disk /dev/mapper/TEST_VG_VOL-vol1 doesn't contain a valid partition table |
#for i in {1..5}; do lvcreate -L1G -n vv$i /dev/TEST_VG_VOL ; done
Logical volume "vv1" created Logical volume "vv2" created Logical volume "vv3" created Logical volume "vv4" created Logical volume "vv5" created |
#lvdisplay
--- Logical volume --- LV Name /dev/TEST_VG_VOL/vol1 VG Name TEST_VG_VOL LV UUID 2rQ2rD-nDBg-cmfk-oLBT-Qbkw-1uJe-c6FnEP LV Write Access read/write LV Status available # open 0 LV Size 4.00 GB Current LE 1024 Segments 1 ... LV Write Access read/write LV Status available # open 0 LV Size 1.00 GB Current LE 256 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 254:7 |
#lvs
LV VG Attr LSize Origin Snap% Move Log Copy% Convert vol1 TEST_VG_VOL -wi-a- 4.00G vv1 TEST_VG_VOL -wi-a- 1.00G vv2 TEST_VG_VOL -wi-a- 1.00G vv3 TEST_VG_VOL -wi-a- 1.00G vv4 TEST_VG_VOL -wi-a- 1.00G vv5 TEST_VG_VOL -wi-a- 1.00G |
#mkfs.ext3 /dev/TEST_VG_VOL/vol1
mke2fs 1.41.5 (23-Apr-2009) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) 262144 inodes, 1048576 blocks 52428 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=1073741824 32 block groups 32768 blocks per group, 32768 fragments per group 8192 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736 Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 20 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override. |
#df /mnt
Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/TEST_VG_VOL-vol1 4128448 139388 3779348 4% /mnt |
#df -h /mnt
Filesystem Size Used Avail Use% Mounted on /dev/mapper/TEST_VG_VOL-vol1 4.0G 137M 3.7G 4% /mnt |
#umount /mnt
|
#lvextend --help
lvextend: Add space to a logical volume lvextend [-A|--autobackup y|n] [--alloc AllocationPolicy] [-d|--debug] [-f|--force] [-h|--help] [-i|--stripes Stripes [-I|--stripesize StripeSize]] {-l|--extents [+]LogicalExtentsNumber[%{VG|PVS|FREE}] | -L|--size [+]LogicalVolumeSize[kKmMgGtTpPeE]} [-m|--mirrors Mirrors] [-n|--nofsck] [-r|--resizefs] [-t|--test] [--type VolumeType] [-v|--verbose] [--version] LogicalVolume[Path] [ PhysicalVolumePath... ] |
#lvresize -L+1G /dev/TEST_VG_VOL/vol1
Extending logical volume vol1 to 5.00 GB Logical volume vol1 successfully resized |
#apt-get install ext2resize
Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: portmap Use 'apt-get autoremove' to remove them. The following NEW packages will be installed: ext2resize 0 upgraded, 1 newly installed, 0 to remove and 20 not upgraded. Need to get 209kB of archives. After this operation, 377kB of additional disk space will be used. Get:1 http://127.0.0.1 sid/main ext2resize 1.1.19-9 [209kB] Fetched 209kB in 0s (1692kB/s) Selecting previously deselected package ext2resize. (Reading database ... 55274 files and directories currently installed.) Unpacking ext2resize (from .../ext2resize_1.1.19-9_i386.deb) ... Processing triggers for man-db ... Setting up ext2resize (1.1.19-9) ... |
#ext2online /dev/TEST_VG_VOL/vol1
ext2online v1.1.19 - 2001/03/18 for EXT2FS 0.5b |
#pvdisplay
--- Physical volume --- PV Name /dev/sdb1 VG Name TEST_VG_VOL PV Size 9.32 GB / not usable 2.41 MB Allocatable yes PE Size (KByte) 4096 Total PE 2386 Free PE 850 Allocated PE 1536 PV UUID E8grzY-XQm6-xMlr-79eA-Co1F-cPmp-ZaAH3B --- Physical volume --- PV Name /dev/sdb2 VG Name TEST_VG_VOL PV Size 9.32 GB / not usable 2.44 MB Allocatable yes PE Size (KByte) 4096 Total PE 2386 Free PE 1362 Allocated PE 1024 PV UUID pmK8xN-dC2H-uAAz-3g2V-3DQc-n3Fr-nUiLjg |
#fdisk -l /dev/sdb
Disk /dev/sdb: 320.0 GB, 320072933376 bytes 255 heads, 63 sectors/track, 38913 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0xce5cf3c1 Device Boot Start End Blocks Id System /dev/sdb1 1 1217 9775521 83 Linux /dev/sdb2 1218 2434 9775552+ 83 Linux /dev/sdb3 2435 38913 293017567+ 5 Extended /dev/sdb5 2435 3651 9775521 83 Linux /dev/sdb6 3652 4867 9767488+ 83 Linux /dev/sdb7 4868 38913 273474463+ 83 Linux |
#pvcreate /dev/sdb5
Physical volume "/dev/sdb5" successfully created |
#vgextend --help
vgextend: Add physical volumes to a volume group vgextend [-A|--autobackup y|n] [-d|--debug] [-h|--help] [-t|--test] [-v|--verbose] [--version] VolumeGroupName PhysicalDevicePath [PhysicalDevicePath...] |
#vgdisplay
--- Volume group --- VG Name TEST_VG_VOL System ID Format lvm2 Metadata Areas 2 Metadata Sequence No 8 VG Access read/write VG Status resizable MAX LV 0 Cur LV 6 Open LV 1 Max PV 0 Cur PV 2 Act PV 2 VG Size 18.64 GB PE Size 4.00 MB Total PE 4772 Alloc PE / Size 2560 / 10.00 GB Free PE / Size 2212 / 8.64 GB VG UUID evk7UV-cG3i-snTY-BYXK-n8w6-tTaC-fj13i4 |
#vgextend TEST_VG_VOL /dev/sdb5
Volume group "TEST_VG_VOL" successfully extended |
#mount
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755) proc on /proc type proc (rw,noexec,nosuid,nodev) sysfs on /sys type sysfs (rw,noexec,nosuid,nodev) procbususb on /proc/bus/usb type usbfs (rw) udev on /dev type tmpfs (rw,mode=0755) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620) rootfs on / type rootfs (rw) /dev/mapper/TEST_VG_VOL-vol1 on /mnt type ext3 (rw) |
#pvdisplay
--- Physical volume --- PV Name /dev/sdb1 VG Name TEST_VG_VOL PV Size 9.32 GB / not usable 2.41 MB Allocatable yes PE Size (KByte) 4096 Total PE 2386 Free PE 850 Allocated PE 1536 PV UUID E8grzY-XQm6-xMlr-79eA-Co1F-cPmp-ZaAH3B ... --- Physical volume --- PV Name /dev/sdb5 VG Name TEST_VG_VOL PV Size 9.32 GB / not usable 2.41 MB Allocatable yes PE Size (KByte) 4096 Total PE 2386 Free PE 2386 Allocated PE 0 PV UUID R3BWIl-ptAH-vJQP-4qdY-jDip-t6d4-qrlKum |
#vgdisplay
--- Volume group --- VG Name TEST_VG_VOL System ID Format lvm2 Metadata Areas 3 Metadata Sequence No 9 VG Access read/write VG Status resizable MAX LV 0 Cur LV 6 Open LV 1 Max PV 0 Cur PV 3 Act PV 3 VG Size 27.96 GB PE Size 4.00 MB Total PE 7158 Alloc PE / Size 2560 / 10.00 GB Free PE / Size 4598 / 17.96 GB VG UUID evk7UV-cG3i-snTY-BYXK-n8w6-tTaC-fj13i4 |
#pvmove /dev/sdb1
/dev/sdb1: Moved: 6.3% /dev/sdb1: Moved: 12.7% /dev/sdb1: Moved: 19.3% /dev/sdb1: Moved: 25.8% /dev/sdb1: Moved: 32.2% /dev/sdb1: Moved: 38.6% /dev/sdb1: Moved: 45.2% /dev/sdb1: Moved: 51.8% /dev/sdb1: Moved: 58.1% /dev/sdb1: Moved: 64.6% /dev/sdb1: Moved: 66.7% /dev/sdb1: Moved: 73.2% /dev/sdb1: Moved: 79.9% /dev/sdb1: Moved: 83.3% /dev/sdb1: Moved: 89.6% /dev/sdb1: Moved: 96.3% /dev/sdb1: Moved: 100.0% |
#vgreduce --help
vgreduce: Remove physical volume(s) from a volume group vgreduce [-a|--all] [-A|--autobackup y|n] [-d|--debug] [-h|--help] [--mirrorsonly] [--removemissing] [-f|--force] [-t|--test] [-v|--verbose] [--version] VolumeGroupName [PhysicalVolumePath...] |
#pvdisplay
--- Physical volume --- PV Name /dev/sdb1 VG Name TEST_VG_VOL PV Size 9.32 GB / not usable 2.41 MB Allocatable yes PE Size (KByte) 4096 Total PE 2386 Free PE 2386 Allocated PE 0 PV UUID E8grzY-XQm6-xMlr-79eA-Co1F-cPmp-ZaAH3B ... --- Physical volume --- PV Name /dev/sdb5 VG Name TEST_VG_VOL PV Size 9.32 GB / not usable 2.41 MB Allocatable yes PE Size (KByte) 4096 Total PE 2386 Free PE 1106 Allocated PE 1280 PV UUID R3BWIl-ptAH-vJQP-4qdY-jDip-t6d4-qrlKum |
#vgreduce -a
Please give volume group name and physical volume paths Run `vgreduce --help' for more information. |
#vgreduce -a TEST_VG_VOL
Removed "/dev/sdb1" from volume group "TEST_VG_VOL" Physical volume "/dev/sdb2" still in use Physical volume "/dev/sdb5" still in use |
#vgreduce TEST_VG_VOL /dev/sdb1
Physical Volume "/dev/sdb1" not found in Volume Group "TEST_VG_VOL" |
#pvdisplay
--- Physical volume --- PV Name /dev/sdb2 VG Name TEST_VG_VOL PV Size 9.32 GB / not usable 2.44 MB Allocatable yes PE Size (KByte) 4096 Total PE 2386 Free PE 1106 Allocated PE 1280 PV UUID pmK8xN-dC2H-uAAz-3g2V-3DQc-n3Fr-nUiLjg ... --- NEW Physical volume --- PV Name /dev/sdb1 VG Name PV Size 9.32 GB Allocatable NO PE Size (KByte) 0 Total PE 0 Free PE 0 Allocated PE 0 PV UUID E8grzY-XQm6-xMlr-79eA-Co1F-cPmp-ZaAH3B |
#pvremove /dev/sdb1
Labels on physical volume "/dev/sdb1" successfully wiped |
#pvdisplay
--- Physical volume --- PV Name /dev/sdb2 VG Name TEST_VG_VOL PV Size 9.32 GB / not usable 2.44 MB Allocatable yes PE Size (KByte) 4096 Total PE 2386 Free PE 1106 Allocated PE 1280 PV UUID pmK8xN-dC2H-uAAz-3g2V-3DQc-n3Fr-nUiLjg --- Physical volume --- PV Name /dev/sdb5 VG Name TEST_VG_VOL PV Size 9.32 GB / not usable 2.41 MB Allocatable yes PE Size (KByte) 4096 Total PE 2386 Free PE 1106 Allocated PE 1280 PV UUID R3BWIl-ptAH-vJQP-4qdY-jDip-t6d4-qrlKum |
#vgdisplay
--- Volume group --- VG Name TEST_VG_VOL System ID Format lvm2 Metadata Areas 2 Metadata Sequence No 15 VG Access read/write VG Status resizable MAX LV 0 Cur LV 6 Open LV 1 Max PV 0 Cur PV 2 Act PV 2 VG Size 18.64 GB PE Size 4.00 MB Total PE 4772 Alloc PE / Size 2560 / 10.00 GB Free PE / Size 2212 / 8.64 GB VG UUID evk7UV-cG3i-snTY-BYXK-n8w6-tTaC-fj13i4 |
#lvs
LV VG Attr LSize Origin Snap% Move Log Copy% Convert vol1 TEST_VG_VOL -wi-ao 5.00G vv1 TEST_VG_VOL -wi-a- 1.00G vv2 TEST_VG_VOL -wi-a- 1.00G vv3 TEST_VG_VOL -wi-a- 1.00G vv4 TEST_VG_VOL -wi-a- 1.00G vv5 TEST_VG_VOL -wi-a- 1.00G |
#ls /mnt
lost+found |
#umount /mnt
|
#lvdisplay
--- Logical volume --- LV Name /dev/TEST_VG_VOL/vol1 VG Name TEST_VG_VOL LV UUID 2rQ2rD-nDBg-cmfk-oLBT-Qbkw-1uJe-c6FnEP LV Write Access read/write LV Status available # open 0 LV Size 5.00 GB Current LE 1280 Segments 2 ... LV Write Access read/write LV Status available # open 0 LV Size 1.00 GB Current LE 256 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 254:7 |
#fdisk -l /dev/sdb
Disk /dev/sdb: 320.0 GB, 320072933376 bytes 255 heads, 63 sectors/track, 38913 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0xce5cf3c1 Device Boot Start End Blocks Id System /dev/sdb1 1 1217 9775521 83 Linux /dev/sdb2 1218 2434 9775552+ 83 Linux /dev/sdb3 2435 38913 293017567+ 5 Extended /dev/sdb5 2435 3651 9775521 83 Linux /dev/sdb6 3652 4867 9767488+ 83 Linux /dev/sdb7 4868 38913 273474463+ 83 Linux |
#vgdisplay
--- Volume group --- VG Name TEST_VG_VOL System ID Format lvm2 Metadata Areas 2 Metadata Sequence No 15 VG Access read/write VG Status resizable MAX LV 0 Cur LV 6 Open LV 0 Max PV 0 Cur PV 2 Act PV 2 VG Size 18.64 GB PE Size 4.00 MB Total PE 4772 Alloc PE / Size 2560 / 10.00 GB Free PE / Size 2212 / 8.64 GB VG UUID evk7UV-cG3i-snTY-BYXK-n8w6-tTaC-fj13i4 |
#pvdisplay
--- Physical volume --- PV Name /dev/sdb2 VG Name TEST_VG_VOL PV Size 9.32 GB / not usable 2.44 MB Allocatable yes PE Size (KByte) 4096 Total PE 2386 Free PE 1106 Allocated PE 1280 PV UUID pmK8xN-dC2H-uAAz-3g2V-3DQc-n3Fr-nUiLjg --- Physical volume --- PV Name /dev/sdb5 VG Name TEST_VG_VOL PV Size 9.32 GB / not usable 2.41 MB Allocatable yes PE Size (KByte) 4096 Total PE 2386 Free PE 1106 Allocated PE 1280 PV UUID R3BWIl-ptAH-vJQP-4qdY-jDip-t6d4-qrlKum |
#exit
exit |
#apt-get install mdadm
Selecting previously deselected package mdadm. (Reading database ... 55310 files and directories currently installed.) Unpacking mdadm (from .../mdadm_2.6.9-3_i386.deb) ... Processing triggers for man-db ... Setting up mdadm (2.6.9-3) ... Generating array device nodes... done. Generating mdadm.conf... done. update-initramfs: deferring update (trigger activated) Starting MD monitoring service: mdadm --monitor. Assembling MD arrays...done (no arrays found in config file or automatically). Processing triggers for initramfs-tools ... update-initramfs: Generating /boot/initrd.img-2.6.29-2-686 dpkg: warning: obsolete option '--print-installation-architecture', please use '--print-architecture' instead. dpkg: warning: obsolete option '--print-installation-architecture', please use '--print-architecture' instead. W: mdadm: /etc/mdadm/mdadm.conf defines no arrays. W: mdadm: no arrays defined in configuration file. |
#mdadm --help
mdadm is used for building, managing, and monitoring Linux md devices (aka RAID arrays) Usage: mdadm --create device options... Create a new array from unused devices. mdadm --assemble device options... Assemble a previously created array. mdadm --build device options... Create or assemble an array without metadata. mdadm --manage device options... make changes to an existing array. ... Shorthand for --manage. Any parameter that does not start with '-' is treated as a device name or, for --examine-bitmap, a file name. The first such name is often the name of an md device. Subsequent names are often names of component devices. For detailed help on the above major modes use --help after the mode e.g. mdadm --assemble --help For general help on options use mdadm --help-options |
#mdadm --create --help
Usage: mdadm --create device -chunk=X --level=Y --raid-devices=Z devices This usage will initialise a new md array, associate some devices with it, and activate the array. In order to create an array with some devices missing, use the special word 'missing' in place of the relevant device name. Before devices are added, they are checked to see if they already contain raid superblocks or filesystems. They are also checked to see if the variance in device size exceeds 1%. If any discrepancy is found, the user will be prompted for confirmation before the array is created. The presence of a '--run' can override this ... --spare-devices= -x: number of spares (eXtras) devices in initial array --size= -z : Size (in K) of each drive in RAID1/4/5/6/10 - optional --force -f : Honour devices as listed on command line. Don't : insert a missing drive for RAID5. --run -R : insist of running the array even if not all : devices are present or some look odd. --readonly -o : start the array readonly - not supported yet. --name= -N : Textual name for array - max 32 characters --bitmap-chunk= : bitmap chunksize in Kilobytes. --delay= -d : bitmap update delay in seconds. |
#mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb1 /dev/sdb6
mdadm: array /dev/md0 started. |
#mdadm --assemble --help
Usage: mdadm --assemble device options... mdadm --assemble --scan options... This usage assembles one or more raid arrays from pre-existing components. For each array, mdadm needs to know the md device, the identity of the array, and a number of sub devices. These can be found in a number of ways. The md device is either given on the command line or is found listed in the config file. The array identity is determined either from the --uuid or --super-minor commandline arguments, from the config file, ... choosing devices to use. --name= -N : Array name to look for in super-block. --config= -c : config file --scan -s : scan config file for missing information --run -R : Try to start the array even if not enough devices for a full array are present --force -f : Assemble the array even if some superblocks appear : out-of-date. This involves modifying the superblocks. --update= -U : Update superblock: try '-A --update=?' for option list. --no-degraded : Assemble but do not start degraded arrays. |
#mdadm --assemble /dev/md0
mdadm: /dev/md0 not identified in config file. |
#cat /proc/mdstat
Personalities : [raid1] md0 : active raid1 sdb6[1] sdb1[0] 9767424 blocks [2/2] [UU] [=====>...............] resync = 29.6% (2898240/9767424) finish=4.8min speed=23394K/sec unused devices: <none> |
#watch cat /proc/mdstat
|
#Personalities : [raid1]
exit |
$ssh 10.0.35.100
user@10.0.35.100's password: Linux linux0 2.6.18-6-xen-686 #1 SMP Sun Feb 10 22:43:13 UTC 2008 i686 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Last login: Fri May 29 18:35:39 2009 from linux5.unix.nt |
#дlvdisplay
--- Logical volume --- LV Name /dev/TEST_VG_VOL/vol1 VG Name TEST_VG_VOL LV UUID 2rQ2rD-nDBg-cmfk-oLBT-Qbkw-1uJe-c6FnEP LV Write Access read/write LV Status available # open 0 LV Size 5.00 GB Current LE 1280 Segments 2 ... LV Write Access read/write LV Status available # open 0 LV Size 1.00 GB Current LE 256 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:5 |
#lvremove /dev/TEST_VG_VOL/vol1
Do you really want to remove active logical volume "vol1"? [y/n]: y Logical volume "vol1" successfully removed |
#lvremove /dev/TEST_VG_VOL/vv[12345]
Do you really want to remove active logical volume "vv1"? [y/n]: y Logical volume "vv1" successfully removed Do you really want to remove active logical volume "vv2"? [y/n]: y Logical volume "vv2" successfully removed Do you really want to remove active logical volume "vv3"? [y/n]: y Logical volume "vv3" successfully removed Do you really want to remove active logical volume "vv4"? [y/n]: y Logical volume "vv4" successfully removed Do you really want to remove active logical volume "vv5"? [y/n]: y Logical volume "vv5" successfully removed |
#vgdisplay
--- Volume group --- VG Name TEST_VG_VOL System ID Format lvm2 Metadata Areas 2 Metadata Sequence No 21 VG Access read/write VG Status resizable MAX LV 0 Cur LV 0 Open LV 0 Max PV 0 Cur PV 2 Act PV 2 VG Size 18.64 GB PE Size 4.00 MB Total PE 4772 Alloc PE / Size 0 / 0 Free PE / Size 4772 / 18.64 GB VG UUID evk7UV-cG3i-snTY-BYXK-n8w6-tTaC-fj13i4 |
#vgremove TEST_VG_VOL
Volume group "TEST_VG_VOL" successfully removed |
#vgdisplay
|
#pvdisplay
"/dev/sdb2" is a new physical volume of "9.32 GB" --- NEW Physical volume --- PV Name /dev/sdb2 VG Name PV Size 9.32 GB Allocatable NO PE Size (KByte) 0 Total PE 0 Free PE 0 Allocated PE 0 ... --- NEW Physical volume --- PV Name /dev/sdb5 VG Name PV Size 9.32 GB Allocatable NO PE Size (KByte) 0 Total PE 0 Free PE 0 Allocated PE 0 PV UUID R3BWIl-ptAH-vJQP-4qdY-jDip-t6d4-qrlKum |
#pvremove /dev/sdb2
Labels on physical volume "/dev/sdb2" successfully wiped |
#pvremove /dev/sdb5
Labels on physical volume "/dev/sdb5" successfully wiped |
#pvdisplay
|
#fdisk -l /deb/sdb
|
#fdisk -l /dev/sdb
Disk /dev/sdb: 320.0 GB, 320072933376 bytes 255 heads, 63 sectors/track, 38913 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0xce5cf3c1 Device Boot Start End Blocks Id System /dev/sdb1 1 1217 9775521 83 Linux /dev/sdb2 1218 2434 9775552+ 83 Linux /dev/sdb3 2435 38913 293017567+ 5 Extended /dev/sdb5 2435 3651 9775521 83 Linux /dev/sdb6 3652 4867 9767488+ 83 Linux /dev/sdb7 4868 38913 273474463+ 83 Linux |
#file -s /dev/sdb1
/dev/sdb1: data |
#file -s /dev/sdb2
/dev/sdb2: data |
#file -s /dev/sdb3
/dev/sdb3: x86 boot sector; partition 1: ID=0x83, starthead 254, startsector 63, 19551042 sectors; partition 2: ID=0x5, starthead 254, startsector 19551105, 19535040 sectors, extended partition table, code offset 0x0 |
#fdisk -l /dev/sda
Disk /dev/sda: 320.0 GB, 320072933376 bytes 255 heads, 63 sectors/track, 38913 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x12c36e6e Device Boot Start End Blocks Id System /dev/sda1 * 1 38913 312568641 83 Linux |
#cfdisk /dev/sda
|
#ÑÑcat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] md0 : active (auto-read-only) raid1 sdb1[0] sdb6[1] 9767424 blocks [2/2] [UU] unused devices: <none> |
#screen -x
|
Personalities : [raid1] md0 : active raid1 sdb6[1] sdb1[0] 9767424 blocks [2/2] [UU] [=====>...............] resync = 29.6% (2898240/9767424) finish=4.8min speed=23394K/sec unused devices: <none>
Время первой команды журнала | 17:48:52 2009- 5-30 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 09:48:36 2009- 6- 1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 101 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 10.89 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 0.00 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 1.86 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 0.91 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду w. В поле WHAT, соответствующем текущему терминалу, должна быть указана программа script.
Команды, при наборе которых были допущены синтаксические ошибки, выводятся перечёркнутым текстом:
$ l s-l bash: l: command not found |
Если код завершения команды равен нулю, команда была выполнена без ошибок. Команды, код завершения которых отличен от нуля, выделяются цветом.
$ test 5 -lt 4 |
Команды, ход выполнения которых был прерван пользователем, выделяются цветом.
$ find / -name abc find: /home/devi-orig/.gnome2: Keine Berechtigung find: /home/devi-orig/.gnome2_private: Keine Berechtigung find: /home/devi-orig/.nautilus/metafiles: Keine Berechtigung find: /home/devi-orig/.metacity: Keine Berechtigung find: /home/devi-orig/.inkscape: Keine Berechtigung ^C |
Команды, выполненные с привилегиями суперпользователя, выделяются слева красной чертой.
# id uid=0(root) gid=0(root) Gruppen=0(root) |
Изменения, внесённые в текстовый файл с помощью редактора, запоминаются и показываются в журнале в формате ed. Строки, начинающиеся символом "<", удалены, а строки, начинающиеся символом ">" -- добавлены.
$ vi ~/.bashrc
|
Для того чтобы изменить файл в соответствии с показанными в диффшоте изменениями, можно воспользоваться командой patch. Нужно скопировать изменения, запустить программу patch, указав в качестве её аргумента файл, к которому применяются изменения, и всавить скопированный текст:
$ patch ~/.bashrc |
Для того чтобы получить краткую справочную информацию о команде, нужно подвести к ней мышь. Во всплывающей подсказке появится краткое описание команды.
Если справочная информация о команде есть, команда выделяется голубым фоном, например: vi. Если справочная информация отсутствует, команда выделяется розовым фоном, например: notepad.exe. Справочная информация может отсутствовать в том случае, если (1) команда введена неверно; (2) если распознавание команды LiLaLo выполнено неверно; (3) если информация о команде неизвестна LiLaLo. Последнее возможно для редких команд.
Большие, в особенности многострочные, всплывающие подсказки лучше всего показываются браузерами KDE Konqueror, Apple Safari и Microsoft Internet Explorer. В браузерах Mozilla и Firefox они отображаются не полностью, а вместо перевода строки выводится специальный символ.
Время ввода команды, показанное в журнале, соответствует времени начала ввода командной строки, которое равно тому моменту, когда на терминале появилось приглашение интерпретатора
Имя терминала, на котором была введена команда, показано в специальном блоке. Этот блок показывается только в том случае, если терминал текущей команды отличается от терминала предыдущей.
Вывод не интересующих вас в настоящий момент элементов журнала, таких как время, имя терминала и других, можно отключить. Для этого нужно воспользоваться формой управления журналом вверху страницы.
Небольшие комментарии к командам можно вставлять прямо из командной строки. Комментарий вводится прямо в командную строку, после символов #^ или #v. Символы ^ и v показывают направление выбора команды, к которой относится комментарий: ^ - к предыдущей, v - к следующей. Например, если в командной строке было введено:
$ whoami
user
$ #^ Интересно, кто я?в журнале это будет выглядеть так:
$ whoami
user
Интересно, кто я? |
Если комментарий содержит несколько строк, его можно вставить в журнал следующим образом:
$ whoami
user
$ cat > /dev/null #^ Интересно, кто я?
Программа whoami выводит имя пользователя, под которым мы зарегистрировались в системе. - Она не может ответить на вопрос о нашем назначении в этом мире.В журнале это будет выглядеть так:
$ whoami user
|
Комментарии, не относящиеся непосредственно ни к какой из команд, добавляются точно таким же способом, только вместо симолов #^ или #v нужно использовать символы #=
1 2 3 4Группы команд, выполненных на разных терминалах, разделяются специальной линией. Под этой линией в правом углу показано имя терминала, на котором выполнялись команды. Для того чтобы посмотреть команды только одного сенса, нужно щёкнуть по этому названию.
LiLaLo (L3) расшифровывается как Live Lab Log.
Программа разработана для повышения эффективности обучения Unix/Linux-системам.
(c) Игорь Чубин, 2004-2008