Mabuhay

Hello world! This is it. I've always wanted to blog. I don't want no fame but just to let myself heard. No! Just to express myself. So, I don't really care if someone believes in what I'm going to write here nor if ever someone gets interested reading it. My blogs may be a novel-like, a one-liner, it doesn't matter. Still, I'm willing to listen to your views, as long as it justifies mine... Well, enjoy your stay, and I hope you'll learn something new because I just did and sharing it with you.. Welcome!

Thursday, April 24, 2008

Basic LVM: VG, LV, and file system creation

It's been a while, and I think there is a need to add a new one here.

Knowledge sharing sessions were done last week with the other account and they discussed Logical Volume Management (LVM), HP-UX's style. As for my team, we have the privilege to eat, drink, and live with this everyday. I'm making a guide here on how it is done. Just check it out. And as a requirement, you must have a good understanding of LVM.

Basics: Have a unused and available disk ready on your system.

1. Ensure that the disk is not being used by other volume groups (VG). Any of these three will report IF the disk is in use by other VGs.

# vgdisplay -v | grep -i cXtYdZ
where: cXtYdZ is the disk represented by controller, target and LUN; or use `ioscan` to get the desired details
# strings /etc/lvmtab grep -i
cXtYdZ
# pvdisplay /dev/dsk/cXtYdZ


2. If step 1 is ok, initialize the disk by creating LVM structures on the disk.

# pvcreate [-f] /dev/rdsk/cXtYdZ

3. We have to create a device file for the volume group.

# mkdir -p /dev/VG_name
# mknod /dev/VG_name/group c 64 <minor_number>

note: you can choose any minor number you want; good practice is to use the next available

4. Now, let's proceed with the VG creation [taking the default values].

# vgcreate /dev/VG_name /dev/dsk/cXtYdZ
note: alternate link can be specified here as well
# vgdisplay [-v] VG_name

5. Create the the logical volume (LV). And verify.

# lvcreate -L <LV_size_in_MB> -n LV_name VG_name
# lvdisplay /dev/VG_name/LV_name


6. Format the LV to be used as file system.

# newfs -F vxfs[specify_as_needed] /dev/VG_name/raw_LV_name

7. Create the mount point [commonly called directory] for the file system.

# mkdir /mount_point

8. Add the entry on the /etc/fstab which will ensure the it'll get mounted on succeeding reboot.

# vi /etc/fstab
...
/dev/VG_name/LV_name /mount_point [options_here]
...
:wq!


9. Mount the file system. Change the ownership and permissions as needed.

# mount /mount_point
# chown ...
# chmod ...


Basically, this is it. For more advance topics, we will have another time.

No comments:

Post a Comment

World Clock