今天想試試iscsi構建的FTP,本來想用單機的虛擬機,結果發現有諸多問題,只能依賴兩台Redhat6了,結果在給第二台配置yum的時候,最悲劇、最悲慘、最壯烈的一幕發生了~~~~
安裝好yum(yum的安裝依賴包還真有點多)后,在 /etc/yum.repos.d/ 目錄中存在三個文件。想想單機無需使用外部的yum源,所以這三個文件就不要了——刪之~~~
在這里,我把我的操作過程貼出來:
[root@localhost etc]# vim yum.repos.d/ packagekit-media.repo redhat.repo rhel-source.repo [root@localhost etc]# vim yum.repos.d/redhat.repo [root@localhost etc]# rm -f * rm: cannot remove `abrt': Is a directory rm: cannot remove `acpi': Is a directory rm: cannot remove `alsa': Is a directory rm: cannot remove `alternatives': Is a directory rm: cannot remove `audisp': Is a directory rm: cannot remove `audit': Is a directory rm: cannot remove `avahi': Is a directory rm: cannot remove `bash_completion.d': Is a directory rm: cannot remove `blkid': Is a directory rm: cannot remove `bluetooth': Is a directory rm: cannot remove `bonobo-activation': Is a directory rm: cannot remove `chkconfig.d': Is a directory rm: cannot remove `ConsoleKit': Is a directory rm: cannot remove `cron.d': Is a directory rm: cannot remove `cron.daily': Is a directory rm: cannot remove `cron.hourly': Is a directory rm: cannot remove `cron.monthly': Is a directory rm: cannot remove `cron.weekly': Is a directory rm: cannot remove `dbus-1': Is a directory rm: cannot remove `default': Is a directory rm: cannot remove `depmod.d': Is a directory rm: cannot remove `dhcp': Is a directory rm: cannot remove `dnsmasq.d': Is a directory rm: cannot remove `dracut.conf.d': Is a directory rm: cannot remove `event.d': Is a directory rm: cannot remove `festival': Is a directory rm: cannot remove `fonts': Is a directory rm: cannot remove `gconf': Is a directory rm: cannot remove `gcrypt': Is a directory rm: cannot remove `gdm': Is a directory rm: cannot remove `ghostscript': Is a directory rm: cannot remove `gnome-vfs-2.0': Is a directory rm: cannot remove `gnupg': Is a directory rm: cannot remove `gre.d': Is a directory rm: cannot remove `gtk-2.0': Is a directory rm: cannot remove `hal': Is a directory rm: cannot remove `httpd': Is a directory rm: cannot remove `init': Is a directory rm: cannot remove `iproute2': Is a directory rm: cannot remove `kdump-adv-conf': Is a directory rm: cannot remove `ld.so.conf.d': Is a directory rm: cannot remove `libreport': Is a directory rm: cannot remove `logrotate.d': Is a directory rm: cannot remove `lvm': Is a directory rm: cannot remove `makedev.d': Is a directory rm: cannot remove `modprobe.d': Is a directory rm: cannot remove `NetworkManager': Is a directory rm: cannot remove `ntp': Is a directory rm: cannot remove `obex-data-server': Is a directory rm: cannot remove `openldap': Is a directory rm: cannot remove `opt': Is a directory rm: cannot remove `PackageKit': Is a directory rm: cannot remove `pam.d': Is a directory rm: cannot remove `pango': Is a directory rm: cannot remove `pcmcia': Is a directory rm: cannot remove `pki': Is a directory rm: cannot remove `plymouth': Is a directory rm: cannot remove `pm': Is a directory rm: cannot remove `polkit-1': Is a directory rm: cannot remove `popt.d': Is a directory rm: cannot remove `postfix': Is a directory rm: cannot remove `ppp': Is a directory rm: cannot remove `prelink.conf.d': Is a directory rm: cannot remove `profile.d': Is a directory rm: cannot remove `pulse': Is a directory rm: cannot remove `rc.d': Is a directory rm: cannot remove `rhsm': Is a directory rm: cannot remove `rpm': Is a directory rm: cannot remove `rwtab.d': Is a directory rm: cannot remove `sasl2': Is a directory rm: cannot remove `security': Is a directory rm: cannot remove `selinux': Is a directory rm: cannot remove `setuptool.d': Is a directory rm: cannot remove `sgml': Is a directory rm: cannot remove `skel': Is a directory rm: cannot remove `sound': Is a directory rm: cannot remove `ssh': Is a directory rm: cannot remove `ssl': Is a directory rm: cannot remove `statetab.d': Is a directory rm: cannot remove `sudoers.d': Is a directory rm: cannot remove `sysconfig': Is a directory rm: cannot remove `terminfo': Is a directory rm: cannot remove `udev': Is a directory rm: cannot remove `vmware-tools': Is a directory rm: cannot remove `vsftpd': Is a directory rm: cannot remove `wpa_supplicant': Is a directory rm: cannot remove `X11': Is a directory rm: cannot remove `xdg': Is a directory rm: cannot remove `xinetd.d': Is a directory rm: cannot remove `xml': Is a directory rm: cannot remove `yum': Is a directory rm: cannot remove `yum.repos.d': Is a directory [root@localhost etc]# ls abrt dracut.conf.d NetworkManager sasl2 acpi event.d ntp security alsa festival obex-data-server selinux alternatives fonts openldap setuptool.d audisp gconf opt sgml audit gcrypt PackageKit skel avahi gdm pam.d sound bash_completion.d ghostscript pango ssh blkid gnome-vfs-2.0 pcmcia ssl bluetooth gnupg pki statetab.d bonobo-activation gre.d plymouth sudoers.d chkconfig.d gtk-2.0 pm sysconfig ConsoleKit hal polkit-1 terminfo cron.d httpd popt.d udev cron.daily init postfix vmware-tools cron.hourly iproute2 ppp vsftpd cron.monthly kdump-adv-conf prelink.conf.d wpa_supplicant cron.weekly ld.so.conf.d profile.d X11 dbus-1 libreport pulse xdg default logrotate.d rc.d xinetd.d depmod.d lvm rhsm xml dhcp makedev.d rpm yum dnsmasq.d modprobe.d rwtab.d yum.repos.d
一看到出現“rm: cannot remove `abrt': Is a directory”就呆了~~~~
看看那etc目錄就剩幾個干巴巴的文件夾了,如果要是用 rm -rf *,剩下的就只有那么一個空空的etc了~~
在網上找了找解決辦法,大致也就是數據恢復。一向謹慎的我,居然犯這么低級的錯誤——應該是昨晚洗頭的原因吧~~
預防措施:
1、良好的更改文件的策略:更改文件時先進行備份操作——新建一個bak文件甚至新建一個bak文件夾
2、刪除的文件最好能放在一個臨時的存儲文件夾中,最好找一種類似於放入回收站的程序,並定時清理
3、不能輕易使用 rm -fr 等命令 —— 三思而后行也~~
