1753513 Members
5673 Online
108795 Solutions
New Discussion юеВ

Rant on fsadm

 
Alex Georgiev
Regular Advisor

Rant on fsadm

I have a couple of issues with the current verson of the fsadm command.

I'm sure many of you have the same setup as I do: HP-UX 11i, logical volumes formatted with VxFS, and OnlineJFS. With that setup, when I go to increase the size of a file system, I generally follow this procedure:

. extend the LV first
. take the number of total logical extents
. multiply it by the extent size
. then multiply it by 1024
. that gives me the size in KB, which I plug into fsadm -b

I usually end up with the following sequence:

(using vg02/lvol3 as an example)

host# lvextend -l 200 /dev/vg02/lvol3

(now find the size of the extent)

host# lvdisplay vg02 | grep "PE Size"

(multiply the total number of extents, 200, by the "PE Size", say 16 MB, and then multiply again by 1024 to get the size in Kbytes, and you plug that into fsadm)

host# fsadm -b $(( 200 * 16 * 1024 )) /mountpnt

My pet peeves are:

1. Why couldn't I tell fsadm to take all the available space with a simple command, like extendfs can?

A simple 'fsadm -b max /mnt' would be nice. Saves me from having to do the extra lookup with vgdisplay.

2. Can a vxfs sector be anything other than 1024 bytes?

The argument to the -b option is not the size in Kbytes, but rather the size in sectors. The rule of thumb is that one sector is 1 KB big. I haven't found anything that says that a sector is restricted to 1024 bytes in size.

I know that the default value is 1024 bytes, and that it's defined in the /usr/include/sys/param.h file as DEV_BSIZE. The question still stands, though... Can the sector size (somehow misteriously) be different than 1024 bytes?

Because if it can't, then just change the damn man page for fsadm to say that -b option takes a size in KB, and do away with the term "sector"!

3. More ranting on fsadm:

Wouldn't it be nice if the -b option can take an argument with a suffix at the end, specifying the unit of measure?

Example: 1G for 1 Gig, or "512 M" for Megabytes, 35243K for Kilobytes. The mkfs and newfs commands take these, so why not fsadm?

If there is a kind HP-UX developer out there that will read this, please put in that feature request for me!

4. One more, and I promise I'm done:

I work with AIX, too, and there is only one thing I like about it. It is that when I go to increase the size of a file system, I can say:

chfs -a size=+1024M /mountpnt

I love the + and - prefixes. Can I have those in HP-UX please?

That way I don't have to know the total size of the file system. Most of the time I just know that I need 20 Megs more, and so I'd like to be able to say:

lvextend -L +20M /dev/vg02/lvol3
fsadm -b +20M /mountpnt
- or -
fsadm -b max /mountpnt

If you read this far, thank you for reading. I hope that you feel the same way about fsadm as I do. Please post your comments! At least 1 point will be assigned for your post. More if your comments are good, or if you tell me how you deal with these issues.

Free beer and pizza to the HP-UX developer that implements the proposed syntax changes for fsadm. :-)
7 REPLIES 7
Steve Lewis
Honored Contributor

Re: Rant on fsadm

You can use M and K to specify your new filesystem size in fsadm, but not G.

[root]clifecnv:/> lvextend -L 100 /dev/vg03/lvtest
Warning: rounding up logical volume size to extent boundary at size "104" MB.
Logical volume "/dev/vg03/lvtest" has been successfully extended.
Volume Group configuration for /dev/vg03 has been saved in /etc/lvmconf/vg03.conf
[root]clifecnv:/> fsadm -b 104M /test
fsadm: /etc/default/fs is used for determining the file system type
vxfs fsadm: /dev/vg03/rlvtest is currently 16384 sectors - size will be increased

I agree with your + and - ideas and with the output.

I also agree with your rant on the longwinded procedure.

Unfortunately these things happen when HP plug in 3rd party Veritas software as opposed to developing integrated software in-house.

While the forums aren't normally monitored for enhancement purposes, maybe we could start a forums campaign to ask HP to wrap something else in fsadm_vxfs.




Steve Lewis
Honored Contributor

Re: Rant on fsadm

Slight correction, it looks like you can use G these days too. Maybe a recent patch changed it:

[root]clifecnv:/> fsadm -b 1G /test
fsadm: /etc/default/fs is used for determining the file system type
vxfs fsadm: /dev/vg03/rlvtest is currently 106496 sectors - size will be increased
[root]clifecnv:/> bdf /test
Filesystem kbytes used avail %used Mounted on
/dev/vg03/lvtest 1048576 1357 981775 0% /test
Florian Heigl (new acc)
Honored Contributor

Re: Rant on fsadm

As it's already been said, You've been doing double work, the 1024m option has been there since 11.00, I think.

But I really support the +/- arguments, they could come in handy at times.
yesterday I stood at the edge. Today I'm one step ahead.
Alex Georgiev
Regular Advisor

Re: Rant on fsadm

True enough, the M, K, and G options do work. It's just that the man page doesn't say anything about them.
Florian Heigl (new acc)
Honored Contributor

Re: Rant on fsadm

right, I remember we also found out about them by chance :(
yesterday I stood at the edge. Today I'm one step ahead.
Armin Kunaschik
Esteemed Contributor

Re: Rant on fsadm

M,K etc. came in with a patch quite some time ago...
I don't remember which one, but if you update your machines to a current patch level you should find these options.

My 2 cents,
Armin

And now for something completely different...
Thomas J. Harrold
Trusted Contributor

Re: Rant on fsadm

Wow, this post was a delight. I have gone through the *exact* same rants at various time. I also stumbled onto the k/m/g flags.

Comment to HP: Rather than invest in a GUI that most serious sysadmins will not use, spend some time fixing syntax of CLI.

Another example (perhaps I'll start a new post with this rant): Why does vgcreate require that I first setup the /dev/vgxx, and then do the mknod manually? Please, the first implementation of LVM on Linux addressed that issue. :)

-tjh
I learn something new everyday. (usually because I break something new everyday)