Ever scoured the Internet looking for how-to's on dealing with san volumes on Linux? Building new volume groups? Logical volumes? How about resizing an ext3 filesystem? More from our personal cookbook.
Let's start with building some filesystems on new san storage. This assumes you've got luns mapped to your Linux system, and multipath configured. Look for an upcoming blog post on multipathing, all steps here performed on Redhat ES4.8.
#pvcreate /dev/mapper/mpath0
Physical volume "/dev/mapper/mpath0" successfully created
[root@somesystem /]# vgcreate testvg1 /dev/mapper/mpath0
Volume group "testvg1" successfully created
[root@somesystem /]# vgcreate testvg1 /dev/mapper/mpath1
A volume group called 'testvg1' already exists.
[root@somesystem /]# vgcreate testvg2 /dev/mapper/mpath1
Volume group "testvg2" successfully created
[root@somesystem /]#
lvm> lvcreate -L 10M testvg1
Rounding up size to full physical extent 12.00 MB
Logical volume "lvol0" created
lvm> lvcreate -L 10M testvg2
Rounding up size to full physical extent 12.00 MB
Logical volume "lvol0" created
lvm>
lvm> lvscan
ACTIVE '/dev/testvg2/lvol0' [12.00 MB] inherit
ACTIVE '/dev/testvg1/lvol0' [12.00 MB] inherit
lvm>
[root@somesystem /]# mkfs.ext3 /dev/testvg1/lvol0
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
3072 inodes, 12288 blocks
614 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=12582912
2 block groups
8192 blocks per group, 8192 fragments per group
1536 inodes per group
Superblock backups stored on blocks:
8193
Writing inode tables: done
Creating journal (1024 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 34 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@somesystem /]#
[root@somesystem /]#
[root@somesystem /]# mount /dev/testvg1/lvol0 /vg1
mount: mount point /vg1 does not exist
[root@somesystem /]# mkdir vg1
[root@somesystem /]# mount /dev/testvg1/lvol0 /vg1
[root@somesystem /]# mkfs.ext3 /dev/testvg2/lvol0
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
3072 inodes, 12288 blocks
614 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=12582912
2 block groups
8192 blocks per group, 8192 fragments per group
1536 inodes per group
Superblock backups stored on blocks:
8193
Writing inode tables: done
Creating journal (1024 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 30 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@somesystem /]# mkdir vg2
[root@somesystem /]# mount /dev/testvg2/lvol0 /vg2
[root@somesystem /]#