18.7 Creating a New File System

   

You may create a new file system if you want to separate a particular type of file from the rest of the system or to separately allocate some disk space for a set of users. A file system can be created on a logical volume or by using the whole-disk approach using command-line utilities. You can also use SAM for this purpose.

File System Creation Process

Making a file system usable involves four basic steps.

  1. Create the new file system using the newfs command.

  2. Create a mount point for the file system using the mkdir command. A mount point is a directory on which the file system is mounted.

  3. Mount the new file system on the mount point using the mount command.

  4. Create an entry in the /etc/fstab file for the file system so that it is automatically mounted every time you boot up your system.

Creating a File System with the newfs Command

The newfs command is used to create a new file system. If you are using LVM, this command can be used after you have carried out the following three steps.

  1. Physical volumes have been created.

  2. One or more volume group has been created using these physical volumes.

  3. Logical volumes have been created.

After these steps, you can use the newfs command to create a file system on a logical volume. To create a JFS file system on /dev/vg03/lvol4 , you can use following command.

 newfs -F vxfs /dev/vgo3/rlvol4 

Other options that can be used with the newfs command are listed in Table 18-3.

Table 18-3. Options Used with the newfs Command
Option Description
-F Type of file system. You can use " hfs " for an HFS file system and " vxfs " for JFS. You can use the newfs_hfs command to create the HFS file system only and the newfs_vxfs command to create a JFS file system.
-s Size of the file system in blocks. If you don't specify this option, newfs will use all available space on a logical volume.
-v Verbose mode to display what is going on during the execution of the command.
-o largfiles Used for support of large files. By default, the maximum file size is 2 GBytes. Using this option, you can create files up to 128 GBytes.
-b Block size in bytes (HFS only).
-i Space per inode in bytes (HFS only).
-f Fragment size in bytes (HFS only).
-R Reserves swap space in megabytes at the end of the file system. This option can't be used with -s option.
-m Minimum amount of free space allowed. If the file system is full to this amount, no user can use the file system except the root user. The default amount is 10% of the total file system space. If you are using a large file system, you may wish to reduce this space (HFS only).

Let's see some examples of the use of the newfs command. To create a file system with largefile support on /dev/vg03/lvol5 , use:

 newfs -F vxfs -o largefiles /dev/vg03/rlvol5 

To create an HFS with a block size of 2 Kbytes, use the following.

 newfs -F hfs -b 2048 /dev/vg03/rlvol5 

To create a JFS file system using the whole-disk approach on disk c2t5d0 and leaving 100 MBytes of space for swap, use this command.

 newfs -F vxfs -R 100 /dev/rdsk/c2t5d0 

   
Top


HP Certified
HP Certified: HP-UX System Administration
ISBN: 0130183741
EAN: 2147483647
Year: 2000
Pages: 390
Authors: Rafeeq Rehman

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net