Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

newby? - adding a hard drive & space to a file system

Status
Not open for further replies.

noober

IS-IT--Management
Oct 10, 2003
112
US
Can someone give me a 'add a disk drive for dummies' lesson? I am installing a disk drive this week and I want to add the space on it to a file system called /nearline.

Its hard to know exactly what to do and the order to do things in because the manuals are so command and syntax centric and I am having trouble putting things together in steps. Any help is appreciated, including 'hey dummy look in this book...' assuming its not just a command reference.
-thx
 
First a bit more info pls

can you post the results of the following commands
lsvg
lsvg -l
lsvg -p
lspv
uname -a

Regards

--
| Mike Nixon
| Unix Admin
|
----------------------------
 
Hi Mike,
Thanks for trying to help a total unix-doof like me! I forgot to mention, I wont be doing any mirroring on this if it makes a difference.

lsvg:
rootvg
infxvg
appsvg <- the one in question

lsvg -l appsvg:
appsvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
lvraa jfs 17 34 2 open/syncd /raa
loglv00 jfslog 1 2 2 open/syncd N/A
lvdbg jfs 10 20 2 open/syncd /db_gen
lvutil jfs 7 14 2 open/syncd /util
lvoa jfs 5 10 2 open/syncd /oraclea
lvob jfs 190 380 2 open/syncd /oracleb
lvdb2a jfs 8 8 1 open/syncd /db2a
lvdb2b jfs 17 17 1 open/syncd /db2b
lvarchive jfs 512 512 2 open/syncd /nearline
lvsaver jfs 286 286 1 open/syncd /savefiles

lavg -p appsvg g:
appsvg:
PV_NAME PVSTATE TOTALPPs FREEPPs FREE DISTRIBUTION
hdisk1 active 542 0 00..00..00..00..00
hdisk2 active 542 342 109..00..16..108..109
hdisk4 active 542 209 109..86..00..00..14
hdisk5 active 542 334 109..00..08..108..109

uname -a:
AIX ender 3 4 000169114C00
 
and
lspv hdisk1
lspv hdisk2
lspv hdisk4
lspv hdisk5

--
| Mike Nixon
| Unix Admin
|
----------------------------
 

Plug in the disk then do:

cfgmgr
lspv (your new disk will have &quot;none&quot; under VG)
extendvg appsvg hdisk#
chfs -a size=+#number_of_blocks_to_add /nearline

That's it.

Cheers
 
unixfreak -
Thanks. Question, when I calc the number of blocks, according to IBM (man pages) I should use 512 as the block size, but on this particular system when I run the df command I see the block size listed as 1024. Does that mean the guy that set this thing up did not use the default block size of 512 and I should therefore not use it when I calculate the number of blocks to add?
 
Thanks again MRN, heres the lspvs on the existing drives, but just in case I led you to understand otherwise, I have not installed the new drives yet and will be doing that this weekend.

PHYSICAL VOLUME: hdisk1 VOLUME GROUP: apps2vg
PV IDENTIFIER: 00016911afa53f90 VG IDENTIFIER 00016911d3fbc30b
PV STATE: active
STALE PARTITIONS: 0 ALLOCATABLE: yes
PP SIZE: 32 megabyte(s) LOGICAL VOLUMES: 6
TOTAL PPs: 542 (17344 megabytes) VG DESCRIPTORS: 1
FREE PPs: 0 (0 megabytes)
USED PPs: 542 (17344 megabytes)
FREE DISTRIBUTION: 00..00..00..00..00
USED DISTRIBUTION: 109..108..108..108..109

PHYSICAL VOLUME: hdisk2 VOLUME GROUP: apps2vg
PV IDENTIFIER: 00016911cc83a357 VG IDENTIFIER 00016911d3fbc30b
PV STATE: active
STALE PARTITIONS: 0 ALLOCATABLE: yes
PP SIZE: 32 megabyte(s) LOGICAL VOLUMES: 2
TOTAL PPs: 542 (17344 megabytes) VG DESCRIPTORS: 1
FREE PPs: 342 (10944 megabytes)
USED PPs: 200 (6400 megabytes)
FREE DISTRIBUTION: 109..00..16..108..109
USED DISTRIBUTION: 00..108..92..00..00

PHYSICAL VOLUME: hdisk4 VOLUME GROUP: apps2vg
PV IDENTIFIER: 00016911e2172395 VG IDENTIFIER 00016911d3fbc30b
PV STATE: active
STALE PARTITIONS: 0 ALLOCATABLE: yes
PP SIZE: 32 megabyte(s) LOGICAL VOLUMES: 5
TOTAL PPs: 542 (17344 megabytes) VG DESCRIPTORS: 1
FREE PPs: 209 (6688 megabytes)
USED PPs: 333 (10656 megabytes)
FREE DISTRIBUTION: 109..86..00..00..14
USED DISTRIBUTION: 00..22..108..108..95

PHYSICAL VOLUME: hdisk5 VOLUME GROUP: rootvg
PV IDENTIFIER: 000169114f459966 VG IDENTIFIER 00016911374ca11e
PV STATE: active
STALE PARTITIONS: 0 ALLOCATABLE: yes
PP SIZE: 16 megabyte(s) LOGICAL VOLUMES: 9
TOTAL PPs: 542 (8672 megabytes) VG DESCRIPTORS: 1
FREE PPs: 64 (1024 megabytes)
USED PPs: 478 (7648 megabytes)
FREE DISTRIBUTION: 00..00..00..00..64
USED DISTRIBUTION: 109..108..108..108..45
 

Block size is always 512. If it say 1024 it's because you used the -k flag.

Cheers
 
I'm sorry to belabor (blushing) but does that mean if I wanted to add 2gig I would calculate the number of blocks by like so:
2,147,483,648/512

I appreciate the help. My ex-husband set this machine up and I sort of inherited the business and I am a little lost.
-thx
 
noober, you also could have gotten output in 1024 when you ran df if someone has set up an alias for df in your .profile or in an environment file (for example, alias df=&quot;df -k | sed 's/1024-blocks/ Kbytes/'&quot;)/
 
Why do you need to add more disk? you have 29248Mb not alocated to anything already.?

--
| Mike Nixon
| Unix Admin
|
----------------------------
 
-> mrn Why do you need to add more disk? you have 29248Mb not alocated to anything already.?<-

Can you elaborate?
 
noober, in the output for the lspv command, the section Free PPs shows that you have a lot of room on the disks. You can create new logical volumes/filesystems out of those free physical partitions or enlarge existing logical volumes/filesystems.

You might want to look at this FAQ: faq52-2441. It has a script that writes out a report of disks and what is on them.

If you want to add, say 2 GB, to /nearline using the existing disks, this is what you would do:

extendlv lvarchive 64 hdisk2

This extends the logical volume lvarchive by 64 physical partitions (2 GB because the partitions are 32 MB each) on hdisk2. If the logical volume is mirrored, you have to name another hdisk to use (hidks4 or hdisk1).

Then, at the command line, type lsfs -q /nearline. You will get out put similar to this:

Name Nodename Mount Pt VFS Size Options Auto Accounting
/dev/lv00 -- /users jfs 589824 -- yes no
(lv size: nnnnnnn, fs size: xxxxxxx, frag size: 4096, nbpi: 4096, compress: no, bf: false, ag: 8)

The important number to look at is the lv size. It will be larger than the fs size.

type

chfs -a size=nnnnnnn /nearline

You also can do all this (except the lsfs -q command) with smit (or smitty), which may be easier.



 
You guys have been great and I cant thank you enough.
 
you can also take advantage of the LVM's brains and avoid the two steps (extend lv, extend fs) by just extending the fs:

chfs -a size=+4000000 /nearline

the LVM does the rounding for you. for example you can add one PP (32MB in your case) like so:

chfs -a size=+1 /nearline

it is best to start thinking in 512kb block-sizes since AIX operates that way. also beware max fs size limits, you will have to had created your vg/lv/fs for large sizes in the first place, most limits cannot be changed after creation.

IBM Certified -- AIX 4.3 Obfuscation
 
Thanks Yegolev, I was thinking that IBM made this process a little top heavy but if the logical volume manager is smart enough to do that then I take those thoughts back!
 
If you want to control which disk the logical volume is extended to, you have to do the &quot;top heavy&quot; method (extend the logical volume, then change the filesystem size to fill the logical volume).

Controlling which disks a logical volume is on is especially important for database files.
 

There are other ways to control that. You can set the interpolicy to span a number of disks or you can use migratelv for finer control.

Cheers
 
Finally, something I actually know a little about! I use raw disk for my database files which opens up an even less enjoyable can of worms when ever I have to do anything. Thanks for all the support...Someday I will be big enough to hire one of you experts!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top