0

I have a desktop with Ubuntu 18.04 installed which hadn't been used for a few months and when I powered it up it no longer logs in to the ubuntu desktop GUI. It brings me instead to a terminal that looks like this:

terminal screen

I'm able to log in but seemingly have no access to internet (when booting from a live USB version I have internet access). After a bit of research I tried running the boot-repair tool from a USB version of ubuntu, but it didn't solve the issue. The summary is linked below:

boot-repair summary

There are 3 separate users that have data on the machine (so ideally don't want to have to reinstall Ubuntu from scratch) and I'm not sure whether something was installed by one of the users as it's been a few months since anyone's logged on with it.

Thanks in advance for any help and let me know if you need more information!

Cheers, Ben

1 Answer 1

0

It sounds like its running on an SSD and data got lost/corrupted from being offline for too long. This happens more often on aged SSDs or if the device got stored at >= 40° C.

Offline SSD data retention are abysmally bad given unlucky conditions or if the SSD is old (the table describes data retention for new drives).

enter image description here

There's likely going to be error reports in SMART. You can check them with sudo smartctl -a /dev/sda. If you don't know how to interpret those values you can post them here.

If I'm right, the only advise I can tell is to plug the disk on another computer (or boot from liveusb) try to save as much data as possible and full format that drive unless SMART says that disk is dying hard.

To format such a drive you will have to first do (WARNING THIS WILL WIPE ALL OF THE DISK's CONTENTS):

sudo blkdiscard /dev/sda

And then perform a security erase via hdparm. Be sure to read the whole wiki before proceeding, and that you've read all the disclaimers. I recommend you first google your SSD model to see if others have already tried to use hdparm's security erase on your model to double check it won't be bricked.

If you have doubts then only execute blkdiscard and then format the entire disk via GPart.

  • Note: I've been assuming your SSD lives in /dev/sda. If your disk is for example NVMe, it may live in e.g. /dev/nvme0n1

Small update

Assuming I'm right about all this, then just give up in trying to get that Ubuntu installation working again without formatting; and this became a disk rescue operation.

What I'd recommend is to first (from another machine or liveusb) backup the whole disk via dd into another disk (with sda unmounted):

sudo dd dd if=/dev/sda of=somewhere.raw bs=32M

And after you've run that command, run:

sudo fsck -vfn /dev/sda

With luck, many of the lost files will be in lost+found after that command.

If that doesn't do, then you may want to run a hex editor or "undelete" programs to try to rescue raw data from the disk.

Which is basically what forensics do to recover data from damaged disks.

4
  • Is there any source or reference for the table you are showing about "Data Retention Time"? How can it depend on "Power Off Temperature" and "Active Temperature" at the same time?
    – Sebastian
    Apr 28, 2022 at 21:10
  • Hi Matias, thanks a lot for your answer. Having checked with all other users of the desktop it turns out there's no essential data still on there that hasn't been backed up, so I'll probably go for the full format/reinstall option. I've been looking into blkdiscard and trying to understand why it's needed. Would a format/reinstall through the linux live usb not be enough? Apr 29, 2022 at 15:33
  • Hi! blkdiscard tells to TRIM the entire disk. This tells the firmware all of the cells in the disks can be garbage collected and reused. Otherwise when you format a drive, the OS will think it's empty but your disk's firmware will think some of the flash cells are still in use and its contents must be preserved. The TRIM command tells the firmware the contents of all the flash cells are no longer needed. Apr 29, 2022 at 17:37
  • Hi Matias, thanks again! We'll do a blkdiscard before we format and reinstall. Cheers! May 3, 2022 at 10:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .