Operating System - HP-UX
1834619 Members
3128 Online
110069 Solutions
New Discussion

Can I write a file that is bigger than 2 gigs.

 
SOLVED
Go to solution
Shar Hunter
Frequent Advisor

Can I write a file that is bigger than 2 gigs.

Wow! You guys are really smart.
How about this one:
I am trying to backup my database but it keeps failing around 2 gigs. Is there anyway that I can write a 4.2 gig file to my system?
I don't think I'm in Kansas anymore.
23 REPLIES 23
Jean-Luc Oudart
Honored Contributor
Solution

Re: Can I write a file that is bigger than 2 gigs.

You need to enable large file option for your file system.

lots of threads on the subject
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=204549
etc ...

Regards,
Jean-Luc
fiat lux
Mark Grant
Honored Contributor

Re: Can I write a file that is bigger than 2 gigs.

Yes, you just need to have the filesystem mounted with the "largefiles" option enabled. You create the filesystem and mount it with "-o largefiles" as an option. You can change an existing filesystem to support largefiles with "fsadm -F vxfs -o largefiles /dev/vgXX/rlvolXX"
Never preceed any demonstration with anything more predictive than "watch this"
RAC_1
Honored Contributor

Re: Can I write a file that is bigger than 2 gigs.

You should have large file enabled on filesystem. Check if you largefiles set.

How you enable it?

fsadm -F vxfs -o largefiles /mount_point
There is no substitute to HARDWORK
Mark Grant
Honored Contributor

Re: Can I write a file that is bigger than 2 gigs.

Doh!

RAC's syntax is correct!
Never preceed any demonstration with anything more predictive than "watch this"
Jeff Schussele
Honored Contributor

Re: Can I write a file that is bigger than 2 gigs.

Hi Shar,

The filesystem into which you're writing the files must support largefiles.

To determine whether it does run the following:

fsadm /mnt_point

To set it for largefiles run the following

fsadm -o largefiles /mnt_point

Then check the /etc/fstab to make sure it's entry does not say nolargefiles. If it does change it to largefiles.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Robert Kerr
Advisor

Re: Can I write a file that is bigger than 2 gigs.

Elena Leontieva
Esteemed Contributor

Re: Can I write a file that is bigger than 2 gigs.

Shar,

You want to enable largefiles option:

umount /fs_name
fsadm -F fs_type -o largefiles /dev/vg_name/rlvol_name
mount -a

Check that it worked:
fsadm -F fs_type /fs_name

HTH,
Elena.
Geoff Wild
Honored Contributor

Re: Can I write a file that is bigger than 2 gigs.

Check the filesystem:

fsadm /filesystem

Example:

# fsadm /var/adm/crash
fsadm: /etc/default/fs is used for determining the file system type
largefiles

That means 2GB + is supported.

# fsadm /
fsadm: /etc/default/fs is used for determining the file system type
nolargefiles

That means you can NOT write files greater then 2 GB.

As other have said, use fsadm to enable:

fsadm -o largefiles /var/adm/crash

Then update the /etc/fstab:

/dev/vg01/lvol2 /var/adm/crash vxfs rw,suid,largefiles,delaylog,datainlog 0 2


Rgds...Geoff

Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Patrick Wallek
Honored Contributor

Re: Can I write a file that is bigger than 2 gigs.

How are you trying to backup your DB? Are you just copying or are you trying to compress or gzip the files as they are being backed up?

Your problem may not be with your filesystem but rather with the backup method you are using.
Shar Hunter
Frequent Advisor

Re: Can I write a file that is bigger than 2 gigs.

Thank You!
I don't think I'm in Kansas anymore.
Shar Hunter
Frequent Advisor

Re: Can I write a file that is bigger than 2 gigs.

It's not working.
Here is what I get:

# fsadm -o largefiles /dev/vg01/test
vxfs fsadm: /dev/vg01/test is not the root inode of a vxfs file sytem
#


# bdf /test
Filesystem kbytes used avail %used Mounted on
/dev/vg01/test 9216000 3232770 5800650 36% /test
#

# fstyp -v /dev/vg01/test
vxfs
version: 3
f_bsize: 8192
f_frsize: 2048
f_blocks: 4608000
f_bfree: 2991615
f_bavail: 2991615
f_files: 42240
f_ffree: 1073792296
f_favail: 1073792296
f_fsid: 1073807363
f_basetype: vxfs
f_namemax: 254
f_magic: a501fcf5
f_featurebits: 0
f_flag: 0
f_fsindex: 6
f_size: 4608000


I don't think I'm in Kansas anymore.
Patrick Wallek
Honored Contributor

Re: Can I write a file that is bigger than 2 gigs.

You use the actual mount point name:

# fsabm -F vxfs -o largefiles /test
Shar Hunter
Frequent Advisor

Re: Can I write a file that is bigger than 2 gigs.

I am getting closer....

# fsadm -F vxfs -o largefiles /test
fsadm: set feature (LARGEFILES) failed, errno 25
I don't think I'm in Kansas anymore.
Jeff Schussele
Honored Contributor

Re: Can I write a file that is bigger than 2 gigs.

Hi Shar,

OK - let's take a step back here.
What HP-UX OS version are you running?

uname -r

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Shar Hunter
Frequent Advisor

Re: Can I write a file that is bigger than 2 gigs.

Thanks for the command!

# uname -r
B.11.00
I don't think I'm in Kansas anymore.
Shar Hunter
Frequent Advisor

Re: Can I write a file that is bigger than 2 gigs.

Should I unmount the file system first?
I don't think I'm in Kansas anymore.
Shar Hunter
Frequent Advisor

Re: Can I write a file that is bigger than 2 gigs.

I have been reading some other threads.
I do not have online jfs so I think I need to umount it.

I think I need to do :

umount /test
# fsadm -F vxfs -o largefiles /test

Then I am going to modify the fstab file
from:
# System /etc/fstab
/dev/vg01/test /test vxfs delaylog 0 2

to:
/dev/vg01/test /test vxfs largefiles,delaylog 0 2

Then
mount /test

What do you think?
Would you do this while users are logged on (no one but me accesses the test directory)
I don't think I'm in Kansas anymore.
Jeff Schussele
Honored Contributor

Re: Can I write a file that is bigger than 2 gigs.

Yep - you're picking this up fast.
Indeed, you do need OnLine JFS to do -o largefiles while mounted. So unmount, change & remount.

If you're concerned about users being on run

fuser -cu /test

to see whether anyone else is in there. Make sure you're not when you do this or it will show you in there.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Shar Hunter
Frequent Advisor

Re: Can I write a file that is bigger than 2 gigs.

I umounted /test and no one noticed! Yipee!

Now I am back to
# fsadm -F vxfs -o largefiles /test
vxfs fsadm: /test is not the root inode of a vxfs file sytem

I looked at the man page and it said:

The fsadm command is designed to perform selected administration tasks
on file systems. These tasks may differ between file system types.
special is a device file containing an unmounted file system. However,
if the file system is of the type that provides online administration
capabilities the special could be a directory. directory must be the
root of a mounted file system.

I wish Iunderstood what a "root of a mounted files system was".
I don't think I'm in Kansas anymore.
Shar Hunter
Frequent Advisor

Re: Can I write a file that is bigger than 2 gigs.

GOOSSENS is KING!!!!!!!
I found a message from him back on Dec 12th.
It said

fsadm -F vxfs -o largefiles /dev/vg01/rora03
(note r in rora03 )

I did fsadm -F vxfs -o largefiles /dev/vg02/rtest.

IT WORKED!
Thanks everyone!

I don't think I'm in Kansas anymore.
Mark Grant
Honored Contributor

Re: Can I write a file that is bigger than 2 gigs.

Seems my syntax wasn't wrong after all :)
Never preceed any demonstration with anything more predictive than "watch this"
Ulrich Deiters
Frequent Advisor

Re: Can I write a file that is bigger than 2 gigs.

Don't forget to set the correct compiler options! The HP C compiler has to be invoked with "cc -Ae -D_FILE64 ..." in order to provide file pointers of more than 32 bit.
RAC_1
Honored Contributor

Re: Can I write a file that is bigger than 2 gigs.

Now I am commenting on does it have to be raw vol for fsadm syntax?

I think it is this way.

You have online JFS, fsadm works on raw or mount point. If you do not have online -jfs, it works on raw vol.

Am I making sense here?
There is no substitute to HARDWORK