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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

newbie question: how to determine the physical size of a filesystem? 2

Status
Not open for further replies.

whn

Programmer
Oct 14, 2007
265
US
I have a AIX 5.3 which has external storage devices connected.

For instance, one of devices is this:
Code:
ls -l /dev/hdisk18
brw-------   1 root     system       13, 54 Mar 25 2008  /dev/hdisk18

Is there a command to show the physical size of /dev/hdisk18?

Thanks.
 
bootinfo -s hdisk18

This tells you the size in MB of the device
 
Thank you so much, dial8d.
 
but /dev/hdisk8 is a hard disk or a physical volume, not a filesystem...


HTH,

p5wizard
 
I may have just mixed these up.

What I want is to find disk space of a hard disk or a filesystem.

Are there different cmds for them?

Thanks.

In addition, is there a similar command to find the space of a external device/raw device for solaris?

For instance,

Code:
% pwd
/dev/rdsk
% ls -l c3t5006016839A02025d8s2
lrwxrwxrwx   1 root     root          83 Jul 31 11:29 c3t5006016839A02025d8s2 -> ../../devices/pci@7c0/pci@0/pci@9/QLGC,qlc@0,1/fp@0,0/ssd@w5006016839a02025,8:c,raw

How do tell how big c3t5006016839A02025d8s2 is?

Thanks again.

 
Sorry, this is an AIX forum.

hdisk18 size: bootinfo -s hdisk18
/usr FS size: lsfs /usr or df /usr


HTH,

p5wizard
 
hi,
AIX is an IBM creation, then, nothing is easy !

There is a hierarchy that starts from:

0) [pdisk] Physic disk in case of array (not always present)
1) hdisk (physical disk not in array, or resultant array)
2) volume group (1 or more hdisks)
3) Logical volumes (a portion of a VG)
4) File system (stays always on a LV)

note: an LV without a FS is the paging, boot, special
lv for databases in raw mode.


# lsvg
gives the list of VGs

# lsvg <vgname>
gives info about a specific VG: total,free,used PP|MEGABYTES

# lspv
lists physical volumes and in which VG are involved

# lsvg -l <vgname>
lists the logical volumes (ad mount points, if the are
jfs type)

# df -k
lists all mounted filesystem and infos about spaces (in kbytes)


and more...

If you go in smit, you can see ( in ...storage ...)
a lot of menu-programs, that launch above and other (or
with a lot of specifier) commands.

I hazard a paragon:

What in Win is a disk, in AIX is a VG done by just 1 disk.
A Windows partition is an Unix filesystem: as you can have
FAT or NTFS type, you have jfs or jfs2 in AIX.

Paging in Win is a file, it stays on a partition (fs):
in Unix, the paging IS a special partition.

ciao
vittorio
 
AIX is an IBM creation, then, nothing is easy!

Never truer words. Thanks goodness we've recently retuened to Sun!

I want to be good, is that not enough?
 
Thank you all for your valuable advices and special thanks to Victory.

To khalidaaa,

Code:
% lsattr -El hdisk18
clr_q         yes                              Device CLEARS its Queue on error True
location                                       Location Label                   True
lun_id        0xb000000000000                  Logical Unit Number ID           False
lun_reset_spt yes                              FC Forced Open LUN               True
max_transfer  0x40000                          Maximum TRANSFER Size            True
node_name     0x50060482cb1b9c84               FC Node Name                     False
pvid          0003ae61935983880000000000000000 Physical volume identifier       False
q_err         no                               Use QERR bit                     True
q_type        simple                           Queue TYPE                       True
queue_depth   16                               Queue DEPTH                      True
reserve_lock  yes                              Reserve Device on open           True
rw_timeout    40                               READ/WRITE time out value        True
scsi_id       0x650700                         SCSI ID                          False
start_timeout 180                              START UNIT time out value        True
ww_name       0x50060482cb1b9c84               FC World Wide Name               False

Strange enough, the output is different from what’s shown on man page!

=============================

To Victory,

Again, thank you so much for your time and effort. Before I posted my question, I had googled quite some info and did come cross those commands mentioned in your post. However, there are a few things that I don’t quite understand.

Question 1:
Code:
% lsvg -p rootvg
rootvg:
PV_NAME           PV STATE          TOTAL PPs   FREE PPs    FREE DISTRIBUTION
…………
hdisk3            active            79          79          16..16..15..16..16
…………

%  bootinfo -s hdisk3
[b]10240[/b]

How is ‘10240’ related to ‘79’ – the total PPs?

Question 2.

I understand that I need to add hard disks to a volume group before I can use command ‘lsvg –p’. According to what I googled, I should use these two commands to add a disk into a VG:

/usr/sbin/chdev -l {$diskname} -a pv='yes'
/usr/sbin/extendvg -f rootvg {$diskname}

I was able to add some disks into ‘rootvg’. However, I also got two errors for different disks:

Error 1:
Not enough descriptor area space left in this volume group. Either try adding a smaller PV or use another volume group.

Error 2:
0516-029 /usr/sbin/extendvg: The Physical Volume is a member of a currently varied on Volume Group and this cannot be overidden.
0516-1397 /usr/sbin/extendvg: The physical volume hdisk18, will not be added to the volume group.
0516-792 /usr/sbin/extendvg: Unable to extend volume group.

I guess the first error might be easily fixed by using some commands like ‘chvg/mkvg’? But I don’t know how to do it exactly.

For error 2, I don’t quite understand it and have no idea what to do with it.

In addition, somehow, I have a feeling that I should be able to use ‘mkfs’ to get the disk size on aix. But I don’t know what flags to use.

Thank you all for your attention and help.

p.s. I’ll ask a similar question on Solaris Forum. So, Solaris Experts, could you please go there to take a look? Thanks in advance.
 
hi,
when you do

# lsvg rootvg

you see also PP size: it is the "quantum" (in megabytes) of the VG: your filesystems (on this VG) will be multiple of this value: if you ask to create a fs of 1 mb (or increase a fs of 1 mb), AIX will create a fs of a PP size.

About question 1
a) bootinfo -s
is unsupported (I have not found bootinfo in 5.3 documentation)
Looking in my old documents, AIX 4.3
bootinfo -s Disk
gives the size (in MB) of the HD

In AIX 5, to get info about devices, use

# lsattr -E -l devname

or better

# lscfg -vp
or
# lscfg -vp -l devname

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
about
% lsvg -p rootvg

gives the distribution of rootvg across disks:
I don't see other disks than hdisk3 (probably they was
in ....), becouse seems that no PP of rootvg are in hdisk3:
Total 79, Free 79
hdisk3 is in rootvg, but you have added later and no lv
are yet on it.
I bottinfo -s gives size in MB, 10240 is the disk size
if you do 10240/79=129.xxx (10240/80=128 ???)
128 may be the PPSIZE of rootvg (check it on lsvg rootvg)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

About question 2:

You have to use smit !

Just for curiosity, or when you bocome expert and continue
to repeat commands or you have to write scripts, before
give GO in smit, press F6, and see the command that you are
to do.
If you want, copy it and enter it in another terminal.

about errors:
When you build a VG, (no rootvg, becouse it is built at installation time) (smitty vg), programs asks you:

- the vgname [optional]
- the hdisks
- the ppsize

If you have a big disk, and you enter a little ppsize,
you receive an error: the number of ppsize exceedes a maximum: with a big disk, you must have a great ppsize!

I don' know size of currently disks in rootvg (probably little becouse scsi local disk) and the one of new disk
(hdisk18 ?, probably a SAN disk ? a big one ? )

AIX permits to merge disks of different size in a same
VG, but the ppsize is a property of VG and then the same
for all disks

I hazard: the ppsize of rootvg (128?), will produce
hundreds of PP in a big disk and is over the maximum.
I am not sure if you can change this value in a given
VG.

Error 2
0516-029 /usr/sbin/extendvg: The Physical Volume is a member of a currently varied on Volume Group and this cannot be overidden

give an

# lspv

hdisk18 is free or is in just another VG ?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

chvg = change a VG : it already exists and you modify it
mkvg = make a VG : Windows speaking : New

mkfs, crfs = create a fs
chfs = change filesystems: all these are active commands.

If you want get info about an object (fs,vg,lv,xxx),
you cannot enter such commands

"I should be able to use 'mkfs' to get the disk size on aix"

I don't know no flags

I use lsfs (but you have not info about size)
I use df (it gives size info)
You can use
#lsvg -l rootvg

It gives PP number, logical an physical (they differs if
you have mirrored the VG or just a LV) and if you multuply it for PPsize, you have the filesystemsize.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Just a curiosity:

you have a task, a problem to solve, or this is just an exercise ?
My work is support, and the my answers and solutions can
differs from your situation.


ciao
vittorio
 
Thank you so much, Victory, for your help. I need more time to digest your post, 'cause I am new to AIX. And thank you too, dial8d!!

To answer Vistory's last question:

I am writing a tool (in perl) which can list all raw devices sorted by their size. Then the software developed in house could use them accordingly.

BTW, it seemed to me that the server of this forum stopped sending out email notice.
 
about bootinfo:

bootinfo is NOT unsupported, it is just an undocumented tool.

bootinfo -s hdisk3
10240

means 10240MB or 10GB

The tool is called bootinfo because it is used by the boot/install routines to read the size of the disks available to the system when installing AIX. E.g. to determine whether there is enough disk space to install AIX and to calculate the PP size when creating the rootvg.

lspv hdisk3 shows 79, this means that the PP size is 128MB, so your disk is 10240MB but only 79x128MB=10112MB are addressable on this disk in this volumegroup


HTH,

p5wizard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top