互联网服务AIXaix 5l

AIX 无法mount /home文件系统以及ssh无法使用

1.无法mount  /home文件系统,尝试fsck,dd 等操作仍然无效,以下是我的操作。。求各位兄第解答!!!!!!!!-bash-3.2# mount /homeReplaying log for /dev/hd1.mount: 0506-324 Cannot mount /dev/hd1 on /home: The media is not formatted or the format is not correct.0506...显示全部
1.无法mount  /home文件系统,尝试fsck,dd 等操作仍然无效,以下是我的操作。。求各位兄第解答!!!!!!!!
-bash-3.2# mount /home
Replaying log for /dev/hd1.
mount: 0506-324 Cannot mount /dev/hd1 on /home: The media is not formatted or the format is not correct.
0506-342 The superblock on /dev/hd1 is dirty.  Run a full fsck to fix.
-bash-3.2# fsck -y home
fsck: 0506-035 home is not a known file system.
-bash-3.2# mount /home
Replaying log for /dev/hd1.
mount: 0506-324 Cannot mount /dev/hd1 on /home: The media is not formatted or the format is not correct.
0506-342 The superblock on /dev/hd1 is dirty.  Run a full fsck to fix.
-bash-3.2# fsck -y /home

The current volume is: /dev/hd1
Primary superblock is valid.
Invalid data detected in aggregate inode 1.
fsck: 0507-278 Cannot continue.
File system is dirty.
-bash-3.2#   
-bash-3.2# dd count=1 bs=4k skip=31 seek=1 if=/dev/hd1 of=/dev/hd1
1+0 records in.
1+0 records out.
-bash-3.2# dd count=1 bs=4k skip=31 seek=8 if=/dev/hd1 0f=/dev/hd1
dd: 0511-056 The command parameter 0f=/dev/hd1 is not correct.
Usage: dd [if=InputFile] [of=OutputFile] [cbs=Number] [fskip=Number]
          [skip=Number] [seek=Number] [count=Number] [bs=Number] [span=yes|no]
          [ibs=Number] [obs=Number] [files=Number] [conv=Parameter[, ...]]
-bash-3.2# dd count=1 bs=4k skip=31 seek=8 if=/dev/hd1 of=/dev/hd1
1+0 records in.
1+0 records out.
-bash-3.2# fsck -p /home

The current volume is: /dev/hd1
fsck: 0507-020 Invalid magic number in the primary superblock.
Secondary superblock is valid.
Primary superblock is corrupt.
(FIXED)
Invalid data detected in aggregate inode 1.
fsck: 0507-278 Cannot continue.
File system is dirty.
-bash-3.2# mount /home
Replaying log for /dev/hd1.
mount: 0506-324 Cannot mount /dev/hd1 on /home: The media is not formatted or the format is not correct.
0506-342 The superblock on /dev/hd1 is dirty.  Run a full fsck to fix.
2.已经安装并启用ssh,CRT无法连接。
启用ssh
-bash-3.2# startsrc -g ssh
0513-029 The sshd Subsystem is already active.
Multiple instances are not supported.
-bash-3.2# lssrc -s sshd
Subsystem         Group            PID          Status
sshd             ssh              463002       active
-bash-3.2# ps -ef |grep sshd
    root 274520 270456   1 13:46:44  pts/2  0:00 grep sshd
    root 463002 127130   0 13:27:51      -  0:00 /usr/sbin/sshd

sshd_config配置文件:
#       $OpenBSD: sshd_config,v 1.81 2009/10/08 14:03:41 markus Exp $
# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options change a
# default value.
#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
# The default requires explicit activation of protocol 1
#Protocol 2
# HostKey for protocol version 1
#HostKey /etc/ssh/ssh_host_key
# HostKeys for protocol version 2
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_dsa_key
# Lifetime and size of ephemeral version 1 server key
#KeyRegenerationInterval 1h
#ServerKeyBits 1024
# Logging
# obsoletes QuietMode and FascistLogging
#SyslogFacility AUTH
#LogLevel INFO
# Authentication:
#LoginGraceTime 2m
#PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10
#RSAAuthentication yes
#PubkeyAuthentication yes
#AuthorizedKeysFile     .ssh/authorized_keys
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#RhostsRSAAuthentication no
# similar for protocol version 2
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes
# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes
#PermitEmptyPasswords no
# Change to no to disable s/key passwords
#ChallengeResponseAuthentication yes
# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no
# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
#UsePAM no
#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
#X11Forwarding no
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#UsePrivilegeSeparation yes
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS yes
#PidFile /var/run/sshd.pid
#MaxStartups 10
#PermitTunnel no
#ChrootDirectory none
# no default banner path
#Banner none
# override default of no subsystems
Subsystem       sftp    /usr/sbin/sftp-server
# Example of overriding settings on a per-user basis
#Match User anoncvs
#       X11Forwarding no
#       AllowTcpForwarding no
#       ForceCommand cvs server收起
参与23

查看其它 21 个回答ap0805503的回答

ap0805503ap0805503软件开发工程师digital china
回复 6# zihan524
是这样做吗?麻烦看一下,我不是很懂。。
-bash-3.2# dd count=1 bs=4k skip=31 seek=8 if=/dev/hd1 of=/dev/hd1
1+0 records in.
1+0 records out.
-bash-3.2# dd count=1 bs=4k skip=31 seek=8 if=/dev/hd1 of=/dev/hd1
1+0 records in.
1+0 records out.
-bash-3.2# fsck -y /home



The current volume is: /dev/hd1
fsck: 0507-020 Invalid magic number in the primary superblock.
fsck: 0507-013 Invalid magic number in the secondary superblock.
Primary superblock is corrupt.
Secondary superblock is corrupt.
fsck: 0507-018 Superblock is corrupt and cannot be repaired.
        Both primary and secondary copies are corrupt. Cannot continue.

在/etc/filesystem里面有
/:
        dev             = /dev/hd4
        vfs             = jfs2
        log             = /dev/hd8
        mount           = automatic
        check           = false
        type            = bootfs
        vol             = root
        free            = true

/home:
        dev             = /dev/hd1
        vfs             = jfs2
        log             = /dev/hd8
        mount           = true
        check           = true
        vol             = /home
        free            = false

/usr:
        dev             = /dev/hd2
        vfs             = jfs2
        log             = /dev/hd8
        mount           = automatic
        check           = false
        type            = bootfs
        vol             = /usr
        free            = false

/var:
        dev             = /dev/hd9var
        vfs             = jfs2
        log             = /dev/hd8
        mount           = automatic
        check           = false
        type            = bootfs
        vol             = /var
        free            = false

/tmp:
        dev             = /dev/hd3
        vfs             = jfs2
        log             = /dev/hd8
        mount           = automatic
        check           = false
        vol             = /tmp
        free            = false

/proc:
        dev       = /proc
        vol       = "/proc"
        mount     = true
        check     = false
        free      = false
        vfs       = procfs

/opt:
        dev             = /dev/hd10opt
        vfs             = jfs2
        log             = /dev/hd8
        mount           = true
        check           = true
        vol             = /opt
        free            = false

/home/oracle:
        dev             = /dev/oralv
        vfs             = jfs2
        log             = /dev/hd8
        mount           = true
        options         = rw
        account         = false
还有一点我很是不解:用df命令hd1,hd8等lv是看不到的,而在lsvg -l rootvg中状态显示open在使用。。。。还有用smit菜单没办法查看和操作文件系统,一按F4就hang住。
bash-3.2# df -k
Filesystem    1024-blocks      Free %Used    Iused %Iused Mounted on
/dev/hd4          2097152   1866260   12%     4202     2% /
/dev/hd2          4194304   2640916   38%    33010     6% /usr
/dev/hd9var       1048576    369280   65%     1478     2% /var
/dev/hd3          5242880   3530776   33%     3559     1% /tmp
/proc                   -         -    -         -     -  /proc
/dev/hd10opt      2097152   2003244    5%     1753     1% /opt
/dev/oralv       10485760   5607152   47%    16788     2% /home/oracle
-bash-3.2# lsvg -l rootvg
rootvg:
LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
hd5                 boot       1       1       1    closed/syncd  N/A
hd6                 paging     16      16      1    open/syncd    N/A
hd8                 jfs2log    1       1       1    open/syncd    N/A
hd4                 jfs2       32      32      1    open/syncd    /
hd2                 jfs2       64      64      1    open/syncd    /usr
hd9var              jfs2       16      16      1    open/syncd    /var
hd3                 jfs2       80      80      1    open/syncd    /tmp
hd1                 jfs2       16      16      1    closed/syncd  /home
hd10opt             jfs2       32      32      1    open/syncd    /opt
oralv               jfs2       160     160     1    open/syncd    /home/oracle
dumplv              sysdump    4       4       1    closed/syncd  N/A
互联网服务 · 2013-03-03
浏览3777

回答者

ap0805503
软件开发工程师digital china
擅长领域: AIX服务器Unix

ap0805503 最近回答过的问题

回答状态

  • 发布时间:2013-03-03
  • 关注会员:1 人
  • 回答浏览:3777
  • X社区推广