C.1 Creating and Mounting NSS Pools and Volumes by Using Linux Commands

C.1.1 Using the Linux mkfs Command to Create NSS Pools

The Linux mkfs command is used to build a file system on Linux. This section describes how to use the Linux mkfs command to create an NSS file system pool.

WARNING:Be careful with this command. The mkfs command destroys any existing data on the specified device or partition.

Syntax

mkfs [ -t fs-type ] [ fs-options ] filesys

Option or Parameter

Description

-t fs-type

Specifies the type of file system to be built, such as nsspool or nssvol. For example:

-t nsspool
-t nssvol
fs-options

File-system-specific options to be passed to the real file system builder.

When creating an NSS pool, use this fs-option:

-n poolname

Replace poolname with the actual name of the pool you want to create.

When creating an NSS volume, use this fs-option:

-n volname

Replace volname with the actual name of the volume you want to create.

filesys

When using nsspool as the fs-type, replace filesys with the device name (devname such as /dev/hda1 or /dev/sdb2).

When using nssvol as the fs-type, replace filesys with the pool name (poolname such as POOL2).

Examples

mkfs -t nsspool -n poolname devname
mkfs -t nssvol -n volname poolname

C.1.2 Creating a Partition

Use the following procedure to create a /dev/partitiondevice, such as /dev/hda2or /dev/sda5.

  1. Log in to the server as the root user, or use the su command to become root.

  2. Go to the YaST > System Partitioner, then select Create a Partition.

  3. Select a device with free space available.

  4. Create a partition. The name is automatically specified, such as hda2 or sda5.

  5. If you do not want to use all of the available free space, specify the amount of space to use.

    Make sure the partition size is sufficient for the NSS pool you want to create later; the partition size determines the pool size.

  6. Select Unformatted.

  7. Do not specify the mount point; leave the Mount Point field blank.

  8. Click OK to create the partition.

  9. Continue with Section C.1.3, Creating and Mounting an NSS Pool.

C.1.3 Creating and Mounting an NSS Pool

  1. Log in to the server as the root user, or use the su command to become root.

  2. At a system command prompt, enter

    mkfs -t nsspool -n poolname devname 

    Replace poolname with the name you want to use, such as POOL2. Replace devname with the device you created in Section C.1.2, Creating a Partition.

    IMPORTANT:Do not use ampersand (&) and pound (#) characters in pool and volume names; it creates problems in the /etc/fstab file. For information about other naming conventions, see “Naming NSS Storage Objects” on page 61.

    For example, enter

    mkfs -t nsspool -n POOL2 /dev/hda2 

    where POOL2 is the pool name and /dev/hda2 is the device name.

  3. If the location where you want to mount the NSS pool does not already exist, create the mount point. At the server command prompt, enter

    mkdir /mnt/pooldir

    The /mnt directory is the default location for mounting devices. If you are using a different location, replace /mnt with that path. Replace pooldir with the name (path) you want to use, such as POOL2. If you want to make it a hidden directory, begin the directory name with a period, such as .POOL2.

    For example, enter

    mkdir /mnt/.POOL2

    where /mnt/.POOL2 is the mount point for your pool.

  4. Mount the NSS pool. At a system command prompt, enter

    mount -t nsspool devname mountpoint -o name=poolname

    For example, enter

    mount -t nsspool /dev/hda2 /mnt/.POOL2 -o name=POOL2
  5. Use NSSMU to create a Storage object in eDirectory for the newly created pool.

    1. At a terminal prompt, enter

      nssmu
    2. From the NSSMU menu, select Pools.

    3. Select the pool from the Pools list, then press F4 (NDS Update).

  6. Continue with Section C.1.4, Creating and Mounting an NSS Volume.

C.1.4 Creating and Mounting an NSS Volume

  1. Log in to the server as the root user, or use the su command to become root.

  2. Make sure the pool where you want to create the volume is mounted.

    For information, see Section C.1.3, Creating and Mounting an NSS Pool.

  3. Create an NSS volume. At the system console, enter

    mkfs -t nssvol -n volname poolname

    Replace volname with the name you want to use, such as NSSV1. Replace poolname with the NSS pool where the volume will reside, such as POOL2. This is the pool you created in Section C.1.3, Creating and Mounting an NSS Pool.

    IMPORTANT:Do not use ampersand (&) and pound (#) characters in pool and volume names; it creates problems in the /etc/fstab file. For information about other naming conventions, see “Naming NSS Storage Objects” on page 61.

    For example, enter

    mkfs -t nssvol -n NSSV1 POOL2 
  4. If the location where you want to mount the NSS volume does not already exist, create the directory path. At the server command prompt, enter

    mkdir /media/nss/volname

    The /media/nss path is the default location for NSS volumes. If you are using a different location, replace /media/nss with that path. Replace volname with the name of the volume you created in Step 3.

    For example, enter

    mkdir /media/nss/NSSV1
  5. Mount the NSS volume. At a system command prompt, enter

    mount -t nssvol VOL volmountpoint -o name=volname

    For example, enter

    mount -t nssvol VOL /media/nss/NSSV1 -o name=NSSV1