Removing the root-Password
with Linux

 General Information

The Situation

You got an SGI, but it has set an unknown root password and you don't have access to IRIX. How to reset the password? Well, the solution that pops to mind is to use a Linux PC, but this is not that simple as it sounds.

Most of this page is due to Owen Marshall, thanks for this great piece of information!


This was written for an Indy. It should work with others as well, but skip the unneeded steps -- if your SGI uses IDE rather than SCSI, for example, ignore the SCSI instructions and replace /dev/sd# with /dev/hd#. You get the point :)

If this fries your data, I am sorry. I offer no warranty or guarantees on these steps.

What you need

You will need:

Step 1: Building the Prerequisites

Configure the Linux kernel. Under the option File Systems, build in support for XFS and EFS. Under File Systems -> Partition Types, select Advanced partition support, then select the SGI partition support. Build in support for your SCSI controller and for SCSI hard disc support. Note that Linux does not neccessarily support every XFS block size that your SGI may use.

Install the XFS utilities.

Reboot with the drive connected. Be sure is detects the drive when it comes back up.

Step 2: Checking Filesystem Type

Run the command

>> xfs_db /dev/sd#

on one of the partitions. They will be under /dev/sd# (sd1, sd2, etc). Watch the output. If nothing but xfs_db is displayed, type:

xfs_db> sb 0
xfs_db> p

Look for this line:

magicnum = 0x58465342

If you see this, type quit and go to the XFS instructions. If you see:

xfs_db: unexpected XFS SB magic number ...

type quit. Important: Go back, and be sure to check all partitions! You may have found a swap partition. If none work as above, go to the EFS instructions.

Step 3: XFS Instructions

Issue the following command (as root):

>> mount -t xfs /dev/sdXX /tmpdir

do this on the working partition you found. /tmpdir is an empty directory. Type dmesg. Look for the following output:

XFS: dirty log written in incompatible format - can't recover
XFS: log mount/recovery failed
XFS: log mount failed

If you see this, put the SCSI hard drive back into the SGI computer. Start up and then CLEANLY shutdown the SGI (if possible). Retry the mount. If it fails, run dmesg again and look for that error. If you see it, run xfs_repair -L /dev/sd#.

W A R N I N G !

xfs_repair -L will zero the XFS log. This may cause the loss of data. I am going to repeat this again, with volume: This may cause the loss of data - specifically, anything that is not written from the journal to disk. Cleanly booting and shutting down the SGI is the key here - this will ensure that all data is written to disk.

If you are concerned, this is what Steve Lord (XFS developer) says: "run xfs_repair -L on it to zero the log... in fact you may have to do this." The log types differ. If you can shutdown and cleanly restart the SGI, zeroing the log will be OK.

After zeroing the log retry to mount the disc. You finally should succeed. Now continue with step 5.

Step 4: EFS Instructions

Issue the following command (as root):

mount -t efs /dev/sdXX /tmpdir

do this on the working partition you found. /tmpdir is an empty directory.

Step 5: Clearing the Password

The password file now is located at /tmpdir/etc/passwd. Read the page for removing the password with IRIX, only with this different password-file location in mind.

Getting Help

Email me if something goes wrong! My email address at spamgourmet (set to accept an unlimited number of mails) is: I will try my best to help you. Best of luck!

Owen Marshall