LVM configuration under SUSE server

  
 

SUSE Linux+ storage array is currently the mainstream application. According to your own engineering experience, the following summarizes how to use LVM management software for array configuration under the suse server.

There are two modes for configuring the array on the SUSE server:

1, directly use the fdisk + external storage device name to partition it. The partitions divided by fdisk are up to 2T, which is suitable for use when the array capacity is not too large;

2, using LVM management software:

LVM is short for logical volume management (logic volume) Manager), which is a mechanism for managing disk partitions under liunx. LVM is a logical layer built between hard disks and partitions to increase the flexibility of disk partition management. Administrators can easily manage disk partitions through LVM, which is currently the most widely used tool under Linux.

LVM can use PV, LV, VG and other commands to perform large-capacity array partitioning, which is convenient to manage, and the expansion array is convenient, which increases the scalability of the system, so it is preferred.

The following is the full step of configuring the array under LVM in the actual deployment project:

1, execute the fdisk –l command to check whether the server correctly recognizes the storage device, and the general storage capacity will be much larger than The capacity of the local hard drive.

cspfstest:~ # fdisk -l

Disk /dev/sda: 146.6 GB, 146693685248 bytes255 heads, 63 sectors/track, 17834 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System/dev/sda1 1 1045 8393931 82 Linux swap /Solaris/dev/sda2 * 1046 11489 83891430 83 Linux/dev/sda3 11490 17834 50966212+ f W95 Ext'd (LBA)/Dev/sda5 11490 16711 41945683+ 83 Linux

Disk /dev/sdb: 1799.5 GB, 1799589199872 bytes255 heads, 63 sectors/track, 218787 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

where /dev/sdb is the external storage array

2, create a physical hard disk partition

a, create a partition

cspfstest:~ #fdisk /dev/sdb

The number of cylinders for this disk is set to 218787.There is nothing wrong with that, but this is larger than 1024, and could be in certain setups cause problems With:1) software that runs at boot time (eg, old versions of LILO)2) booting and partitioning software from Other OSs(eg, DOS FDISK, OS/2 FDISK)

Command (m for help): mCommand actiona toggle a bootable flagb edit bsd disklabelc toggle the dos compatibility flagd delete a partitionl list known partition typesm print this menun Add a new partitiono create a new empty DOS partition tablep print the partition tableq quit without saving changess create a new empty Sun disklabelt change a partition's system idu change display/entry unitsv verify the partition tablew write table to disk and exitx extra functionality (experts only )

b, enter n to create a new partition

c, enter P to create a primary partition Command (m for help): n Command actione extendedp primary partition (1-4)

Partition number (1-4): 1First cylinder (1-218787, default 1): Using default value 1Last cylinder or +size or +sizeM or +sizeK (1-218787, default 218787): +1000000M

--Create a 1T partition

d, enter t to modify the partition type under the prompt line, modify to LVM partition, after the creation is completed Save in w

Command (m for help): p

Disk /dev/sdb: 1799.5 GB, 1799589199872 bytes255 heads, 63 sectors/track, 218787 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System/dev/sdb1 1 121577 976567221 8e Linux LVMCommand (m for help): wThe partition table has been altered!

Calling ioctl() to re -read partition table.Syncing disks.

3, create PV, VG, and LV

a, create PV:

cspfstest:~ # pvcreate /dev/sdb1

PV successfully created flag: Physical volume "/dev/sdb1" successfully created

Created can be viewed using pvdisplay

b, create VG:

Cspfstest:~ # vgcreate vgfs /dev/sdb1 /dev/sdb2 -s 128M

VG successfully created flag: Volume group "vgfs" successfully created

Created can be viewed using vgdisplay< Br>

c, create LV:

cspfstest:~ # lvcreate -l 65000 -n lvfs1 vgfs

LV successfully created flag: lvcreate -l 65000 -n lvfs2 vgfs Insufficient free extents (1340 7) in volume group vgfs: 65000 required

4, create ext3 file system

File system creation on LV:

cspfstest:/dev/mapper # mkfs .ext3 /dev/mapper/vgfs-lvfs2

File system creation: mke2fs 1.38 (30-Jun-2005)Filesystem label=OS type: LinuxBlock size=4096 (log=2)Fragment size=4096 ( Log=2)106496000 inodes, 212992000 blocks10649600 blocks (5.00%) reserved for the super userFirst data block=0Maximum filesystem blocks=42949672966500 block groups32768 blocks per group, 32768 fragments per group16384 inodes per groupSuperblock backups stored on blocks: 32768, 98304, 163840 , 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 102400000

Writing inode tables: done Creating journal (32768 blocks): doneWriting superblocks and filesystem Accounting information: done

Copyright © Windows knowledge All Rights Reserved