Next | Prev | Up | Top | Contents | Index

Converting Filesystems on the System Disk From EFS to XFS

Caution: The procedure in this section can result in the loss of data if it is not performed properly. It is recommendedonly for experienced IRIX system administrators. This section explains the procedure for converting filesystems on the system disk from EFS to XFS. Some systems have two filesystems on the system disk, the Root filesystem (mounted at /) and the Usr filesystem (mounted at /usr). Other systems have a single, combined Root and Usr filesystem mounted at /. This procedure covers both cases but assumes that neither lv nor XLV logical volumes are in use on the system disk. The basic procedure for converting a system disk is:

  1. Load the miniroot.

  2. Do a complete dump of filesystems on the system disk.

  3. Repartition the system disk if necessary.

  4. Create one or two new, empty XFS filesystems.

  5. Restore the files from the filesystem dumps.

  6. Reboot the system.
During this procedure, you can repartition the system disk if needed. For example, you can convert from separate Root and Usr filesystems to a single, combined filesystem, or you can resize partitions to make the root partition larger and the usr partition smaller. See the section "Disk Repartitioning" in this chapter for more information.

The early steps of this procedure ask you to identify the values of various variables, which are used later in the procedure. You may find it helpful to make a list of the variables and values for later reference. Be sure to perform only the steps that apply to your situation. Perform all steps as superuser.

Caution: It is very important to follow this procedure as documented without giving additional inst or shell commands. Unfortunately, deviations from this procedure, even changing to a different directory or going from the inst shell to an inst menu when not directed to, can have very severe consequences from which recovery is difficult.

  1. Review the subsections within the section "Planning for XFS Filesystems" in this chapter to verify that you are ready to begin this procedure.

  2. Verify that your backups are up to date. Because this procedure temporarily removes all files from your system disk, it is important that you have a complete set of backups that have been prepared using your normal backup procedures. You will make a complete dump of the system disk starting at step 11, but you should have your usual backups in addition to the backup made during this procedure.

  3. Use prtvtoc to get the device name of the root disk partition, rootpartition. For example:

    # prtvtoc

    Printing label for root disk

    * /dev/rdsk/dks0d1s0 (bootfile "/unix")

    ...

    The bootfile line contains the raw device name of the root disk partition, which is /dev/rdsk/dks0d1s0 in this example. rootpartition is the block device name, which is /dev/dsk/dks0d1s0 in this example.

  4. If the system disk has separate Root and Usr filesystems, use the output of prtvtoc in the previous step to figure out the device name of the usr partition. This is the value of the variable usrpartition, which is used later in this procedure. Look for the line that shows a mount directory of /usr:
Partition  Type  Fs   Start: sec   (cyl)    Size: sec    (cyl)  Mount Directory
...
6          efs  yes      116725  ( 203)       727950   (1266)   /usr

The usr partition number is shown in the first column of this line; it is 6 in this example. To determine the value of usrpartition, replace the final digit in rootpartition with the usr partition number. For this example, usrpartition is /dev/dsk/dks0d1s6.

  1. If you are using a tape drive as the backup device, use hinv to get the controller and unit numbers (tapecntlr and tapeunit) of the tape drive. For example:

    # hinv -c tape

    Tape drive: unit 2 on SCSI controller 0: DAT

    In this example, tapecntlr is 0 and tapeunit is 2.

  1. If you are using a disk drive as your backup device, use df to get the device name (backupdevice) and mount point (backupfs) of the partition that contains the filesystem where you plan to put the backup. For example:
# df
Filesystem                 Type  blocks     use   avail %use  Mounted on
/dev/root                   efs 1992630  538378 1454252  27%  /
/dev/dsk/dks0d3s7           efs 3826812 1559740 2267072  41%  /disk3
/dev/dsk/dks0d2s7           efs 2004550      23 2004527   0%  /disk2

The filesystem mounted at /disk2 has plenty of disk space for a backup of the system disk (/ uses 538,378 blocks, and /disk2 has 2,004,527 blocks available). The backupdevice for /disk2 is /dev/dsk/dks0d2s7 and the backupfs is /disk2.

  1. Create a temporary copy of /etc/fstab called /etc/fstab.xfs and edit it with your favorite editor. For example:

    # cp /etc/fstab /etc/fstab.xfs

    # vi /etc/fstab.xfs

    Make these changes in /etc/fstab.xfs:

  2. Shut down your workstation using the shutdown command or the "System Shutdown" item on the System toolchest. Answer prompts as appropriate to get to the five-item System Maintenance Menu.

  3. Bring up the miniroot from system software CDs or a software distribution directory.

  4. Switch to the shell prompt in inst:

    Inst> sh

  1. Create a full backup of the Root filesystem by giving this command:

    # /root/sbin/dump 0uCf tapesize dumpdevice rootpartition

    tapesize is the tape capacity (it's used for backup to disks, too) and dumpdevice is the appropriate device name for the tape drive or the name of the file that will contain the dump image. Table 4-1 gives the values of tapesize and dumpdevice for different tape drives and disk. <tapecntlr> and <tapeunit> in Table 4-1 are tapecntlr and tapeunit from step 5 in this section.

    dump Arguments for Filesystem Backup
    Backup Devicetapesize dumpdevice
    Disk2mUse /root/backupfs/root.dump for the Root filesystem and /root/backupfs/usr.dump for the Usr filesystem
    DAT tape2m/dev/rmt/tps<tapecntlr>d<tapeunit>nsv
    DLT tape10m/dev/rmt/tps<tapecntlr>d<tapeunit>nsv
    EXABYTE(TM) 8mm model 8200 tape2m/dev/rmt/tps<tapecntlr>d<tapeunit>nsv
    EXABYTE 8mm model 8500 tape4m/dev/rmt/tps<tapecntlr>d<tapeunit>nsv
    QIC cartridge tape150k/dev/rmt/tps<tapecntlr>d<tapeunit>ns

  2. If Usr is a separate filesystem, insert a new tape (if you are using tape), and create a full backup of the Usr filesystem by giving this command:

    # /root/sbin/dump 0uCf tapesize dumpdevice usrpartition

    tapesize is the tape capacity (it's used for backup to disks, too) and dumpdevice is the appropriate device name for the tape drive or the name of the file that will contain the dump image. Table 4-1 gives the values of tapesize and dumpdevice for different tape drives and disk.

  3. Exit out of the shell:

    # exit

    ...

    Inst>

  4. If you do not need to repartition the system disk, skip to step 18.

  5. To repartition the system disk, use the standalone version of fx. This version of fx is invoked from the Command Monitor, so you must bring up the Command Monitor. To do this, quit out of inst, reboot the system, shut down the system, then request the Command Monitor. An example of this procedure is:
Inst> quit
...
Ready to restart the system.  Restart? { (y)es, (n)o, (sh)ell, (h)elp }: yes
...
login: root
# halt
...
System Maintenance Menu
...
Option? 5
Command Monitor.  Type "exit" to return to the menu.
>>

On systems with a graphical System Maintenance Menu, choose the last option, Enter Command Monitor, instead of choosing option 5.

  1. Boot fx and repartition the system disk so that it meets your needs. The example below shows how to use fx to switch from separate root and usr partitions to a single root partition.
>> boot stand/fx
84032+11488+3024+331696+26176d+4088+6240 entry: 0x89f97610
114208+29264+19536+2817088+60880d+7192+11056 entry: 0x89cd31c0
Currently in safe read-only mode.
Do you require extended mode with all options available? (no) <Enter>
SGI Version 5.3 ARCS   Dec 14, 1994
fx: "device-name" = (dksc) <Enter> 
fx: ctlr# = (0) <Enter>
fx: drive# = (1) <Enter>
...opening dksc(0,1,0)
...controller test...OK
Scsi drive type == SGI     SEAGATE ST31200N8640

----- please choose one (? for help, .. to quit this menu)-----
[exi]t             [d]ebug/           [l]abel/           [a]uto
[b]adblock/        [exe]rcise/        [r]epartition/     [f]ormat
fx> repartition/rootdrive

fx/repartition/rootdrive: type of data partition = (xfs) <Enter>
Warning: you will need to re-install all software and restore user data
from backups after changing the partition layout.  Changing partitions
will cause all data on the drive to be lost.  Be sure you have the drive
backed up if it contains any user data.  Continue? yes

----- please choose one (? for help, .. to quit this menu)-----
[exi]t             [d]ebug/           [l]abel/           [a]uto
[b]adblock/        [exe]rcise/        [r]epartition/     [f]ormat
fx> exit

  1. Load the miniroot again, using the same procedure you used in step 9.

  2. Make an XFS filesystem for Root:
Inst> admin mkfs /dev/dsk/dks0d1s0
Unmounting device "/dev/dsk/dks0d1s0" from directory "/root".

Make new file system on /dev/dsk/dks0d1s0 [yes/no/sh/help]: yes

About to remake (mkfs) file system on: /dev/dsk/dks0d1s0
This will destroy all data on disk partition: /dev/dsk/dks0d1s0.

        Are you sure? [y/n] (n): y

        Do you want an EFS or an XFS filesystem? [efs/xfs]: xfs

        Block size of filesystem 512 or 4096 bytes? 4096

Doing: mkfs -b size=4096 /dev/dsk/dks0d1s0
meta-data=/dev/rdsk/dks0d1s0     isize=256    agcount=8, agsize=31021 blks
data     =                       bsize=4096   blocks=248165
log      =internal log           bsize=4096   blocks=1000
realtime =none                   bsize=4096   blocks=0, rtextents=0
Mounting file systems:

NOTICE: Start mounting filesystem: /root
NOTICE: Ending clean XFS mount for filesystem: /root
    /dev/miniroot            on  /
    /dev/dsk/dks0d1s0        on  /root

Re-initializing installation history database

Reading installation history .. 100% Done.

Checking dependencies .. 100% Done.

  1. Switch to the shell prompt in inst:

    Inst> sh

  2. If you made the backup on disk, create a mount point for the filesystem that contains the backup and mount it:

    # mkdir /backupfs

    # mount backupdevice /backupfs

  3. If you made the backup on tape, restore all files on the Root filesystem from the backup you made in step 11 by putting the correct tape in the tape drive and giving these commands:

    # cd /root

    # mt -t /dev/rmt/tpstapecntlrdtapeunit rewind

    # restore rf dumpdevice

    You may need to be patient while the restore is taking place; it normally doesn't generate any output and it can take a while.

  4. If you made the backup on disk, restore all files on the Root filesystem from the backup you made in step 11 by giving these commands:

    # cd /root

    # restore rf /backupfs/root.dump

  5. If you made a backup of the Usr filesystem in step 12 on tape, restore all files in the backup by putting the correct tape in the tape drive and giving these commands:

    # cd /root/usr

    # mt -t /dev/rmt/tpstapecntlrdtapeunit rewind

    # restore rf dumpdevice

  6. If you made a backup of the Usr filesystem in step 12 on disk, restore all files in the backup by giving these commands:

    # cd /root/usr

    # restore rf /backupfs/usr.dump

  7. Move the new version of /etc/fstab that you created in step 7 into place (the first command, which is optional, saves the old version of /etc/fstab):

    # mv /root/etc/fstab /root/etc/fstab.old

    # mv /root/etc/fstab.xfs /root/etc/fstab

  1. Exit from the shell and inst and restart the system:
# exit
# 
Calculating sizes .. 100% Done.

Inst> quit
...
Ready to restart the system.  Restart? { (y)es, (n)o, (sh)ell, (h)elp }: yes
Preparing to restart system ...

The system is being restarted.


Next | Prev | Up | Top | Contents | Index