A comprehensive guide to creating filesystems on HP-UX systems using Logical Volume Manager (LVM).
Check List of Disks Available
1
2
3
4
5
6
7
8
9
10
11
| # ioscan -funC disk
Class I H/W Path Driver S/W State H/W Type Description
=======================================================================
disk 3 0/0/0/2/0.6.0 sdisk CLAIMED DEVICE HP 36.4GMAS3367NC
/dev/dsk/c0t6d0 /dev/dsk/c0t6d0s2 /dev/rdsk/c0t6d0 /dev/rdsk/c0t6d0s2
/dev/dsk/c0t6d0s1 /dev/dsk/c0t6d0s3 /dev/rdsk/c0t6d0s1 /dev/rdsk/c0t6d0s3
disk 0 0/0/0/2/1.2.0 sdisk CLAIMED DEVICE HP DVD-ROM 305
/dev/dsk/c1t2d0 /dev/rdsk/c1t2d0
disk 4 0/0/0/3/0.6.0 sdisk CLAIMED DEVICE HP 36.4GMAP3367NC
/dev/dsk/c2t6d0 /dev/dsk/c2t6d0s2 /dev/rdsk/c2t6d0 /dev/rdsk/c2t6d0s2
/dev/dsk/c2t6d0s1 /dev/dsk/c2t6d0s3 /dev/rdsk/c2t6d0s1 /dev/rdsk/c2t6d0s3
|
Check Disks Already in Use
1
2
3
| # strings /etc/lvmtab
/dev/vg00
/dev/dsk/c0t6d0s2
|
Create Filesystem Using Free Disk
Step 1: Create Physical Volume
1
2
| # pvcreate -f /dev/rdsk/c2t6d0
Physical volume "/dev/rdsk/c2t6d0" has been successfully created.
|
Step 2: Create Volume Group Directory and Device Node
1
2
| # mkdir /dev/vg01
# mknod /dev/vg01/group c 64 0x010000
|
Step 3: Create Volume Group
1
2
3
4
| # vgcreate /dev/vg01 /dev/dsk/c2t6d0
Increased the number of physical extents per physical volume to 8683.
Volume group "/dev/vg01" has been successfully created.
Volume Group configuration for /dev/vg01 has been saved in /etc/lvmconf/vg01.conf
|
Step 4: Create Logical Volume
1
2
3
4
| # lvcreate -L 20000 -n depot /dev/vg01
Logical volume "/dev/vg01/depot" has been successfully created with character device "/dev/vg01/rdepot".
Logical volume "/dev/vg01/depot" has been successfully extended.
Volume Group configuration for /dev/vg01 has been saved in /etc/lvmconf/vg01.conf
|
Step 5: Create Filesystem
1
2
3
4
| # mkfs -F vxfs /dev/vg01/rdepot
version 6 layout
20480000 sectors, 20480000 blocks of size 1024, log size 16384 blocks
largefiles supported
|
Step 6: Create Mount Point and Mount Filesystem
1
2
| # mkdir /depot
# mount /dev/vg01/depot /depot
|
Edit /etc/fstab to add the new filesystem:
1
2
3
4
5
6
7
8
9
10
| # System /etc/fstab file. Static information about the file systems
# See fstab(4) and sam(1M) for further details on configuring devices.
/dev/vg00/lvol3 / vxfs delaylog 0 1
/dev/vg00/lvol1 /stand vxfs tranflush 0 1
/dev/vg00/lvol4 /tmp vxfs delaylog 0 2
/dev/vg00/lvol5 /home vxfs delaylog 0 2
/dev/vg00/lvol6 /opt vxfs delaylog 0 2
/dev/vg00/lvol7 /usr vxfs delaylog 0 2
/dev/vg00/lvol8 /var vxfs delaylog 0 2
/dev/vg01/depot /depot vxfs delaylog 0 2
|
The filesystem will now mount automatically on system reboot.