Web 服务器故障。只读文件系统无文件问题

Web 服务器故障。只读文件系统无文件问题

我有一台 centos 5.5 专用服务器。今天由于某种原因,服务器停止工作。我可以通过 ssh 登录,但 ls 和 find 没有给我文件。我该怎么做才能解决这个问题,或者至少备份我的数据?谢谢!

[root@www server]# touch /home/www/test
touch: cannot touch `/home/www/test': Read-only file system

[root@www server]# ls -l /etc/redhat-release
-rw-r--r-- 1 root root 27 Apr 25  2010 /etc/redhat-release

[root@www server]# ls -l /etc
total 0

[root@www server]# cat /etc/fstab
LABEL=/                 /             ext3    defaults        1 1
LABEL=/boot             /boot         ext3    defaults        1 2 tmpfs     
/dev/shm                tmpfs                 defaults        0 0 devpts            
/dev/pts                devpts                gid=5,mode=620  0 0 sysfs             
/sys                    sysfs                 defaults        0 0 proc              
/proc                   proc                  defaults        0 0 LABEL=SWAP-sda3   
swap                    swap                  pri=0,defaults  0 0 /dev/sdb1                   /hdd1         ext3    defaults        0 0

[root@www server]# /sbin/fdisk -l

Disk /dev/sda: 251.0 GB, 251059544064
bytes 255 heads, 63 sectors/track,
30522 cylinders Units = cylinders of
16065 * 512 = 8225280 bytes

   Device Boot      Start         End     Blocks    Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14       30391   244011285   83  Linux
/dev/sda3           30392       30522     1052257+  82  Linux swap / Solaris

Disk /dev/sdb: 251.0 GB, 251000193024
bytes 255 heads, 63 sectors/track,
30515 cylinders Units = cylinders of
16065 * 512 = 8225280 bytes

   Device Boot      Start         End     Blocks    Id  System

[root@www server]# /sbin/e2label
/dev/sda1 /boot

[root@www server]# /sbin/e2label
/dev/sda2 /sbin/e2label: Bad magic
number in super-block while trying to
open /dev/sda2 Couldn't find valid
filesystem superblock.

[root@www server]# /sbin/e2label
/dev/sda3 /sbin/e2label: Bad magic
number in super-block while trying to
open /dev/sda3 Couldn't find valid
filesystem superblock.

答案1

由于您的文件系统是 RO,您将需要进入救援模式。

fsck -fy -C /dev/sda1

相关内容