Author Topic: Frequent crashing of 18.04 <resolved>  (Read 2344 times)

0 Members and 1 Guest are viewing this topic.

Offline SeZo

  • Hero Member
  • *****
  • Posts: 1864
  • Karma: 145
  • Gender: Male
    • View Profile
    • Awards
Re: Frequent crashing of 18.04
« Reply #15 on: July 27, 2021, 08:22:14 am »
run fsck from a Live-CD/Live-USB
Identify partitions

Code: [Select]
sudo fdisk -l

Make sure they are unmounted:

Code: [Select]
for n in /dev/sda* ; do umount $n ; done

then run fsck on them (substitute X to suit):

Code: [Select]
e2fsck /dev/sdaX

Offline RATTLEBACK.131

  • Jr. Member
  • **
  • Posts: 83
  • Karma: 1
  • I've just joined!
    • View Profile
    • Awards
Re: Frequent crashing of 18.04
« Reply #16 on: July 27, 2021, 01:06:01 pm »
Good try but fell at the 1st hurdle.

Is the 1st command '-1' (numeral one). if so I get ; invalid option --'1'

if not what is it? - problem my keyboard has reverted to some strange US configuration so the shifted keys aren't as physically shown anymore.

The Linux Community Forum

Re: Frequent crashing of 18.04
« Reply #16 on: July 27, 2021, 01:06:01 pm »

Offline Keith

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1493
  • Karma: 20
  • Gender: Male
  • Linux Novice
    • View Profile
    • Awards
Re: Frequent crashing of 18.04
« Reply #17 on: July 27, 2021, 01:08:30 pm »
The "l" is a lower-case "L" and is the "long" option that displays lots of info about each file on a separate line. 

I am not very familiar with Mint, but you should find in your menus some way of choosing the right keyboard layout. 

Keith
« Last Edit: July 27, 2021, 01:17:24 pm by Keith »

Offline RATTLEBACK.131

  • Jr. Member
  • **
  • Posts: 83
  • Karma: 1
  • I've just joined!
    • View Profile
    • Awards
Re: Frequent crashing of 18.04
« Reply #18 on: July 27, 2021, 06:51:48 pm »
Thanks. My brain does this sort of crap all day everyday, it's very wearing.

Results of fdisk l :

/dev/sda1   is EFI system
/dev/sda2   is Linux file system [problem one]

next command 'for n in /dev/sda*'etc returned :
> [flashing cursor which stopped flashing]

then e2fsch /dev/sda2 returned :
bash : syntax error near unexpected token 'e2fsck'  [& back to usual $ prompt]

Did I make any mistakes ?

Offline SeZo

  • Hero Member
  • *****
  • Posts: 1864
  • Karma: 145
  • Gender: Male
    • View Profile
    • Awards
Re: Frequent crashing of 18.04
« Reply #19 on: July 27, 2021, 08:53:09 pm »
Do not know if you made any mistakes but here it is again:
Is your partition ext2/3/4?
Make sure none of the disks in question are mounted first.
Try with sudo
Code: [Select]
sudo e2fsck /dev/sda2
« Last Edit: July 27, 2021, 08:54:47 pm by SeZo »

The Linux Community Forum

Re: Frequent crashing of 18.04
« Reply #19 on: July 27, 2021, 08:53:09 pm »

Offline RATTLEBACK.131

  • Jr. Member
  • **
  • Posts: 83
  • Karma: 1
  • I've just joined!
    • View Profile
    • Awards
Re: Frequent crashing of 18.04
« Reply #20 on: July 28, 2021, 02:55:49 pm »
I seem to have some brain energy available today, yay!

1stly fdisk doesn't show me the partition ext No.
I tried looking up how to find that & ended up using [sudo] file -sl command. with 'sudo' result was :
sudo : unable to execute /usr/bin/file/: input/output error

without 'sudo' result was :
bash : /usr/bin/file/: input/output error

2ndly I found I had made a mistake last time with the command 'for n in /dev/sda*'etc - I'd used : 's instead of ; 's.
Doing it right gives result :
umount : /dev/sda : not mounted.
umount : /dev/sda1 : not mounted.
umount : /dev/sda2 : not mounted.

Now when I run 'e2fsck /dev/sda2 ' I get :
Segmentation fault

I reran everything from the 'for n...etc' unmounting command but used 'sudo' for the e2fsck. The result is :
Segmentation fault (core dumped)

I have to say that doesn't look very encouraging.  :'(
Peoples thoughts please.

Offline SeZo

  • Hero Member
  • *****
  • Posts: 1864
  • Karma: 145
  • Gender: Male
    • View Profile
    • Awards
Re: Frequent crashing of 18.04
« Reply #21 on: July 28, 2021, 03:39:26 pm »
It is possible to check the file system type

Code: [Select]
df -Th | grep "^/dev"

Try using just fsck

Code: [Select]
sudo fsck /dev/sda2

fsck is a wrapper for various filesystem checks.

I have assumed you would have a ext type as being linux.

Offline RATTLEBACK.131

  • Jr. Member
  • **
  • Posts: 83
  • Karma: 1
  • I've just joined!
    • View Profile
    • Awards
Re: Frequent crashing of 18.04
« Reply #22 on: July 28, 2021, 11:03:33 pm »
From what I read about ext today would support your assumption but successfully ran 'df' etc. with no mention of ext.
However these result of 'df':

/dev/sdb1  vfat  7.3G  4.8G 2.5G  66%  /cdrom

[/dev loop stuff...]

/dev/sdc1  vfat  7.3G  4.8G 2.5G  66% /media/ubuntu/C539-4EEC

looks to me like this is targeting my live USB stick & not my laptop HDD.

Tried sudo fsck /dev/sda2 as you suggested (following umount as before) result:
sudo : unable to execute /sbin/fsck: input/output error

I appreciate your (& everyone's ) help with this.
Where to now??

Offline SeZo

  • Hero Member
  • *****
  • Posts: 1864
  • Karma: 145
  • Gender: Male
    • View Profile
    • Awards
Re: Frequent crashing of 18.04
« Reply #23 on: July 29, 2021, 08:50:45 am »
OK,

Try a different route, log in to your laptop then:
Get last time filesystem was checked

Code: [Select]
sudo tune2fs -l /dev/sda2 | grep Last\ c
then mount count since then
Code: [Select]
sudo tune2fs -l /dev/sda2 | grep Mount
check how many mounts are allowed before check
Code: [Select]
sudo tune2fs -l /dev/sda2 | grep Max

To force fsck on every boot:
Code: [Select]
sudo tune2fs -c 1 /dev/sda2
or every 10 boots
Code: [Select]
sudo tune2fs -c 10 /dev/sda2

To disable fsck on boot
Code: [Select]
sudo tune2fs -c -1 /dev/sda2

The Linux Community Forum

Re: Frequent crashing of 18.04
« Reply #23 on: July 29, 2021, 08:50:45 am »

Offline RATTLEBACK.131

  • Jr. Member
  • **
  • Posts: 83
  • Karma: 1
  • I've just joined!
    • View Profile
    • Awards
Re: Frequent crashing of 18.04
« Reply #24 on: July 29, 2021, 04:35:31 pm »
I'm not sure why you say 'log on to my laptop'. I can not boot my laptop except using live UBS OS.
The best I can get using laptop onboard drive is GNU GRUB screen with very limited options & no command terminal. If I try to boot (inc recovery boot) all I get is the long list of boot up sequence on black screen which drops out from a forced fsck, final lines reading:

/dev/sda2: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
                (ie. , without -a or -p options)
fsck exited with status code 4 [i believe this means nothing done to fix]
done.
Failure: file system check of the root filesystem failed
The root filesystem on /dev/sda2 requires manual fsck

The only way I've got to access the HDD is from an external live OS ?

I ran your 1st 3 commands on Live USB anyway to see what happened. Only the 2nd one returned any info :- mount count 71
Didn't bother with the last 3 because at the moment it's already running a (forced) fsck at boot with the above problems so they seem superfluous even if I could get a terminal.

Offline SeZo

  • Hero Member
  • *****
  • Posts: 1864
  • Karma: 145
  • Gender: Male
    • View Profile
    • Awards
Re: Frequent crashing of 18.04
« Reply #25 on: July 29, 2021, 05:45:34 pm »
Did not realise that you cannot boot your laptop :-[

Back to line USB/CD (lowercase L)
Please post the complete output here to show what is visible from live env.
Code: [Select]
sudo fdisk -l

Offline RATTLEBACK.131

  • Jr. Member
  • **
  • Posts: 83
  • Karma: 1
  • I've just joined!
    • View Profile
    • Awards
Re: Frequent crashing of 18.04
« Reply #26 on: July 29, 2021, 07:27:46 pm »
It really didn't want to connect to the internet but got here in the end.  Output of fdisk -l :

[email protected]:~$ sudo fdisk -l

Disk /dev/loop0: 1.7 GiB, 1831378944 bytes, 3576912 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop1: 86.6 MiB, 90759168 bytes, 177264 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop2: 140 MiB, 146841600 bytes, 286800 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop3: 1.6 MiB, 1691648 bytes, 3304 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop4: 12.2 MiB, 12804096 bytes, 25008 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop5: 21 MiB, 22003712 bytes, 42976 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop6: 3.3 MiB, 3411968 bytes, 6664 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 398FE7B1-8F42-4583-80A2-F713F12DCD13

Device       Start       End   Sectors   Size Type
/dev/sda1     2048   1050623   1048576   512M EFI System
/dev/sda2  1050624 976771071 975720448 465.3G Linux filesystem




Disk /dev/sdb: 7.3 GiB, 7801405440 bytes, 15237120 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0068a9d2

Device     Boot Start      End  Sectors  Size Id Type
/dev/sdb1  *       64 15237119 15237056  7.3G  b W95 FAT32
[email protected]:~$



Offline SeZo

  • Hero Member
  • *****
  • Posts: 1864
  • Karma: 145
  • Gender: Male
    • View Profile
    • Awards
Re: Frequent crashing of 18.04
« Reply #27 on: July 29, 2021, 08:25:43 pm »
Check if /dev/sda is mounted
Code: [Select]
mount | grep "/dev/sda*"

if it is then unmount it
Code: [Select]
sudo umount /dev/sda2

then run fsck to test and repair (this will be verbose)
Code: [Select]
sudo fsck -pvf /dev/sda2

or

Code: [Select]
sudo fsck -yvf /dev/sda2

Offline RATTLEBACK.131

  • Jr. Member
  • **
  • Posts: 83
  • Karma: 1
  • I've just joined!
    • View Profile
    • Awards
Re: Frequent crashing of 18.04
« Reply #28 on: July 30, 2021, 12:31:04 pm »
Mount | grep returned :
/dev/sda1 on /cdrom type vfat [+ stuff in brackets]

replaced "/dev/sda*" with "/dev/sda2" which returned nothing.
  Went ahead with umount /dev/sda2 anyway (returned 'not mounted') then ran fsck -yvf. This actually went through a couple of pages finding & fixing stuff. So I exited, powered down, removed the USB & switched back on. This took me to GNU GRUB page & I selected *ubuntu*. This then went through the loading sequence on black screen & I noted /dev/sda2 as 'clean'. Then loaded splash screen... & it hung up there. On the plus side that is progress  :)

 Looks like another hard shut down then. Then try to boot from a recovery option from advanced option in the GRUB screen...

Update.
On powering on it automatically went to GRUB screen. Selected a recovery boot, which gave me the square options box. Tried to run fsck from there but this quit saying /dev/sda2 was mounted.
I did run dpkg from there which added a package & removed 34 obsolete ones. Then I went to resume normal boot &...

Hey presto I'm writing this from my laptop ! Yay !  Everything looks to be running normally (inc. no more keyboard issues) except I can no longer alter the screen brightness. Maybe a reboot would sort that ? I'm hesitant to do that ever again :D

Can anyone think of anything I ought to be looking at doing immediately to double check stuff? Once I'm sure things are good I'll go back over Mad Penguin's earlier post & try & sort out his suggestions.

Thanks again to everyone for getting me this far.

2nd update.
Thought I go back over stuff & make some notes here for future ref.
To check how many mounts are allowed before (fsck) check ran:
:~$ sudo tune2fs -l /dev/sda2 | grep Max 
result:
Maximum mount count:      -1    [means 'fsck disabled' ?]

Used  :$ sudo tune2fs -c 1 /dev/sda2  to make sure fsck runs every boot.

Checked file system type with :~$ df -Th | grep "^/dev"
got:
/dev/sda2      ext4      457G   75G  360G  18% /
/dev/sda1      vfat      511M  6.7M  505M   2% /boot/efi
/dev/loop0     squashfs  219M  219M     0 100% /snap/gnome-3-34-1804/66
/dev/loop1     squashfs  2.5M  2.5M     0 100% /snap/gnome-calculator/826
/dev/loop2     squashfs  2.5M  2.5M     0 100% /snap/gnome-system-monitor/163
/dev/loop5     squashfs  100M  100M     0 100% /snap/core/11316
/dev/loop6     squashfs  141M  141M     0 100% /snap/gnome-3-26-1604/102
/dev/loop7     squashfs  2.5M  2.5M     0 100% /snap/gnome-calculator/884
/dev/loop8     squashfs  640K  640K     0 100% /snap/gnome-logs/106
/dev/loop9     squashfs  136M  136M     0 100% /snap/skype/176
/dev/loop13    squashfs  244M  244M     0 100% /snap/gnome-3-38-2004/39
/dev/loop4     squashfs  140M  140M     0 100% /snap/skype/177
/dev/loop12    squashfs   56M   56M     0 100% /snap/core18/2066
/dev/loop10    squashfs  141M  141M     0 100% /snap/gnome-3-26-1604/104
/dev/loop14    squashfs   62M   62M     0 100% /snap/core20/1081
/dev/loop15    squashfs   56M   56M     0 100% /snap/core18/2074
/dev/loop11    squashfs  768K  768K     0 100% /snap/gnome-characters/723
/dev/loop17    squashfs  165M  165M     0 100% /snap/gnome-3-28-1804/161
/dev/loop16    squashfs   66M   66M     0 100% /snap/gtk-common-themes/1515
/dev/loop19    squashfs  640K  640K     0 100% /snap/gnome-logs/103
/dev/loop18    squashfs  219M  219M     0 100% /snap/gnome-3-34-1804/72
/dev/loop20    squashfs  2.5M  2.5M     0 100% /snap/gnome-system-monitor/160
/dev/loop21    squashfs  163M  163M     0 100% /snap/gnome-3-28-1804/145
/dev/loop24    squashfs  768K  768K     0 100% /snap/gnome-characters/726
/dev/loop22    squashfs   65M   65M     0 100% /snap/gtk-common-themes/1514
/dev/loop23    squashfs   62M   62M     0 100% /snap/core20/1026
/dev/loop25    squashfs  100M  100M     0 100% /snap/core/11420

So dev/sda2 is ext4.

« Last Edit: July 30, 2021, 03:59:28 pm by RATTLEBACK.131 »

Offline RATTLEBACK.131

  • Jr. Member
  • **
  • Posts: 83
  • Karma: 1
  • I've just joined!
    • View Profile
    • Awards
Re: Frequent crashing of 18.04
« Reply #29 on: August 01, 2021, 10:46:09 pm »
Epilogue:

After all that I have to report that, sadly, my HDD expired today after running nicely with no issues. fsck can't even find /dev/sda2 anymore.

I did manage to back up all important doc's (I think) & had run smartmontools which showed me this demise was to be expected. A reallocated sector count at 584, with 69 remap attempts & 88 sectors awaiting remap, looked to me like a small miracle it was running at all. Fairly clear what my crashing problem was. I've never had an HDD die of old age before.

I have fitted a spare HDD temporarily which has done many more hrs but has no reallocated sectors. Put 18.04 on it & it's just about sorted. One small niggle but I'll start a fresh post if I can't sort it.

 I have learned a lot trying to sort this & have a record of it here for future ref.

Thank you all again for your help.

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal