New disk and LVM Logical Volume operations in Linux
Source: Internet
Author: User
Linux New disk and LVM Logical Volume operations 1. environment www.2cto.com virtual machine environment: OracleVisualBox4.1 operating system OracleEnterpriseLinux5.5 disk and file system environment: 2 16G-sda and sdb, sda has 2 physical partitions, sdb has 1...
New disk and LVM Logical Volume operations in Linux 1. environment www.2cto.com virtual machine environment: Oracle VisualBox 4.1 operating system Oracle Enterprise Linux 5.5
Disk and file system environment: two 16 GB-sda and sdb, two physical partitions in sda and one physical partition in sdb sda1: 100 M Mount/boot, sda2 + sdb1 form a volume group VolGroup00, which is divided into two logical volumes, one 4 GSWAP and the other as the Mount root directory. 2. add a virtual disk to the target to install Oracle. The size is 16 GB. The new disk needs to be added to the volume group VolGroup00 and mounted to/oracle as a LV. 3. operation 3.1 Create a disk in VisualBox. the disk size is 16 GB and is dynamically allocated. Start the VM and the sdc device file appears in the/dev directory. # Ls-l/dev | grep sdc 3.2 create a physical partition www.2cto.com use fdisk to create a physical partition, and fdisk is located in the/sbin directory. The command execution process is as follows: # fdisk/dev/sdccommand (m for help): n command is used to create a new partition e extendedp primary partition (1-4 ): p creates a primary partition number (1-4): 1 partition number is 1 First Cylinder (1-2088, default 1): 1 partition start Cylinder number is 1 Last Cylinder: 2088 partition end number 2088, or enter Mcommand (m for help): w changes the data written to the partition table and exits. the ls-l/dev | grep sdc command displays a new sdc1 device, the first primary partition of the sdc disk. 3.3 Create logical volume management use the command lvm, located in/sbin. run the following command on www.2cto.com: # lvmlvm> pvcreate/dev/sdc1 initialization partition sdc1 is physical volume lvm> vgextend VolGroup00/dev/sdc1 add physical volume sdc1 to volume group lvm> vgs can display the free space of the current volume Group 15.97 Glvm> pvdisplay/dev/sdc1 displays the physical volume information, record number of available PES lvm> lvcreate VolGroup00-l 511-n LogVolOracle/dev/sdc1 create logical volume, which is located in volume group VolGroup00, with a size of 511 PES, 32 MB for each PE, the PE size is determined when the volume group is created. The LV name is LogVolOracle and is located on the physical volume/dev/sdc1. Lvm> after the quit logical volume is created, exit lvm # ls-l/dev/VolGroup00 and a LogVolOracle linked file 3.4 is displayed. format the file system creation and run the mkfs command, run the following command to mount the created logical volume in ext3 file system format: # mkfs-t ext3/dev/VolGroup00/LogVolOracle 3.5 mount the Mount logical volume www.2cto.com to modify the/etc/fstab file, add a line:/dev/VolGroup00/LogVolOracle ext3 defaults 1 2 modify and save the line, and then execute the following command to mount: # mkdir/oracle # mount/oracle now, the new disk has been attached to/oracle. The advantage of LVM is that the size of the logical volume is no longer limited by a single physical disk partition, and can be set across partitions and disks.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.