http://cn.opensuse.org/%E5%A6%82%E4%BD%95%E6%B8%85%E7%A9%BA_root_%E5%AF%86%E7%A0%81
用 SuSE Linux Rescue Mode 恢复超级用户口令
<a></a>
SUSE LINUX contains a rescue system for accessing your Linux partitions from
the outside in the event of an emergency. The rescue system can be loaded
from CD, the network, or the SUSE FTP server. The rescue system includes
several help programs with which you can remedy large problems with
inaccessible hard disks, misconfigured configuration files, or other similar
problems.
Another component of the rescue system is Parted,
which is used for resizing partitions. This program can be launched
from within the rescue system, if you do not want to use
the resizer integrated in YaST. Information about
.
Boot your system as you would for installation. Select ‘Rescue
System
’
from the boot menu. The rescue system is then
decompressed, loaded onto a RAM disk as a new root file system, mounted, and
started.
Under Alt
-F1
to
Alt
-F3
, the rescue
system provides three virtual consoles.
You can log in as <code>root</code>
without a password. Press Alt
-F10
to enter the system console displaying the kernel and
syslog messages.
A shell and many other useful utilities, such as the
mount program, can be found in the
<code>/bin</code>
directory. The <code>sbin</code>
directory contains important file and network utilities for
reviewing and repairing the file system, including
reiserfsck and
e2fsck.
This directory also contains the most important binaries for system
maintenance, such as fdisk, mkfs, mkswap, mount, mount,
init, and shutdown, and ifconfig,
route, and netstat for
maintaining the network.
The directory <code>/usr/bin</code>
contains the
vi editor, grep,
find, less,
and telnet.
To mount your SUSE LINUX system using the rescue system, use the mount
point <code>/mnt</code>
. You can also use or create another
directory.
The following example demonstrates the procedure for
a system with the <code>/etc/fstab</code>
details
Example 5.1. Example /etc/fstab

Warning
Pay attention to the order of steps outlined in the following section for
mounting the various devices.
To access your entire system, mount it step by step in the
<code>/mnt</code>
directory using the following commands:
Now, access your entire system and, for example, correct mistakes
in configuration files, such as <code>/etc/fstab</code>
,
<code>/etc/passwd</code>
, and
<code>/etc/inittab</code>
. The configuration files are now located
in the <code>/mnt/etc</code>
directory instead of in
<code>/etc</code>
Before recovering lost partitions with the
fdisk program by simply
setting them up again,
make a printout of <code>/etc/fstab</code>
and the output of fdisk -l
Damaged file systems are tricky problems for the rescue system.
Generally, file systems cannot be repaired on a running
system. If you encounter serious problems, you may not even be able
to mount your root file system and the system boot may end with
<code>kernel panic</code>
. In this case, the
only way is to repair the system from the outside
using a rescue system.
The SUSE LINUX rescue system contains the utilities
reiserfsck,
e2fsck, and dumpe2fs
(for diagnosis). These should remedy most problems.
In an emergency, man pages often are not available. For this
reason, they are
If mounting an <code>ext2</code>
file system fails due to an
invalid
superblock, the e2fsck program would probably
fail, too. If this were the case, your superblock may be corrupted, too.
There are copies of the superblock located every 8192 blocks (8193, 16385,
etc.). If your superblock is corrupted, try one of the copies instead. This
is accomplished by entering the command e2fsck -f -b 8193
/dev/damaged_partition
. The -f
option forces
the file system check and overrides e2fsck's
error so that, because the superblock copy is intact, everything is fine.