Sep
15
2008

A basic LVM Setup

# fdisk -l

Disk /dev/hda: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 522 4088542+ 8e Linux LVM

Disk /dev/hdb: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 1 522 4192933+ 83 Linux

# pvcreate /dev/hdb1
Physical volume “/dev/hdb1” successfully created
# vgcreate vg1 /dev/hdb1
Volume group “vg1” successfully created

# lvcreate –size 1G vg1
Logical volume “lvol0” created
# ls -l /dev/vg1/lvol0
lrwxrwxrwx 1 root root 21 Jul 29 20:27 /dev/vg1/lvol0 -> /dev/mapper/vg1-lvol0
# mkfs.ext3 /dev/vg1/lvol0
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
131072 inodes, 262144 blocks
13107 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=268435456
8 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376

Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 22 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.

# mount /dev/vg1/lvol0 /mnt
# df -k
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
2967320 860884 1955704 31% /
/dev/hda1 101086 10199 85668 11% /boot
none 254472 0 254472 0% /dev/shm
/dev/mapper/vg1-lvol0
1032088 34092 945568 4% /mnt

Share
Written by in: linux,storage,sysadm | Tweet This

No Comments »

RSS feed for comments on this post. TrackBack URL


Leave a Reply

Powered by WordPress | Theme: Aeros 2.0 by TheBuckmaker.com