1

I have an HP UX server that has a mount point /usr that reached 100% when you use bdf command.

How can I add space (tried removing files, not an option) from either a new disk or existing diskspace from other mount points:

  1. Without restarting that server
  2. Without Online JS

    vgdisplay
    
    --- Volume groups ---
    VG Name                     /dev/vg00
    VG Write Access             read/write
    VG Status                   available
    Max LV                      255
    Cur LV                      8
    Open LV                     8
    Max PV                      16
    Cur PV                      1
    Act PV                      1
    Max PE per PV               4356
    VGDA                        2
    PE Size (Mbytes)            32
    Total PE                    4346
    Alloc PE                    4148
    Free PE                     198
    Total PVG                   0
    Total Spare PVs             0
    Total Spare PVs in use      0
    VG Version                  1.0
    VG Max Size                 2178g
    VG Max Extents              69696
    

bdf output:

/dev/vg00/lvol7    9568256 9568248       8  100% /usr

I had proposed a reboot method that does the following, but rebooting has been denied (for other reasons by the server owner):

  1. lvextend -l 392 /dev/vg00/lvol7

1a. Reboot, login using single user mode: http://www.cyberciti.biz/faq/hpux-booting-into-single-user-mode/

  1. umount /usr

  2. extendfs -F vxfs /dev/vg00/lvol7

  3. mount /dev/vg00/lvol7 /usr

Had done step 1. above, and was stopped before doing 1a) reboot.

Is there a way I can achieve adding more space (say leave /usr at 50% free) space without the reboot?

BE77Y
  • 2,667
  • 3
  • 18
  • 23
Gift Rise
  • 167
  • 10

2 Answers2

1

This will not answer the question as asked: but is an option you may decide to take to achieve the result originally intended.

Provided:

  • you have a folder in the full file system (somewhere inside /usr in this case, eg. /usr/somefolder/someSubFolderContainingGROWINGFILES) that contains large files,
  • you have space on the physical volumes

What to do

Stop your application (s):

whatever command that stops your application (s) which depend on /usr/somefolder/someSubFolderContainingGROWINGFILES

Create a logical volume:

lvcreate -n lvol10 -L 100000 vg05

Format for file system:

newfs -F vxfs -o largefiles /dev/vg05/rlvol10

Mount the new filesystem in a temporary location:

mkdir /tmpmount
mount -T vxfs /dev/vg05/rlvol10 /tmpmount

Copy files to the new disk in the temporary location:

cd /usr/somefolder/someSubFolderContainingGROWINGFILES
tar cf - . | (cd /tmpmount; tar xf -)

Verify that the files were correctly copied by comparing the checksums of the files in the old and the new location:

md5sum * > /tmp/oldfiles.sum
cd /tmpmount
md5sum * > /tmp/newfiles.sum
diff /tmp/newfiles.sum /tmp/oldfiles.sum

If the files are the same, delete the old files from /usr/somefolder/someSubFolderContainingGROWINGFILES

Unmount the temporary mount and re-mount the new volume on big folder:

umount /tmpmount
mount /dev/vg05/lvol10 /usr/somefolder/someSubFolderContainingGROWINGFILES

Start your application (s):

 whatever command that starts your application (s) you had stopped
Jenny D
  • 27,780
  • 21
  • 75
  • 114
Gift Rise
  • 167
  • 10
  • I'd recommend using `tar` instead of `cp` to copy the files - that way you'll keep the ownership etc, and you can tack on `gzip` to reduce the amount of space they take on the temporary location. – Jenny D Jun 12 '15 at 09:49
  • Oh, brilliant, thanks for the suggestion: new to Linux / unix, so good to hear. – Gift Rise Jun 12 '15 at 10:21
  • I've edited your answer to use tar instead of cp, and also to use the new disk at once instead of using temporary storage. If you don't like the edit, feel free to roll it back! – Jenny D Jun 12 '15 at 11:03
  • No, now worry, keep it 'the best way' just like you added it; that should help many others who need to do as you indicated. Thanks! – Gift Rise Jun 12 '15 at 11:28
  • Thanks yourself! You had the most important parts bang to rights; it's just that I've had to do this particular thing a few times and found ways to make it a bit better... if you're new to Linux/Unix, you should be proud because you already know stuff that I didn't when I started out! – Jenny D Jun 12 '15 at 12:06
0

No, you have to unmount the drive to resize it. Since there will be many services running that write to use im going to say it will be next to impossible.

lsof | grep /usr | wc -l

This is how many files accessing that area of the system.

chrisw9808
  • 309
  • 1
  • 5
  • ok, thanks. for lsof, those who might not have can try using `ps -ef | grep partial_name_of_program`. Needed that verification. – Gift Rise Jun 12 '15 at 08:40