起初发现网站登录不了,上服务器查看后是 mysql 没有运行,启动出现报错
touch: cannot touch `/var/log/mysqld.log': Read-only file system
chmod: changing permissions of `/var/log/mysqld.log': Read-only file system
chmod: changing permissions of `/var/lib/mysql': Read-only file system
Timeout error occurred trying to start MySQL Daemon.
Starting MySQL: [FAILED]
touch: cannot touch `/var/lock/subsys/mysqld': Read-only file system
尝试创建一个文件也一样,全部文件变只读了。查看 dmseg 有下面的错误
EXT3-fs error (device sda3) in start_transaction: Journal has aborted
系统日志里的错误如下
kernel: EXT3-fs warning (device sda3): ext3_dx_add_entry: Directory index full!
通过搜索,了解到可能是文件系统的 inode 问题,给的方法是删掉一些空文件,但问题就在这里了,全部文件都只读了,删也删不掉。inode 信息如下
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/sda3 19267584 7095876 12171708 37% /
/dev/sda1 26104 40 26064 1% /boot
none 217643 1 217642 1% /dev/shm
硬盘使用如下
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 145G 106G 32G 78% /
/dev/sda1 99M 12M 82M 13% /boot
none 2.0G 0 2.0G 0% /dev/shm
另外还有的说挂载成只读了,我查看是没有的
/dev/sda3 on / type ext3 (rw)
none on /proc type proc (rw)
none on /sys type sysfs (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/sda1 on /boot type ext3 (rw)
none on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
fstab 也有启动挂载的
# This file is edited by fstab-sync - see 'man fstab-sync' for details
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
LABEL=SWAP-sda2 swap swap defaults 0 0
用 smartctl 和 badblocks 检查硬盘没有问题,硬件是 ok 的,应该还是文件系统的问题,并且是挂载在根目录的 sda3 的问题。用 fsck 检查如下
/ contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/: 7095876/19267584 files (0.1% non-contiguous), 28351205/38521861 blocks
其他查看用户、进程、监听的端口和日志,没有发现什么异常。系统用了很多年了,还是 CentOS 4.8,一般很少去动,也几乎没有出现过问题。现在也不敢尝试重启,怕启动不了了。请各位大佬帮忙分析一下,看看可能是什么情况,能否拯救回来,有什么方法解决没有,先谢过了
touch: cannot touch `/var/log/mysqld.log': Read-only file system
chmod: changing permissions of `/var/log/mysqld.log': Read-only file system
chmod: changing permissions of `/var/lib/mysql': Read-only file system
Timeout error occurred trying to start MySQL Daemon.
Starting MySQL: [FAILED]
touch: cannot touch `/var/lock/subsys/mysqld': Read-only file system
尝试创建一个文件也一样,全部文件变只读了。查看 dmseg 有下面的错误
EXT3-fs error (device sda3) in start_transaction: Journal has aborted
系统日志里的错误如下
kernel: EXT3-fs warning (device sda3): ext3_dx_add_entry: Directory index full!
通过搜索,了解到可能是文件系统的 inode 问题,给的方法是删掉一些空文件,但问题就在这里了,全部文件都只读了,删也删不掉。inode 信息如下
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/sda3 19267584 7095876 12171708 37% /
/dev/sda1 26104 40 26064 1% /boot
none 217643 1 217642 1% /dev/shm
硬盘使用如下
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 145G 106G 32G 78% /
/dev/sda1 99M 12M 82M 13% /boot
none 2.0G 0 2.0G 0% /dev/shm
另外还有的说挂载成只读了,我查看是没有的
/dev/sda3 on / type ext3 (rw)
none on /proc type proc (rw)
none on /sys type sysfs (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/sda1 on /boot type ext3 (rw)
none on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
fstab 也有启动挂载的
# This file is edited by fstab-sync - see 'man fstab-sync' for details
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
LABEL=SWAP-sda2 swap swap defaults 0 0
用 smartctl 和 badblocks 检查硬盘没有问题,硬件是 ok 的,应该还是文件系统的问题,并且是挂载在根目录的 sda3 的问题。用 fsck 检查如下
/ contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/: 7095876/19267584 files (0.1% non-contiguous), 28351205/38521861 blocks
其他查看用户、进程、监听的端口和日志,没有发现什么异常。系统用了很多年了,还是 CentOS 4.8,一般很少去动,也几乎没有出现过问题。现在也不敢尝试重启,怕启动不了了。请各位大佬帮忙分析一下,看看可能是什么情况,能否拯救回来,有什么方法解决没有,先谢过了