Check internal HDD from installation USB (X200 with Libreboot with LVM and encryption, including /boot)

4 respuestas [Último envío]
Avron

I am a translator!

Desconectado/a
se unió: 08/18/2020

As my went back to my X200 that was running after finishing lunch, I saw strange errors from Gajim talking about a read only file system and it was impossible to get something working properly, so I decided to reboot. After entering the ciphering password for grub (I have Libreboot with /boot encrypted), I was asked for the ciphering password again (as usual) but I very soon got an (initramfs) prompt and no clue what to do.

I currently have no access to any other personal computer (I have a laptop from my employer running Losedows but I don't want to enter any personal information on it) but I have a Trisquel installation USB.

I can successfully boot on it, the internal HDD is visible in Caja, I can access it with the password. However, I guess I should check errors on the disk but I don't know what to do.

Searching on Trisquel's forum, I found https://trisquel.info/en/forum/check-disk-errors-and-fix-them-encrypted-disk#comment-81508 that said to locate the disk and here is what I get when following the advice:

trisquel@trisquel:/$ sudo blkid | grep mapper
/dev/mapper/luks-a0a6561b-94e3-4e12-a400-e91bb42935db: UUID="q20fYy-vepD-S0Nb-VUR6-wrZG-pxW8-8OP3VF" TYPE="LVM2_member"
/dev/mapper/matrix-rootvol: UUID="ca76e642-5d76-4fcc-9429-d786773da02a" TYPE="ext4"
/dev/mapper/matrix-swap: UUID="cc18b522-b952-4e22-92e4-9301a156f07a" TYPE="swap"
trisquel@trisquel:/$ 

Should I do a check on luks-*** or on matrix-rootvol and what command should I use?

About how I installed Trisquel: I followed https://notabug.org/libreboot/lbwww/src/8844c201ef0d1ab856fed2aa5148b89100fffe0d/site/docs/gnulinux/encrypted_trisquel.md which makes an encrypted /boot partition.

When I did the installation a few months ago, this guide was on the official Libreboot site, otherwise I would not have used it. I understand that most of the things there are redundant with what is explained on Trisquel's website but certainly not how to make an install with an encrypted /boot partition which I think is entirely specific to Libreboot. Without such a guide, no one using Trisquel will install it with an encrypted boot partition.

What is the benefit of having the encrypted boot? Avoid that someone having access to the laptop while it is off can modify the contents of /boot and put some kind of malware that can spy when the system is running again? If so, this is not negligible and I would see the point of maintaining a guide for this. I am willing to spend time on this, but I don't want to misguide people into something that might cause trouble to them, so I would need some competent reviewers.

Magic Banana

I am a member!

I am a translator!

Desconectado/a
se unió: 07/24/2010

After entering the ciphering password for grub (I have Libreboot with /boot encrypted), I was asked for the ciphering password again (as usual) but I very soon got an (initramfs) prompt and no clue what to do.

I believe you should be able to run 'fsck' on the different filesystems. For instance:
# fsck /dev/sda1

If 'fsck' finds something wrong, it will ask you whether to fix the issue. You ca press "y" to answer "yes" or even "a" to always answer "yes".

I guess I should check errors on the disk but I don't know what to do.

You can indeed check the disk itself, the hardware, from Trisquel's live system. One graphical way is

  1. install the package named "gnome-disk-utility", as you would normally (for instance, using the "Synaptic Package Manager", if you like graphical interfaces);
  2. launch GNOME Disks;
  3. select the disk in the left-hand pane
  4. click on "SMART Data & Self-Tests..." in the burger menu (the three stacked segments);
  5. click on the "Start Self-test" button and choose "Extended".

One the test is over, the "Overall Assessment" will tell you whether the disk is healthy.

In fact you could also use GNOME Disks from the live system to check the filesystems.

Avron

I am a translator!

Desconectado/a
se unió: 08/18/2020

Thanks!

Since I have a spare USB SSD with me (holding a copy of data that I don't really need), I installed Trisquel on it and used this installation to do the checks.

I used GNOME disk and the SMART results say the disk is healthy (see attached picture).

When running the file system check, after a rather short time (very short compared with the time it takes for the self-tests), there was a message that the file system needs repair.

When asking for repair, after a similar time, there was a message that repaired failed. I attach the capture of the window. I tried again, after a similar time there was a message saying that it is successful. A further check says the filesystem is ok. There is no detail on what was repaired.

What could be the cause of the file system being corrupted?

What I initially noticed was a number of error messages from Gajim saying a filesystem was read-only. I looked at /var/log/syslog and kernel (also .1) but I can't see any serious error (but perhaps when the error occured nothing could be written to logs anymore).

In general, I am wondering how much I should trust my disk. Perhaps I'd rather change it?

Besides, when running on the internal HDD, there was significant delay when going through MATE menus, while this seems much faster running on the external USB SSD.

Self-test.png filesystem_check.png
Magic Banana

I am a member!

I am a translator!

Desconectado/a
se unió: 07/24/2010

I tried again, after a similar time there was a message saying that it is successful. A further check says the filesystem is ok.

Is your problem solved?

What could be the cause of the file system being corrupted?

A sudden shutdown (because you pressed the button, because of a power cut, etc.) while data is (to be) written.

In general, I am wondering how much I should trust my disk.

Not enough to not regularly backup the user data, but that is always the case.

Perhaps I'd rather change it?

Your disk is apparently healthy. It has not been used much (for less than 25 days). If you still face troubles, you should first try to reformat the partition.

Besides, when running on the internal HDD, there was significant delay when going through MATE menus, while this seems much faster running on the external USB SSD.

You can benchmark its performance with 'sudo hdparm -t [device]' (where [device is probably /dev/sda) in a terminal. Here my HDD reads a little more than 130 MB/sec.

Avron

I am a translator!

Desconectado/a
se unió: 08/18/2020

Is your problem solved?

Yes, booting on the internal disk is fine now, thanks !

A sudden shutdown (because you pressed the button, because of a power cut, etc.) while data is (to be) written.

There was no power cut (battery is full anyway) and I did not press the button, hence why I am worried.

Not enough to not regularly backup the user data

I manually copy important data to an external disk but I occasionally forget, so I'd rather make sure my internal disk is healthy. At home, all my data are on a server that has redundant disks and there are incremental backups every night to a remote location.

If you still face troubles, you should first try to reformat the partition.

Thanks for the advice, I'll see how it goes.

You can benchmark its performance with 'sudo hdparm -t [device]'

It is 70 MB/s approximately.

EDIT: I checked the USB SSD, it is about 35 MB/s, so the system was faster only because less things were running.