今天想试试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 等命令 —— 三思而后行也~~