Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX System Administrator's Guide: Routine Management Tasks: HP-UX 11i Version 3 > Chapter 3 Managing Systems

Managing Large Files

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

HP-UX supports large files (greater than 2 GB), however, when working with large files be aware of these issues:

  • You cannot perform interactive editing on large files. For example, if you try to run vi on a large file, the following error message appears:

    vi large_file "large_file" Value too large to be stored in data type
  • You cannot mail a large file.

  • You cannot print a large file.

Creating a Large-Files File System

If you want a file system to support large files (greater than 2 GB), then large files must be enabled.

HFS file systems

The default for HFS file systems is nolargefiles. To enable the use of large files, you must explicitly enable this feature.

You can create a large-files file system using the mkfs command or the newfs command.

VxFS file systems

The default for VxFS file systems is largefiles. To prevent the use of large files, you must explicitly disable them for VxFS file systems.

In case the default changes in a future release, it is a good idea to explicitly set either the largefiles or nolargefiles option when you create a file system. See theexamples in the following sections.

Examples of Creating a Large Files File System

The following examples show different ways to create a large-files file system.

/usr/sbin/mkfs -F hfs -o largefiles /dev/vg02/rlvol1
/usr/sbin/newfs -F hfs -o largefiles /dev/vg02/rlvol1
/usr/sbin/mkfs -F vxfs -o largefiles /dev/vg02/rlvol1
/usr/sbin/newfs -F vxfs -o largefiles /dev/vg02/rlvol1

Examples of Creating a No-Large-Files File System

The following examples show different ways to create a file system that will not support large files.

/usr/sbin/mkfs -F hfs -o nolargefiles /dev/vg02/rlvol1
/usr/sbin/newfs -F hfs -o nolargefiles /dev/vg02/rlvol1
/usr/sbin/mkfs -F vxfs -o nolargefiles /dev/vg02/rlvol1
/usr/sbin/newfs -F vxfs -o nolargefiles /dev/vg02/rlvol1

Changing from a Large-Files File System

You can change a file system back and forth between largefiles and nolargefiles using the HP System Management Homepage (HP SMH) or the fsadm command (shown below).

To make the change using the HP System Management Homepage:

  1. Navigate to the File Systems configuration page (Tools → Disks and File Systems → File Systems)

  2. Select the file system that you want to change

  3. From the action list on the right side of the page, select:

    • Modify HFS, if the file system requiring alteration is an HFS file system, or

    • Modify VxFS, if the file system requiring alteration is a VxFS file system

    NOTE: Only the appropriate action for the selected file system will be displayed.

HFS file systems:

To convert an HFS file system from largefiles to nolargefiles, the file system must be in a clean state[4] and must be unmounted. Also, in order for the fsadm command to succeed in the conversion from a largefiles mode to a nolargefiles mode, you must first remove an files that are greater than 2GB in size.

The following example shows how to convert a largefiles HFS file system to a nolargefiles HFS file system.

# fsck -F hfs /dev/vg03/lvol2 fsck: /dev/vg03/lvol2: mounted file system continue (y/n)? y ** /dev/vg03/lvol2 ** Last Mounted on /testHFS ** Phase 1 - Check Blocks and Sizes ** Phase 2 - Check Pathnames ** Phase 3 - Check Connectivity ** Phase 4 - Check Reference Counts ** Phase 5 - Check Cyl groups 2 files, 0 icont, 9 used, 512490 free (10 frags, 64060 blocks) ***** MARKING FILE SYSTEM CLEAN ***** ***** FILE SYSTEM WAS MODIFIED ***** #/usr/sbin/umount /myfilesystem #/usr/sbin/fsadm -F hfs -o nolargefiles /dev/vg03/rlvol2

VxFS file systems: Unlike HFS file systems, VxFS file systems can be switched between largefiles and nolargefiles without unmounting (and without requiring an fsck operation to verify file system state). However, as with HFS file systems, you must remove any large files (files with size greater than 2GB) from the file system before a switch between largefiles to nolargefiles will succeed.

NOTE: largefiles and nolargefiles are mount options to file systems. If you manually switch a file system between one mode and another, you might need to edit the corresponding entry in the file /etc/fstab so that future mounts and boots will mount the file system using the proper mode.

Command Support for Large Files

All of the file system administration commands, as well as all file system user commands, for HFS and VxFS support large files (greater than 2 GB in size).

If a command that does not support large files encounters a large file, the command will return an [EOVERFLOW] error and print a message like the following:

Value too large to be stored in data type

Repairing a Large-Files File System with fsck

The fsck(1M) command repairs damaged file systems. Typically, large files should not appear in a no-large-files file system. There are two ways fsck recovers from this situation if a large file does appear.

In the first scenario, you use fsck in the interactive mode. fsck finds a large file on a no-large-files file system, marks the file system dirty and stops. You can then correct the situation using the fsadmcommand with the -o largefiles option. The fsck command repairs the file system, which you are then able to mount. This scenario would preserve the large file, if fsck did not find it corrupt in any other way.

In the second scenario, using non-interactive mode, fsck purges the large file on a no-large-files file system. fsck assumes the superblock to be accurate based on its accuracy checks since the probability of a superblock being corrupt is insignificant when compared to the instance of a large file manifesting in a no-large-files file system. Consequently, fsck will remove the large file from a file system it believes should not contain large files.

The mount Command and Large-Files File Systems

The mount command supports large-files file systems and provides you with a method of ensuring that no large-files file systems are mounted on the system.

The mount command uses the same two options as the mkfs, newfs, and fsadm commands (largefilesand nolargefiles). mount will not mount a large-files file system if the -o nolargefiles option is specified. Conversely, the mount command will not mount a no-large-files file system if the -o largefiles option is specified. If no option is provided to mount, it will use the state of the file system itself to determine if it is mounted as largefiles or nolargefiles.

NOTE: Changing VxFS file systems between largefiles and nolargefiles updates the mount attributes online (in the file /etc/mnttab). It does not update the file /etc/fstab. If you explicitly specify largefiles or nolargefiles in an fstab entry and the current attributes of the file system do not match, future mounts may fail. If that occurs, you will need to change the entry in fstab to match so the mount will succeed.

For More Information on Large Files

Refer to:



[4] Use the fsck command to check the state of, and if necessary repair HFS file systems. See the fsck(1M) and fsck_hfs(1M) manpages

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 2008 Hewlett-Packard Development Company, L.P.