AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
 View Only
  • 1.  Unable to shrink filesystem

    Posted Fri April 13, 2007 01:13 PM

    Originally posted by: bhead


    Anyone run into this one?

    AIX 5.3 TL3 (with some later PTF's applied)

    JFS2 filesystem with 592GB total space, 407GB used. Trying to shrink this down to 425GB total.

    chfs -a size=-167GB /oaphru

    chfs: There is not enough free space to shrink the file system.

    Since I'm trying to shrink it down to a size that's larger than the amount of used space I don't understand the error, not enough free space?

    Thanks in advance,
    Bill
    #AIX-Forum


  • 2.  Re: Unable to shrink filesystem

    Posted Fri April 13, 2007 01:43 PM

    Originally posted by: orphy


    What does "defragfs -s /oaphru" say?
    Orphy
    #AIX-Forum


  • 3.  Re: Unable to shrink filesystem

    Posted Fri April 13, 2007 01:58 PM

    Originally posted by: bhead


    I ran defragfs against it, that didn't help, right now it's not showing anything that can be migrated:

    /dev/lvb01hru filesystem is 0 percent fragmented.
    Total number of blocks : 155249995
    Number of blocks that may be migrated : 0
    #AIX-Forum


  • 4.  Re: Unable to shrink filesystem

    Posted Fri April 13, 2007 02:22 PM

    Originally posted by: orphy


    Not sure if you looked around already but they do have a Technote on this.

    http://www.redbooks.ibm.com/abstracts/TIPS0470.html?Open

    If that doesn't help, maybe you could try shrinking it a bit less
    and see if that goes first. Since you can always shrink it even
    more after that, it wouldn't hurt to try.

    You can also try sending back outputs of these cmds if you still hit
    the wall. Maybe we can think of something else.

    chfs -a size=-???G /oaphru
    echo $?
    df -k /dev/lvb01hru
    lsfs -q /dev/lvb01hru
    lslv lvb01hru
    Orphy
    #AIX-Forum


  • 5.  Re: Unable to shrink filesystem

    Posted Fri April 13, 2007 02:52 PM

    Originally posted by: bhead


    Thanks Orphy,

    I'm wondering if "du" will include meta data, output from du -g /oaphru shows 407.32. If I use that number the difference between what I'm trying to get it down to and used space is 17.68 GB, guessing that should be plenty of spare but I don't know for sure.

    I tried dropping it in 5GB increments, failed at the 45GB mark, which leaves 144GB free (according to df output). I'm guessing meta data should be more like KB or MB of data, with 144GB free I think something else is going on. Here is the output:

    >du -sg /oaphru
    407.32 /oaphru

    > chfs -a size=-5G /oaphru
    Filesystem size changed to 1231552512

    > chfs -a size=-5G /oaphru
    Filesystem size changed to 1221066752

    > chfs -a size=-5G /oaphru
    Filesystem size changed to 1210580992

    > chfs -a size=-5G /oaphru
    Filesystem size changed to 1200095232

    > chfs -a size=-5G /oaphru
    Filesystem size changed to 1189609472

    > chfs -a size=-5G /oaphru
    Filesystem size changed to 1179123712

    > chfs -a size=-5G /oaphru
    Filesystem size changed to 1168637952

    > chfs -a size=-5G /oaphru
    Filesystem size changed to 1158152192

    > chfs -a size=-5G /oaphru
    chfs: There is not enough free space to shrink the file system.
    > echo $?
    28

    > df -gP /oaphru
    Filesystem GB blocks Used Available Capacity Mounted on
    /dev/lvb01hru 552.25 407.43 144.82 74% /oaphru

    > df -k /dev/lvb01hru
    Filesystem 1024-blocks Free %Used Iused %Iused Mounted on
    /dev/lvb01hru 579076096 151851684 74% 58379 1% /oaphru

    > df -g /dev/lvb01hru
    Filesystem GB blocks Free %Used Iused %Iused Mounted on
    /dev/lvb01hru 552.25 144.82 74% 58379 1% /oaphru

    > lsfs -q /dev/lvb01hru
    Name Nodename Mount Pt VFS Size Options Auto Accounting
    /dev/lvb01hru -- /oaphru jfs2 1158152192 rw yes no
    (lv size: 1158152192, fs size: 1158152192, block size: 4096, sparse files: yes, inline log: no, inline log size: 0, EAformat: v1, Quota: no, DMAPI: no, VIX: no)

    > lslv lvb01hru
    LOGICAL VOLUME: lvb01hru VOLUME GROUP: vgb01
    LV IDENTIFIER: 00217b9d00004c00000000fe104df509.5 PERMISSION: read/write
    VG STATE: active/complete LV STATE: opened/syncd
    TYPE: jfs2 WRITE VERIFY: off
    MAX LPs: 3500 PP SIZE: 256 megabyte(s)
    COPIES: 1 SCHED POLICY: parallel
    LPs: 2209 PPs: 2209
    STALE PPs: 0 BB POLICY: relocatable
    INTER-POLICY: maximum RELOCATABLE: yes
    INTRA-POLICY: middle UPPER BOUND: 128
    MOUNT POINT: /oaphru LABEL: /oaphru
    MIRROR WRITE CONSISTENCY: on/ACTIVE
    EACH LP COPY ON A SEPARATE PV ?: yes
    Serialize IO ?: NO

    > umount /oaphru
    > fsck -y /oaphru

    The current volume is: /dev/lvb01hru
    Primary superblock is valid.
    • Phase 1 - Initial inode scan
    • Phase 2 - Process remaining directories
    • Phase 3 - Process remaining files
    • Phase 4 - Check and repair inode allocation map
    • Phase 5 - Check and repair block allocation map
    File system is clean.

    > mount /oaphru
    #AIX-Forum


  • 6.  Re: Unable to shrink filesystem

    Posted Fri April 13, 2007 03:31 PM

    Originally posted by: bhead


    I opened up a sev 3 PMR the other day, here is the latest response:

    "There's a limit to how much chfs can shrink a filesystem. This is
    because chfs has to take into account not only the data you are moving
    around, but it tries to keep the contiguous blocks of data in files
    still contiguous. So if you have a filesystem with a lot of space that
    is broken up into small areas, but you are moving around large files it
    may fail even though it looks like you have a lot of space left to
    shrink.
    Essentially that error is telling him the truth - there's not enough
    free space to move his data given the requirements of the data, and
    shrink the filesystem."

    I'm still fuzzy on this, since I ran defragfs and there doesn't seem to be anything fragmented at the moment. I wonder if having the INTER-POLICY set to maximum might have something to do with it, since the PP's are spread out over 118 LUNS?

    #AIX-Forum


  • 7.  Re: Unable to shrink filesystem

    Posted Fri April 13, 2007 04:18 PM

    Originally posted by: orphy


    I didn't see any obvious APARs out there about your problem.

    If Support is right, you don't seem to have too many options left.
    I guess if you have half of a TB hanging around, you can always
    cut a temp FS, move things over, trash it, recreate, and move stuff
    back. Using tape will also do but probably slow. Another option is
    to go with savevg/restvg but you'll have to fix a few things in
    <vg>.data before restvg. If you don't know what I'm talking about,
    try not to use this last option.

    I don't think INTER-POLICY is causing the problem but it's easy
    enough to change the policy to prove that.
    Orphy
    #AIX-Forum


  • 8.  Re: Unable to shrink filesystem

    Posted Sun April 15, 2007 08:14 PM

    Originally posted by: SystemAdmin


    Have you tried the following yet;

    chfs -a size=425GB /oaphru

    I seem to remember a while ago we had a similar episode where someone had extended a filesystem by a little too much, he tried to reduce the size with a chfs size=-amount_to_reduce /filesystem. It didn't work, he received an error, so I suggested he specify the size he wanted the filesystem to be.

    Seemed to work without a problem.
    #AIX-Forum


  • 9.  Re: Unable to shrink filesystem

    Posted Fri April 20, 2007 09:41 AM

    Originally posted by: bhead


    Yeah, I tried setting the size but received the same error. The DBA's are planning on cloning a prod instance over to this filesystem, when that happens I'm going to try it again, after removing all the data. Should confirm that having the pp's spread out across so many drives is causing the problem, not enough contiguous pp's to relocate the big dbf files.
    Thanks,
    bh

    > Have you tried the following yet;
    >
    > chfs -a size=425GB /oaphru
    >
    > I seem to remember a while ago we had a similar
    > episode where someone had extended a filesystem by a
    > little too much, he tried to reduce the size with a
    > chfs size=-amount_to_reduce /filesystem. It didn't
    > work, he received an error, so I suggested he specify
    > the size he wanted the filesystem to be.
    >
    > Seemed to work without a problem.

    #AIX-Forum


  • 10.  Re: Unable to shrink filesystem

    Posted Tue July 24, 2007 11:24 AM

    Originally posted by: siva0123


    I think there is a APAR for this fix

    http://www-1.ibm.com/support/docview.wss?uid=isg1IY79783

    Chk that

    Thanks,
    Siva
    #AIX-Forum