Device Boot Start End Blocks Id System /dev/sda1 * 1 64 512000 83 Linux Partition 1 does not end on cylinder boundary. /dev/sda2 64 2611 20458496 8e Linux LVM /dev/sda3 2611 130541 1027599062+ 83 Linux
Disk /dev/sda: 130541 cylinders, 255 heads, 63 sectors/track Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End #cyls #blocks Id System /dev/sda1 * 0+ 63- 64- 512000 83 Linux /dev/sda2 63+ 2610- 2547- 20458496 8e Linux LVM /dev/sda3 2610+ 130540 127931- 1027599062+ 83 Linux /dev/sda4 0 - 0 0 0 Empty
Disk /dev/mapper/vg_nwtest68-lv_root: 6201 cylinders, 255 heads, 63 sectors/track Disk /dev/mapper/vg_nwtest68-lv_swap: 261 cylinders, 255 heads, 63 sectors/track Disk /dev/mapper/vg_nwtest68-lv_data: 13054 cylinders, 255 heads, 63 sectors/track
cfdisk
1 2 3 4 5 6 7 8 9 10 11 12 13 14
cfdisk (util-linux-ng 2.17.2)
Disk Drive: /dev/sda Size: 1073741824000 bytes, 1073.7 GB Heads: 255 Sectors per Track: 63 Cylinders: 130541
Name Flags Part Type FS Type [Label] Size (MB) ----------------------------------------------------------------------------------------------------------------------------------------------------------- Pri/Log Free Space 1.05 * sda1 Boot Primary Linux ext3 524.29 * sda2 Primary Linux LVM 20949.50 * sda3 Primary Linux 1052261.44 * Pri/Log Free Space 5.55 *
LVM
1 2 3 4 5 6 7 8 9 10 11 12 13 14
-- create partitions on disk drives (type 8e in fdsik) -- create physical volumes from the partitions --> $ sudo pvcreate /dev/sda1 -- create the volumes group --> $ sudo vgcreate -s 16m vg /dev/sda1 -- allocate logical volumes from the volume group --> $ sudo lvcreate -l 50g -n mylvm vg -- format the logical volumes --> $ sudo mkfs -t ext4 /dev/vg/mylvm -- mount the logical volumes (also update /etc/fstab as needed) --> $ mkdir /mylvm,
then --> $ sudo mount /dev/vg/mylvm /mylvm, then add --> /dev/vg/mylvm /mylvm ext4 defaults 00 to the /etc/fstab
# vgdisplay --- Volume group --- VG Name VolGroup ...... Act PV 2 VG Size 39.50 GiB PE Size 4.00 MiB Total PE 10112 Alloc PE / Size 10112 / 39.50 GiB Free PE / Size 0 / 0
# vgextend VolGroup /dev/sda4 Volume group "VolGroup" successfully extended
# vgdisplay --- Volume group --- VG Name VolGroup ...... Act PV 3 VG Size 49.50 GiB PE Size 4.00 MiB Total PE 12672 Alloc PE / Size 10112 / 39.50 GiB Free PE / Size 2560 / 10.00 GiB
# lvextend -L +10GB /dev/mapper/VolGroup-lv_oradata1 Size of logical volume VolGroup/lv_oradata1 changed from 2.50 GiB (640 extents) to 12.50 GiB (3200 extents). Logical volume lv_oradata1 successfully resized.
# vgdisplay --- Volume group --- VG Name VolGroup ...... Act PV 3 VG Size 49.50 GiB PE Size 4.00 MiB Total PE 12672 Alloc PE / Size 12672 / 49.50 GiB Free PE / Size 0 / 0
# resize2fs /dev/mapper/VolGroup-lv_oradata1 resize2fs 1.41.12 (17-May-2010) Filesystem at /dev/mapper/VolGroup-lv_oradata1 is mounted on /oradata1; on-line resizing required old desc_blocks = 1, new_desc_blocks = 1 Performing an on-line resize of /dev/mapper/vg_nwtest68-lv_oradata1 to 3276800 (4k) blocks. The filesystem on /dev/mapper/vg_nwtest68-lv_oradata1 is now 3276800 blocks long.
# vgreduce --removemissing datavg WARNING: Device for PV fPFkBx-lbnG-R6Zo-3kq5-KOLA-U1ou-LdNIMD not found or rejected by a filter. Couldn\'t find device with uuid fPFkBx-lbnG-R6Zo-3kq5-KOLA-U1ou-LdNIMD. Wrote out consistent volume group datavg.
Tips
SCSI
小型计算机系统接口(SCSI,Small Computer System Interface)是一种用于计算机及其周边设备之间(硬盘、软驱、光驱、打印机、扫描仪等)系统级接口的独立处理器标准。最大部分的应用是在存储设备上(例如硬盘、磁带机)。
iSCSI(Internet Small Computer System Interface,发音为/ˈаɪskʌzi/),Internet小型计算机系统接口,又称为IP-SAN,是一种基于因特网及SCSI-3协议下的存储技术,由IETF提出,并于2003年2月11日成为正式的标准。