linux 伺服器忽然變成唯讀檔案系統

來源:互聯網
上載者:User

周海漢 /文

2010.4.26

 

以root帳號往一台伺服器的/root傳檔案時,告訴我是唯讀檔案系統。搞的我一頭霧水。好好的系統怎麼變成唯讀檔案系統了呢?

zhouhh@zhh64:~$ scp myfile serv:.
root@210.211.225.188's password:
scp: ./myfile: Read-only file system

登上去一看:

-bash-3.2# pwd
/root

-bash-3.2# ls
CentOS                 RELEASE-NOTES-en          RELEASE-NOTES-nl
EULA                   RELEASE-NOTES-en.html     RELEASE-NOTES-nl.html
GPL                    RELEASE-NOTES-en_US       RELEASE-NOTES-pt_BR
...

-bash-3.2# cat /etc/redhat-release
CentOS release 5.2 (Final)

-bash-3.2# rm RE* -f
rm: 無法刪除 “RELEASE-NOTES-cs”: 唯讀檔案系統
rm: 無法刪除 “RELEASE-NOTES-cs.html”: 唯讀檔案系統
rm: 無法刪除 “RELEASE-NOTES-de”: 唯讀檔案系統
...

-bash-3.2# touch a
touch: 無法觸碰 “a”: 唯讀檔案系統

-bash-3.2# df -h
檔案系統              容量  已用 可用 已用% 掛載點
/dev/mapper/VolGroup00-LogVol00
                       65G  9.8G   52G  16% /
/dev/sda1              99M   19M   75M  21% /boot
tmpfs                 948M     0  948M   0% /dev/shm
CentOS_5.2_Final.iso  3.8G  3.8G     0 100% /root
CentOS_5.2_Final.iso  3.8G  3.8G     0 100% /root

奇怪,root下怎麼是兩個iso?

 

-bash-3.2# mount
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
CentOS_5.2_Final.iso on /root type iso9660 (rw,loop=/dev/loop0)
CentOS_5.2_Final.iso on /root type iso9660 (rw,loop=/dev/loop1)

看到檔案系統本身倒都是rw,並不是ro.

但iso檔案肯定是唯讀。

 

嘗試umount

-bash-3.2# umount CentOS_5.2_Final.iso
umount: /root: device is busy
裝置忙,卸載不了。

網上找到umount -l參數可以處理這種情況。但man umount並沒有該參數說明。man mount說-l參數是list label。沒搞明白為何可以卸載繁忙的裝置。

嘗試一下:

-bash-3.2# umount -l CentOS_5.2_Final.iso

成功了!

-bash-3.2# umount -l CentOS_5.2_Final.iso
-bash-3.2# mount
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
-bash-3.2# cd /root
-bash-3.2# touch a

成功。

 

奇怪系統好好的怎麼被mount上一個iso呢?而且用法奇特。inittab上面沒有mount該檔案的命令, 難道被入侵了?

看/var/log/secure並無痕迹。

後來發現系統多了一個nagios,想起密碼給過某營運同事,他來安裝nagios。估計是他進行這麼奇怪的mount了。

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.