How To Create Linux LVM
Create Linux LVM
Create Linux LVM
- Login with root user ID and try to avoid using sudo command for simplicity reason.
fdisk /dev/hdb
At the Linux fdisk command prompt,
- press
n
to create a new disk partition,
- press
p
to create a primary disk partition,
- press
1
to denote it as 1st disk partition,
- press ENTER twice to accept the default of 1st and last cylinder – to convert the whole secondary hard disk to a single disk partition,
- press
t
(will automatically select the only partition – partition 1) to change the default Linux partition type (0×83) to LVM partition type (0x8e),
- press
L
to list all the currently supported partition type,
- press
8e
(as per the L listing) to change partition 1 to 8e, i.e. Linux LVM partition type,
- press
p
to display the secondary hard disk partition setup. Please take note that the first partition is denoted as /dev/hdb1 in Linux,
- press
w
to write the partition table and exit fdisk upon completion.
pvcreate /dev/hdb1
vgcreate -s 1024M vg0 /dev/hdb1
lvcreate -L 1024M -n lvol0 vg0 or lvcreate -l 100%FREE -n MWLV MWVG
mkfs -t ext3 -v /dev/vg0/lvol0
mkdir /apps
mount -t ext3 /dev/vg0/lvol0 /mnt/vfs
change /etc/fstab to mount the file system automatically
- df -h
No comments:
Post a Comment