V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
asxaqz
V2EX  ›  Linux

/sbin/init 和 /sbin/shutdown 消失

  •  
  •   asxaqz ·
    Zardinality · 2016-07-28 15:46:51 +08:00 · 4128 次点击
    这是一个创建于 2801 天前的主题,其中的信息可能已经有所发展或是发生改变。
    发行版是 linux mint 17.3
    昨天装了个有道词典, deb 要求版本 14.10 以上,但我没管,直接放那儿安装了所有依赖。
    晚上忙完关机的时候已经关不掉了,但是急着睡觉,就按了电源。
    今天早上发现 /sbin/init 和 /sbin/shutdown 都消失,当然启动不起来,于是进 livecd 拖了 里面的 init 和 shutdown 进去,重启之后卡 logo 。
    又进 livecd 里挂载上系统盘, chroot 进去,卸载了 youdaodict 。
    也没有效果。

    诸位有什么办法吗?谢谢!
    以后再也不手贱了。
    第 1 条附言  ·  2016-07-29 12:37:41 +08:00
    谢谢大家帮助,已经搞定了。 livecd chroot 进去,挂载上 /boot, /dev, /sys, /pts, /boot, 然后 mint-update 到最新版。代价是上了一个大版本,目前还没发现有东西不 work 。
    22 条回复    2016-07-29 03:23:37 +08:00
    MuyuQ
        1
    MuyuQ  
       2016-07-28 16:31:28 +08:00
    绝对路径也无效么。
    asxaqz
        2
    asxaqz  
    OP
       2016-07-28 16:34:22 +08:00
    @MuyuQ 是指 /sbin/init 和 /sbin/shutdown 的绝对路径吗?我进 livecd 挂载上看了, init 和 shutdown 确实消失了。
    lslqtz
        3
    lslqtz  
       2016-07-28 16:43:55 +08:00
    删除了整个 /usr/bin 的表示 :(
    希望你能搞定
    Mithrandir
        4
    Mithrandir  
       2016-07-28 16:49:55 +08:00
    直接重装,这次就当时教训了,安装软件的时候一定要好好看看安装程序都有那些提示, linux 不像 windows ,不会在安装过程中给你输出一些没用的信息
    MuyuQ
        5
    MuyuQ  
       2016-07-28 17:02:53 +08:00
    看日志吧。 丢失的不一定只有 init 和 shutdown 。 http://h2appy.blog.51cto.com/609721/781281/
    asxaqz
        6
    asxaqz  
    OP
       2016-07-28 18:51:07 +08:00 via Android
    @lslqtz .._:(´_`」 ∠):_ …
    asxaqz
        7
    asxaqz  
    OP
       2016-07-28 18:54:12 +08:00 via Android
    @Mithrandir 多谢,顺便一问,我直接 apt-get dist-update 到最新版会有效吗
    asxaqz
        8
    asxaqz  
    OP
       2016-07-28 18:54:24 +08:00 via Android
    @MuyuQ 谢谢!
    xss
        9
    xss  
       2016-07-28 22:34:01 +08:00   ❤️ 1
    应该是安装依赖的时候有冲突把 initrd 给卸载了,你查查你的发行版本里面 initrd 叫什么,强制重新安装一遍看看。
    congeec
        10
    congeec  
       2016-07-28 22:43:24 +08:00
    .................我猜是装了 systemd, 卸了 init.d 什么的
    我在 Gentoo 上干过这种事而
    asxaqz
        11
    asxaqz  
    OP
       2016-07-28 22:57:00 +08:00
    @congeec my init.d seems intact, it contains a bunch of files, but i wonder how u manage to get over it ? thanks. (im replying on livecd which lacks a chinese input method, sorry about it
    congeec
        12
    congeec  
       2016-07-28 23:06:00 +08:00
    @asxaqz I'm fine with English. What I did was to download a net-bootable image, chroot into the original broken system, rebuiding and installing missing packages, and most importantly, ran Gentoo's depency-checking tool: rev-rebuild.
    congeec
        13
    congeec  
       2016-07-28 23:08:25 +08:00   ❤️ 1
    @asxaqz If I am right, you can use dpkg on Debian derivied systems to determine which package does /sbin/init belong to.

    You can pull a full-iso, make a directory comparison and copy the missing files.
    asxaqz
        14
    asxaqz  
    OP
       2016-07-28 23:20:54 +08:00
    @congeec thanks, i will try it, but there are really tons of them contributing to /sbin/init
    asxaqz
        15
    asxaqz  
    OP
       2016-07-28 23:25:13 +08:00
    @xss i suppose u mean initramfs? just check my dpkg.log, and find i did upgrade some package about initramfs, i will try to reinstall them, thanks
    congeec
        16
    congeec  
       2016-07-28 23:29:18 +08:00
    @asxaqz My suggestion is that you'd better figure out what does your missing /sbin/init belong to. sysvinit or systemd? If you can figure it out, repairing your inti system (sysvinit or systemd) is the best way.
    asxaqz
        17
    asxaqz  
    OP
       2016-07-28 23:45:34 +08:00
    @congeec oh i see, i just used dpkg -S to check the the /sbin/init of the original livecd, it turns out to belong to upstart, and i happened to do an upgrade to it last night. i try to reinstall it but it seems that i have to uninstall some core-package to resolve the dependency. now im not sure if i should do it
    congeec
        18
    congeec  
       2016-07-28 23:51:54 +08:00
    @asxaqz Backup your data. Try to reinstall these core-package, remember to make a record of the packages you will uninstall.
    BACKUP YOUR DATA
    msg7086
        19
    msg7086  
       2016-07-28 23:55:00 +08:00
    人家没中文输入法不代表读不懂中文啊……为啥全程英语回复了。
    shiny
        20
    shiny  
       2016-07-28 23:58:20 +08:00
    @msg7086 这就叫萌萌哒
    asxaqz
        21
    asxaqz  
    OP
       2016-07-29 00:13:48 +08:00
    @congeec many many thanks
    okudayukiko0
        22
    okudayukiko0  
       2016-07-29 03:23:37 +08:00 via Android
    重新安装 systemd
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2825 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 14:35 · PVG 22:35 · LAX 07:35 · JFK 10:35
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.