Oh for the love of... stupid power outages

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Post Reply
Phicksur
Level 1
Level 1
Posts: 44
Joined: Fri Sep 23, 2016 7:00 pm

Oh for the love of... stupid power outages

Post by Phicksur »

After spending two weeks trying to recover from my user error, I finally got Linux up and running again last night.

Then, after I went to bed, the power went out for long enough to overcome both my UPS.

Now... it's not loading again.

Can someone explain how I should start trying to repair this? Exactly how fragile IS Linux when it comes to unexpected power outages?
User avatar
Pjotr
Level 22
Level 22
Posts: 16234
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland)
Contact:

Re: Oh for the love of... stupid power outages

Post by Pjotr »

Phicksur wrote:Can someone explain how I should start trying to repair this? Exactly how fragile IS Linux when it comes to unexpected power outages?
Generally, Linux can cope with those easily. What filesystem did you select? EXT4 or otherwise?
Tip: 10 things to do after installing Linux Mint 20.1 Ulyssa
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
User avatar
Alexiy
Level 3
Level 3
Posts: 173
Joined: Wed Mar 23, 2016 12:24 pm

Re: Oh for the love of... stupid power outages

Post by Alexiy »

Does your UPS have USB interface?
Phicksur
Level 1
Level 1
Posts: 44
Joined: Fri Sep 23, 2016 7:00 pm

Re: Oh for the love of... stupid power outages

Post by Phicksur »

Pjotr wrote:
Phicksur wrote:Can someone explain how I should start trying to repair this? Exactly how fragile IS Linux when it comes to unexpected power outages?
Generally, Linux can cope with those easily. What filesystem did you select? EXT4 or otherwise?
Ext4
Alexiy wrote:Does your UPS have USB interface?
Possibly, but I don't have a cable for it.
User avatar
Alexiy
Level 3
Level 3
Posts: 173
Joined: Wed Mar 23, 2016 12:24 pm

Re: Oh for the love of... stupid power outages

Post by Alexiy »

I can't help you with fixing the loading problem, but can give you an advice regarding UPS - if it has an USB interface, you should connect it to the computer and configure it to automatically shutdown when the outage happens.
User avatar
Sgthawker
Level 4
Level 4
Posts: 223
Joined: Sun Apr 27, 2014 2:23 am

Re: Oh for the love of... stupid power outages

Post by Sgthawker »

Alexiy wrote:I can't help you with fixing the loading problem, but can give you an advice regarding UPS - if it has an USB interface, you should connect it to the computer and configure it to automatically shutdown when the outage happens.

How does one do this? I presume a linux package, or settings gains access to the ability. Does it work with any brand or model UPS?
LM18.3KDE/LM19.3Cin/Peppermint 10R/Kubuntu19.10 UEFI on Sabertooth Z170 S, i6700K, GTX950, Samsung 970 Pro M.2 NVMe
LM18.3KDE/KDEneon5.18/Leap15.1/Kubuntu20.04/Kubuntu19.10/LMDE 4 UEFI on STRIX laptop, i7700 HQ, GTX 1060, Samsung 970 Pro M.2 NVMe
User avatar
ColonelPanic
Level 1
Level 1
Posts: 9
Joined: Wed Sep 28, 2016 11:44 am

Re: Oh for the love of... stupid power outages

Post by ColonelPanic »

To repair a (probably) damaged filesystem after your power failure, boot your live Mint USB or dvd. Open a terminal ( ctrl-alt-t ).
First run the command

Code: Select all

sudo lsblk -f
to get information about your partitions, so you know which one is your Mint root partition.
If it is /dev/sda2, enter this command to phicks it.

Code: Select all

sudo e2fsck -f -y -v /dev/sda2
currently installed - LM 18 Cinnamon
DanielR
Level 4
Level 4
Posts: 242
Joined: Mon Sep 23, 2013 1:22 pm

Re: Oh for the love of... stupid power outages

Post by DanielR »

Sgthawker wrote:
Alexiy wrote:I can't help you with fixing the loading problem, but can give you an advice regarding UPS - if it has an USB interface, you should connect it to the computer and configure it to automatically shutdown when the outage happens.

How does one do this? I presume a linux package, or settings gains access to the ability. Does it work with any brand or model UPS?
Since you didn't mention your UPS's brand its difficult to tell. For example APC supplies a Linux daemon for most or even all of their UPS, I didn't check too thoroughly, to enable graceful shutdown.
Phicksur
Level 1
Level 1
Posts: 44
Joined: Fri Sep 23, 2016 7:00 pm

Re: Oh for the love of... stupid power outages

Post by Phicksur »

Is there a way to minimize or eliminate the swap file usage, which I am presuming is part of the problem with Linux and power outages?

I mean, I have 16GB of RAM in this thing. I should not really need a swap file unless I am working with something big. I could add 16GB more if I needed to.
User avatar
ColonelPanic
Level 1
Level 1
Posts: 9
Joined: Wed Sep 28, 2016 11:44 am

Re: Oh for the love of... stupid power outages

Post by ColonelPanic »

Phicksur wrote:Is there a way to minimize or eliminate the swap file usage, which I am presuming is part of the problem with Linux and power outages?
I believe Windows uses a swap file. (?)
Linux does not, by default. Linux uses a swap partition, usually.
With 16GB of ram, the probability that your swap partition was being used at the time of power failure is very doubtful - unless you put your OS into hibernation. Did you do that? At that point, everything in ram is written to the swap partition, so you need a 16GB+ swap partition to accomodate hibernation.
If you did not put the OS into hibernation, under normal usage, the swap configuration would not be a factor during a power failure.
The problem with a power failure is in the way linux mounts partitions (file systems). They should be unmounted properly, for maximum safety, otherwise there is the possibility of damage to the filesystem. Your ext4 filesystem is a "journeling" filesystem, which provides an extra margin of safety, but it is not ironclad.
A journaling file system is a file system that keeps track of changes not yet committed to the file system's main part by recording the intentions of such changes in a data structure known as a "journal", which is usually a circular log. In the event of a system crash or power failure, such file systems can be brought back online more quickly with lower likelihood of becoming corrupted.
https://en.wikipedia.org/wiki/Journaling_file_system
currently installed - LM 18 Cinnamon
User avatar
Alexiy
Level 3
Level 3
Posts: 173
Joined: Wed Mar 23, 2016 12:24 pm

Re: Oh for the love of... stupid power outages

Post by Alexiy »

Sgthawker wrote:
Alexiy wrote:I can't help you with fixing the loading problem, but can give you an advice regarding UPS - if it has an USB interface, you should connect it to the computer and configure it to automatically shutdown when the outage happens.

How does one do this? I presume a linux package, or settings gains access to the ability. Does it work with any brand or model UPS?
For APC UPS, the package is apcupsd. For other UPS brands, the package is nut. Configuring UPS to work with Linux is quite tricky for an average user. I have an Eaton UPS, so I used NUT to set it up. There should be tutorials in the internet. I followed a Russian tutorial, but if anyone wants, I can translate it to English.
Naturally, not all UPS are supported. Some of the supported models are listed at http://networkupstools.org/stable-hcl.html, but that info can be out of date. My UPS isn't listed there, but it still works.
User avatar
Sgthawker
Level 4
Level 4
Posts: 223
Joined: Sun Apr 27, 2014 2:23 am

Re: Oh for the love of... stupid power outages

Post by Sgthawker »

Alexiy wrote:For APC UPS, the package is apcupsd. For other UPS brands, the package is nut. Configuring UPS to work with Linux is quite tricky for an average user. I have an Eaton UPS, so I used NUT to set it up. There should be tutorials in the internet. I followed a Russian tutorial, but if anyone wants, I can translate it to English.
Naturally, not all UPS are supported. Some of the supported models are listed at http://networkupstools.org/stable-hcl.html, but that info can be out of date. My UPS isn't listed there, but it still works.
Why thank you good sir!

Do you know whether one is better than the other? I do have an APC Back-UPS XS 1500, and I see it on the NUT list, as well as being able to use the APC UPS daemon.
LM18.3KDE/LM19.3Cin/Peppermint 10R/Kubuntu19.10 UEFI on Sabertooth Z170 S, i6700K, GTX950, Samsung 970 Pro M.2 NVMe
LM18.3KDE/KDEneon5.18/Leap15.1/Kubuntu20.04/Kubuntu19.10/LMDE 4 UEFI on STRIX laptop, i7700 HQ, GTX 1060, Samsung 970 Pro M.2 NVMe
Phicksur
Level 1
Level 1
Posts: 44
Joined: Fri Sep 23, 2016 7:00 pm

Re: Oh for the love of... stupid power outages

Post by Phicksur »

While I appreciate the information on the UPS, can we move it to a new thread, please?

I got the computer to boot up by bypassing the mounting of the RAID array, because it just won't load. Now it won't mount my RAID array even post-bootup. Are those prone to problems with power outages?

I am really coming to hate the Disks utility in Cinnamon. I am deleting that SOB from this computer once this is fixed. I wanted to auto-mount my RAID array but apparently that isn't an option.
User avatar
Sgthawker
Level 4
Level 4
Posts: 223
Joined: Sun Apr 27, 2014 2:23 am

Re: Oh for the love of... stupid power outages

Post by Sgthawker »

Phicksur, my apologies good sir, I thought the info might be relevant to yourself as well as other readers, especially because you responded to UPS comments above. Good luck chasing down your actual issue!
LM18.3KDE/LM19.3Cin/Peppermint 10R/Kubuntu19.10 UEFI on Sabertooth Z170 S, i6700K, GTX950, Samsung 970 Pro M.2 NVMe
LM18.3KDE/KDEneon5.18/Leap15.1/Kubuntu20.04/Kubuntu19.10/LMDE 4 UEFI on STRIX laptop, i7700 HQ, GTX 1060, Samsung 970 Pro M.2 NVMe
Phicksur
Level 1
Level 1
Posts: 44
Joined: Fri Sep 23, 2016 7:00 pm

Re: Oh for the love of... stupid power outages

Post by Phicksur »

Ok, I have attacked this problem multiple ways and I think I have identified the problem, and have no idea how to fix it in Linux (I don't know the commands).

My belief is that the RAID5 Array didn't properly 'unmount' when the power went out. As a result, it still believes it is mounted and won't allow any of the OS's to connect to it: neither Windows nor Linux are able to connect to the device (they can see it, but cannot assign a drive letter or mount it for file access).

So, how do I go about unmounting it, or making it visible to the other OSs? Additionally, is there a way to mount it that will make it more resilient to power outages?
User avatar
Sgthawker
Level 4
Level 4
Posts: 223
Joined: Sun Apr 27, 2014 2:23 am

Re: Oh for the love of... stupid power outages

Post by Sgthawker »

Depending on your BIOS/UEFI, there is a tool to build or delete an array, is there not also a repair tool for recovering said array? I don't know if there is a way to save the data via this option. I have seen that AMD and Intel chipsets have a RAID tool that you can install in a Windows environment that has similar tools for working with an array even without a drive letter assigned.
LM18.3KDE/LM19.3Cin/Peppermint 10R/Kubuntu19.10 UEFI on Sabertooth Z170 S, i6700K, GTX950, Samsung 970 Pro M.2 NVMe
LM18.3KDE/KDEneon5.18/Leap15.1/Kubuntu20.04/Kubuntu19.10/LMDE 4 UEFI on STRIX laptop, i7700 HQ, GTX 1060, Samsung 970 Pro M.2 NVMe
Phicksur
Level 1
Level 1
Posts: 44
Joined: Fri Sep 23, 2016 7:00 pm

Re: Oh for the love of... stupid power outages

Post by Phicksur »

Apparently RAID arrays don't like being auto-loaded under Linux.

When I shut down 'mount on startup' I am able to connect fine. Well, strike that, it won't let me read the data. It says something about 'bad bit' or something.



Any way I can set up a batch file (or whatever Linux equivalency) to execute upon login to automatically mount it?
Post Reply

Return to “Installation & Boot”