1848286 Members
7383 Online
104024 Solutions
New Discussion

Re: add new disk

 
Franklin
Occasional Contributor

add new disk

add new disk, how do prepeared to begin work.
step by step (vg, lv, etc)
7 REPLIES 7
MarkSyder
Honored Contributor

Re: add new disk

Internal or external or is that not decided yet?

If external, be prepared in advance for a bit of advice HP gave me: do not put an external disc drive on the same string as tape drive, CD-ROM drive, etc. as it slows the disc down and is not supported.

Also be aware of cable lengths: if you have a small number of external devices (up to 3 I believe) you can have a total of 10 feet of cable connecting them. As soon as you add a fourth device the maximum cable length goes down to 5 feet.

Once you have answered this part you will be in a position to plan VGs, LVs, etc.

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
Helen French
Honored Contributor

Re: add new disk

The easiest way is to do through SAM, if you are not familiar with commands:
# sam -> disk devices -> Volume groups -> Actions and Add

From command line, you need to:

# pvcreate ..options .. PV_NAME
# mkdir /dev/vgXX
# mknod /dev/vgXX/group c 64 0x0?0000
# vgcreate /dev/vgXX PV_NAME
# vgchange -a y /dev/vgXX
# vgdisplay -v /dev/vgXX
# lvcreate -L size_in_MB /dev/vgXX (or lvextend followed by newfs or extendfs)

Read man pages for more information
Life is a promise, fulfill it!
Bryan D. Quinn
Respected Contributor

Re: add new disk

Hello Franklin,

Well, the basics are:

pvcreate /dev/rdsk/cXtYdZ
(where cXtYdZ is the device file for the disk being used ex: c1t2d0)
Note: you might have to do a pvcreate -f /dev/rdsk/cXtYdZ if the disk has been used before.

vgcreate /dev/vgXX /dev/dsk/cXtYdZ
(where XX is the vg name ex: vg01)

lvcreate -L ### /dev/vgXX
(where ### is the size in MBs.)

newfs -F vxfs -o largefiles /dev/vgXX/rlvolX
(where rlvolX is the name of the logical volume created in previous step, also note the vxfs type file system and large files being enabled to allow files over 2GB)

mkdir /mount_point

mount /dev/vgXX/lvolX /mount_point

Hope this helps!
-Bryan
Bryan D. Quinn
Respected Contributor

Re: add new disk

Hello Franklin,

Totally forgot these steps before the vgcreate command:

mkdir /dev/vgXX

mknod /dev/vgXX/group c 64 0xYY0000

Note: YY is the minor number for the volume group. For example vg01 will usually have a minor number of 01.

-Bryan
Mark Grant
Honored Contributor

Re: add new disk

add disk to system somewhere. Make sure it is CLAIMED by doing an ioscan -fnC disk. Note down the device file. e.g. /dev/dsk/c0t0d0

pvcreate /dev/rdsk/c0t0d0

decide which volume group you want it in or if you want to create a new one.

If adding to an existing volume group "vgextend vggroup /dev/dsk/c0t0d0" and go to step 5. Otherwise

1) "ls /dev/vg*/group". Look at the minor numbers (they look something like 0x010000) and chose one for your new volume group that doesn't exist e.g 0x04000

2) mkdir /dev/vgmygroup

3) mknod /dev/vgmygroup/group c 64 0x04000

4) vgcreate vgmygroup /dev/dsk/c0t0d0. If the disk is very large, you might need to add a -s 8 or even a -s 16 in that vgcreate command

5) lvcreate -LXXX vgmygroup (XXX is the number of megabytes you want)

6) newfs -F vxfs /dev/vgmygroup/rlvol1 (or whatever rlvol just got created)

7) "mkdir /mynewdisk" to create a mount point

8) mount /dev/vgmygroup/lvol1 /mynewdisk

9) edit /etc/fstab accordingly

10) put on a little party hat and dance around.

Never preceed any demonstration with anything more predictive than "watch this"
John Jayaseelan
Super Advisor

Re: add new disk

Hi,

If the disk is for a Disk array, Make sure you set the disk with unique id.

Ashwani Kashyap
Honored Contributor

Re: add new disk

Easiest way is through sam .
From the command line you can do this , if the disk is already added and you know the disk device name . Say for eg its is /dev/dsk/c1t0d0 then you do :

1. #pvcreate /dev/rdsk/c1t0d0
2. #If you want to include this disk in an exisitng volume group then do
#vgextend /dev/vg_name /dev/dsk/c1t0d0
Or if you want a new VG then do
#mkdir /dev/vg_name
#mknod /dev/vg_name/group c 64 0xAB0000
where AB are any unused volume group minor numbers in HEX .
#vgcreate /dev/vg_name /dev/dsk/c1t0d0 .

2. If you want to create a new logical volume on this disk the ndo
#lvcreate -n lv_name /dev/vg_name
#lvextend -L lv_size_MB /dev/vg_name/lv_name /dev/dsk/c1t0d0
if you want to extend an existing logical volume on to this disk then include this disk in that VG as explained earlier and use lvextend .
3.If you want to create a new filesystem on the new LV then do this :
#newfs -F bxfs /dev/vg_name/rlv_name .
If you extended an existing LV then don't use newfs . Istead use this :
#fsadm -F vxfs -b lv_sizeMB /mount_point .
4. If you want to mount the new LV then :
#mkdir /mount_point_name
#mount /dev/vg_name/lv_name /mount_point

the update /etc/fstab as required .