Distributions
› Ubuntu
› Fedora
› CentOS
中文资源站
› 网易开源镜像站
yagamil
V2EX  ›  Linux

ubuntu 如何修复重装, 把系统文件重装,然后原来个人的文件夹不会被格式化?

  •  
  •   yagamil · Jan 31, 2021 · 3163 views
    This topic created in 2118 days ago, the information mentioned may be changed or developed.
    ubuntu 系统因为 n 卡驱动和系统一些配置问题导致经常 xorg 挂掉,想要重装 系统,但是由于里面太多个人文件和和代码,不方便迁移备份. 以前装的时候试过分区,不过由于是双系统,分区后总是无法启动,导致全部数据在 /home/user 下面

    ubuntu 如何修复重装, 把系统文件重装,然后原来个人的文件夹不会被格式化?
    11 replies  •  2021-02-09 14:53:02 +08:00
    qanniu
    qanniu
    Jan 31, 2021
    1
    满足如下条件不会:
    1. 原来的家目录单独分区
    2. 新系统用户名不变,分区不变,密码不变。
    yagamil
    yagamil
    OP
    Jan 31, 2021
    2
    @qanniu,谢大佬。看来第一个满足,第二个只要我重装后设置玩用户名后把家目录加载进来?
    qanniu
    qanniu
    Jan 31, 2021
    3
    @yagamil 应该是安装过程就配置家目录为你的原来的分区
    yagamil
    yagamil
    OP
    Jan 31, 2021
    4
    @qanniu 好的,谢谢
    basefas
    basefas
    Jan 31, 2021
    5
    建议无论怎么操作,在操作之前都要把重要资料备份一份
    yagamil
    yagamil
    OP
    Jan 31, 2021
    6
    准备按照老外的来操作

    Boot using live bootable usb
    take backup or your data ( just in case if something goes wrong )
    first try to re-install Ubuntu
    if re-installation doesn’t work
    delete all directories from ubuntu root except /etc/ and /home/ then install ubuntu
    While entering username and password enter username and password same as old ones
    reboot and see if it works
    If 5 steps doesn’t work then re-install completely and restore from backup
    Kiske
    Kiske
    Jan 31, 2021
    7
    /home/user 是单独挂载的吗
    重装的时候选择手动分区,正常会分一个 EIF 和 一个 ext4 挂载到 /,
    而如果你还有一个 ext4 挂载到了 home,注意[不要勾选上格式化],仍然选择挂载给 home,重装时就能保留 home
    taobibi
    taobibi
    Jan 31, 2021
    8
    我们公司因为数据库是分离的。所以没有数据库这方面的困扰。
    我们原来的部署都有批处理脚本,一键备份还原那种
    特别实用。如果楼主不是那种 24 小时在线的服务,凌晨停机导数据,也不是很麻烦,我们小物流公司就是这么操作的
    libook
    libook
    Feb 1, 2021
    9
    重装的时候最干净的方式就是直接把系统分区(或系统磁盘)格式化,这样的话就需要你的 home 目录的数据在其他分区(或磁盘)上。如果满足这个条件了,那就非常好办了,你可以装系统的时候设置吧 home 分区挂载到 /home 路径上,也可以装完系统后,直接用软链接( ln -s )把 /home 链接到你的实际 home 目录上。
    毕竟是重装系统,为了数据安全的考虑,还是建议备份。
    AoEiuV020
    AoEiuV020
    Feb 1, 2021
    10
    我整个 home 加上其他 sdk 和代码啥的都是 mount bind 方式挂载到一个数据分区的,系统分区只给 10G,啥都尽量不装里面,
    CoreJa
    CoreJa
    Feb 9, 2021
    11
    只要你 /home 是挂在单独的分区,安装的时候把这个分区挂在 /home 下(不要格式化)就可以,当然用户名要和 /home 下的用户名保持一致
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   937 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 58ms · UTC 20:36 · PVG 04:36 · LAX 12:36 · JFK 15:36
    ♥ Do have faith in what you're doing.