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:
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.
# 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.
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.
# hinv -c tape
Tape drive: unit 2 on SCSI controller 0: DAT
In this example, tapecntlr is 0 and tapeunit is 2.
# 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.
# cp /etc/fstab /etc/fstab.xfs
# vi /etc/fstab.xfs
Make these changes in /etc/fstab.xfs:
efs
with xfs
in the line for the Root filesystem, /, if there is a line for the Root filesystem.
/dev/root / xfs rw,raw=/dev/rroot 0 0
efs
with xfs
in the line for the Usr filesystem.
Inst> sh
# /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.
# /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.
# exit
...
Inst>
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.
>> 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
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.
Inst> sh
# mkdir /backupfs
# mount backupdevice /backupfs
# 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.
# cd /root
# restore rf /backupfs/root.dump
# cd /root/usr
# mt -t /dev/rmt/tpstapecntlrdtapeunit rewind
# restore rf dumpdevice
# cd /root/usr
# restore rf /backupfs/usr.dump
# mv /root/etc/fstab /root/etc/fstab.old
# mv /root/etc/fstab.xfs /root/etc/fstab
# 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.