Solved

HP-UX add new LUN Disk

Posted on 2013-06-11
3
1,416 Views
Last Modified: 2013-06-14
Hi,

I am new to HP-UX and I am having an issue adding a new SAN Storage drive, I have the drive visable to HP-UX but need to enable it so I can remotly store ignite backups on it, below is what I have so far.


First create the physical volume on the disk
# pvcreate -f /dev/rdsk/c47t0d1


In /dev create a vg directory
# mkdir -p /dev/vg_backup2
# chown root:root /dev/vg_backup2
# chmod 755 /dev/vg_backup2


in HP-UX each volume group must have a group device special file under its subdirectory in /dev
# /dev/vg_backup2
# ll /dev/*/group
# mknod group c 64 0x040000

Change the ownership to root:sys and the permissions to 640.
# /dev/vg_backup2
# chown root:sys group
# /dev/vg_backup2
# chmod 640 group


Create the new VG
# vgcreate -s 16 vg_backup2 /dev/dsk/c47t0d1
# vgdisplay -v vg_backup2

Create LV
# lvcreate -n lvol_test -L 256 vg_backup2
# lvdisplay /dev/vg_backup2/lvol_test
0
Comment
Question by:joolzhaines
  • 2
3 Comments
 
LVL 20

Expert Comment

by:tfewster
ID: 39240225
What's the issues? Your procedure looks OK so far, but be aware that the vg device special file must be unique:
in HP-UX each volume group must have a UNIQUE group device special file under its # subdirectory in /dev
# cd /dev/vg_backup2  # Added the missing "cd"
# ll /dev/*/group   # to see what other vg device special files already exist
# mknod group c 64 0x040000  # 128 if this is LVM 2.0

The next steps are to create a filesystem on the test lv:
newfs -F vxfs -o largefiles /dev/vg_backup2/lvol_test

and mount it, e.g :
mkdir /backup2
(Though you probably want it mounted somewhere under /var/opt/ignite)

chmod 700 /backup2  # disable writes to the mount POINT
mount /dev/vg_backup2/lvol_test /backup2
# Assign appropriate ownership/permissions to the MOUNTED filesystem
#  (does not change the permission on the mount POINT, which is now masked by the filesystem mounted on it)
chown backup_user_name /backup2
chmod 755 /backup2
0
 

Author Comment

by:joolzhaines
ID: 39240337
Thanks for the great reply just what I needed, as I said I am new to HP-UX and just learning, below is the complete procedure taking into account your comments.


First create the physical volume on the disk
# pvcreate -f /dev/rdsk/c47t0d1

In /dev create a vg directory
# mkdir -p /dev/vg_backup
# chown root:root /dev/vg_backup
# chmod 755 /dev/vg_backup

in HP-UX each volume group must have a group device special file under its subdirectory in /dev
# cd /dev/vg_backup
# ll /dev/*/group
# mknod group c 64 0x040000 (128 if LVM 2.0)

The next steps are to create a filesystem on the test lv:
# newfs -F vxfs -o largefiles /dev/vg_backup/lvol_test


Mount it
# mkdir //var/opt/ignite
Disable writes to the mount POINT
# chmod 700 /backup
# mount /dev/vg_backup/lvol_test /backup

Assign appropriate ownership/permissions to the MOUNTED Filesystem (does not change the permission on the mount POINT, which is now masked by the filesystem mounted on it)
# chown root:sys/backup
# chmod 755 /backup

Create the new VG
# vgcreate -s 16 vg_backup /dev/dsk/c47t0d1
# vgdisplay -v vg_backup

Create LV
# lvcreate -n lvol_test -L 256 vg_backup
# lvdisplay /dev/vg_backup/lvol_test
0
 
LVL 20

Accepted Solution

by:
tfewster earned 500 total points
ID: 39241739
Hi joolzhaines,

The order is a bit confused - by "next steps", I meant "last steps", after the rest of your original steps, so the order is:

First create the physical volume on the disk

In /dev create a vg directory
Create a UNIQUE group device special file under its subdirectory in /dev
Create the new VG

Create LV

Create a filesystem on the test lv # Correction, newfs must be run on the raw device, rlvol_test

Create mount point
Disable writes to the mount POINT

Mount the new filesystem
Assign appropriate ownership/permissions to the filesystem

-----------
Looking more into how you're going to use this new disk/filesystem for ignite backups:
Normally the best place to mount it would be on /var/opt/ignite/recovery/archives, so you don't need to change any of your existing Ignite backups to use a new directory. But you need to check it's not already a separate filesystem (`bdf |grep var` - post the output, and I can verify and make appropriate recommendations)

The /var/opt/ignite/recovery/archives directory/ filesystem will already exist, so we need to preserve its contents and move it to the new filesystem:
cd /var/opt/ignite/recovery
mv archives archives.old
mkdir archives
mount  /dev/vg_backup/lvol_test /var/opt/ignite/recovery/archives
# Note that I've used the names from your procedure - But you could rethink those names based on how the new LUN will actually be used, e.g. create a VG "vg_ignite" and an LV "lv_ignite"

ls -ld archives*  # and then use chown/chmod to make the ownership and permissions of the new filesystem the same as the old archives directory

It's only slightly more complicated if /var/opt/ignite/recovery/archives was already a filesystem; instead of using `mv`, we unmount it and remount it on archives.old (and sort out fstab later)

Now we move the content of the old directory into the new volume
cd archives.old
mv * ../archives  # may take a long time!
-----------
I missed a step of adding the new lv/mountpoint info to /etc/fstab, so it gets mounted automatically on reboot.
-----------
I would also avoid using the "-f" option to `pvcreate` as standard; "-f" = force, i.e. trash any existing LVM structures on the LUN. If this is a new LUN, "-f" won't be needed. If running pvcreate without the "-f" fails because it reports the LUN it already has LVM structures on it, you need to investigate why (with `pvdisplay`). That said, "-f" is not TOO dangerous as `pvcreate -f` won't trash a disk that is is already part of a VG.

-----------
So my plan becomes
First create the physical volume on the disk
# pvcreate /dev/rdsk/c47t0d1

In /dev create a vg directory
# mkdir -p /dev/vg_ignite
# chown root:root /dev/vg_ignite
# chmod 755 /dev/vg_ignite

in HP-UX each volume group must have a UNIQUE group device special file under its subdirectory in /dev
# cd /dev/vg_ignite
# ll /dev/*/group
# mknod group c 64 0x040000 (128 if LVM 2.0; 0x040000 is an example, but must be unique)

Create the new VG
# vgcreate -s 16 vg_ignite /dev/dsk/c47t0d1
# vgdisplay -v vg_ignite

Create LV
# lvcreate -n lv_ignite -L 256 vg_ignite  # Replace "256" with the appropriate size in MB; in this case, we may as well use all the space in vg_ignite. You can specify size in MB with "-L" or in Physical Extents (which you got from the output of `vgdisplay`) with "-l"
# lvdisplay /dev/vg_ignite/lv_ignite 

The next steps are to create a filesystem on the new lv:
# newfs -F vxfs -o largefiles /dev/vg_ignite/rlv_ignite

Mount it on the ignite archives directory structure (Assuming "archives" is a directory, not a filesystem)

cd /var/opt/ignite/recovery
mv archives archives.old
mkdir archives
mount  /dev/vg_ignite/lv_ignite /var/opt/ignite/recovery/archives

Duplicate the ownership/permissions of archive.old to the MOUNTED Filesystem (does not change the permission on the mount POINT, which is now masked by the filesystem mounted on it)

Now we move the content of the old directory into the new volume
cd archives.old
mv * ../archives  # may take a long time!

Add a line to /etc/fstab like:
/dev/vg_ignite/lv_ignite /var/opt/ignite/recovery/archives vxfs nosuid,largefiles 0 2

Open in new window



-----------
Arunabha Banerjee posted a good summary of the overall procedure at http://h30499.www3.hp.com/t5/Ignite-UX/ignite-net-backup-on-filesystem/td-p/4833109
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

The 6120xp switches seem to have a bug when you create a fiber port channel when you have a UCS fabric interconnects talking to them.  If you follow the Cisco guide for the UCS, the FC Port channel will never come up and it will say that there are n…
Usually shares are where we want them for our users and we tend to take them for granted. There are times, however, when those shares may disappear causing difficulty for your users. One of the first things to try is searching for files that shou…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now