Ubuntu 17.10升级/重装异常后的数据恢复求助
Hey there, let's work through this data recovery and system issue step by step—you've hit a rough patch with your Ubuntu setup, but we'll prioritize getting your data safe first.
第一步:进入Ubuntu试用模式访问硬盘
Grab that Ubuntu 17.10 USB installation drive you made, boot from it, and select "Try Ubuntu without installing". This will load a live environment where you can access your computer's hard drive without needing to log into your broken system.
第二步:挂载你的旧Ubuntu分区
- Open the file manager (it's the folder icon on the dock). Look in the left sidebar—you should see your internal hard drive partitions listed. Find the one that was your Ubuntu root partition (it's usually formatted as
ext4and will have a size matching your Ubuntu installation). Click it to mount it automatically. - If you don't see it in the file manager, open a terminal (press
Ctrl+Alt+T) and run:
This will list all your storage devices and partitions. Identify your Ubuntu partition (look for thelsblkTYPE="part"entry with the right size), then mount it manually with:
Replacesudo mount /dev/sdXn /mnt/dev/sdXnwith your partition path (like/dev/sda5for example).
第三步:备份你的重要数据
Once your old partition is mounted, plug in an external storage device (USB drive, external hard drive) and mount it too. Then navigate to /mnt/home/[your-username]/ (replace [your-username] with your actual Ubuntu username) and copy all critical files—documents, photos, downloads, code projects, and any personal config files—to your external drive.
Pro tip: Don't skip this step! Even if we can fix the system later, having a backup ensures you won't lose your data if something goes wrong during repairs.
第四步:修复或重新安装系统(可选,数据已备份后操作)
If you want to get Ubuntu working again after securing your data:
- Try re-running the installer, but this time select "Something else" when asked about installation type. Manually select your existing Ubuntu root partition, set its mount point to
/, and make sure the "Format" box is unchecked (unless you want a fresh start). If you're using UEFI boot, also select your EFI partition (formatted asfat32) and set its mount point to/boot/efi. - If the login loop was the original issue (before the failed install), once you have a working system again, you could check permissions on your home directory with
sudo chown -R $USER:$USER /home/$USERto fix any ownership problems that might cause login failures.
内容的提问来源于stack exchange,提问作者Coma

