不知何故,我的Debian只能在根文件系统中进行读取。我不知道这怎么可能发生。
例如,当我在/root
文件夹中并键入command nano
,然后按Tab列出该文件夹中可能的文件时,我得到消息:
root@debian:~# nano -bash: cannot create temp file for here-document: Read-only file system
cd
当我键入cd /home
并按下Tab以列出路径时,该命令也是如此:
root@debian:~# cd /home -bash: cannot create temp file for here-document: Read-only file system
我也有像apt
其他软件一样的问题。甚至无法获得更新。我有很多这样的错误:
Err http ://ftp.de.debian.org wheezy-updates/main Sources
406 Not Acceptable
W: Not using locking for read only lock file /var/lib/apt/lists/lock
W: Failed to fetch http ://ftp.de.debian.org/debian/dists/wheezy/Release rename failed, Read-only file system (/var/lib/apt/lists/ftp.de.debian.org_debian_dists_wheezy_Release -> /var/lib/apt/lists/ftp.de.debian.org_debian_dists_wheezy_Release).
W: Failed to fetch http ://security.debian.org/dists/wheezy/updates/main/source/Sources 404 Not Found
W: Failed to fetch http ://security.debian.org/dists/wheezy/updates/main/binary-amd64/Packages 404 Not Found
W: Failed to fetch http ://ftp.de.debian.org/debian/dists/wheezy-updates/main/source/Sources 406 Not Acceptable
E: Some index files failed to download. They have been ignored, or old ones used instead.
W: Not using locking for read only lock file /var/lib/dpkg/lock
我的系统有很多问题。有可能解决这个问题吗?如何检查发生了什么?我应该在日志中寻找什么?
我知道可能是由于/etc/fstab
文件中的行:
/dev/mapper/debian-root / ext4 errors=remount-ro 0 1
但是有什么问题呢?我什么也找不到,或者也许我不知道在哪里看。
编辑:
我没有搜索邮件日志,却发现只有以下内容:
kernel: [ 5.709326] EXT4-fs (dm-0): re-mounted. Opts: (null)
kernel: [ 5.977131] EXT4-fs (dm-0): re-mounted. Opts: errors=remount-ro
kernel: [ 7.174856] EXT4-fs (dm-2): mounted filesystem with ordered data mode. Opts: (null)
我想这是正确的,因为在其他debian机器上我有相同的条目。
我在dmesg中找到了一些东西(由于标准ext4的东西很多,我削减了输出)
root@gs3-svn:/# dmesg |grep ext4
EXT4-fs error (device dm-0) in ext4_reserve_inode_write:4507: Journal has aborted
EXT4-fs error (device dm-0) in ext4_reserve_inode_write:4507: Journal has aborted
EXT4-fs error (device dm-0) in ext4_dirty_inode:4634: Journal has aborted
EXT4-fs error (device dm-0): ext4_discard_preallocations:3894: comm rsyslogd: Error loading buddy information for 1
EXT4-fs warning (device dm-0): ext4_end_bio:250: I/O error -5 writing to inode 133130 (offset 132726784 size 8192 starting block 159380)
EXT4-fs error (device dm-0): ext4_journal_start_sb:327: Detected aborted journal
5个错误和1个警告。有任何想法吗?使用mount -o remount,rw /安全吗?
df
/var/log/messages
。如果文件系统已损坏,则应在引导过程中的早期内核消息中看到它。另外,请尝试mount -o remount,rw /dev/mapper/debian-root
告诉我们是否会引发错误。