SOLVED - LM19 xfce "login loop" / read only ext4 partition after crash

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Girafenaine

SOLVED - LM19 xfce "login loop" / read only ext4 partition after crash

Post by Girafenaine »

Hello,

My LM 19 xfce runs on a Mabook with dualboot Mac OS 10.6.8 + LM 19 xfce. I use a shared partition for documents, in hfs+ without journaling. After a crash, I usually need to boot with Mac OS in order to have a proper "fsck" done on the shared partition, and after that I can use LM again with a full read and write access to the shared partition.

After a new crash shutdown due to low battery under LM, I am not able to log in LM 19 xfce. The boot is OK, but instead of the usual automatical login it goes to a login screen. When I enter my login and password, the screen goes black 2 seconds and then comes back to the login screen. The guest account gives the same result.

I can start in recovery mode. I used fsck and package reparing, but both these functions make the macbook to shutdown. I tried a few command lines with the root console to check the permissions on .ICEauthority involved in the login, and ended with a "read-only" message about the documents partition. .ICEauthority is in this partition.

I then started with Mac OS (which stays fully functionnal), execute a disk repair and it told me the shared documents partition is OK, without any error. If there is no error from MacOS, it is hard to understand why it is mounted as read-only when it starts on Linux Mint.

Has anyone a clue to make my hfs+ documents partition mount in read-write mode when I start on Linux Mint ?
And/or to escape the "login loop" ?

Thanks,

Girafenaine
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 6 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
fabien85
Level 7
Level 7
Posts: 1877
Joined: Tue Mar 11, 2014 4:30 pm

Re: LM19 xfce "login loop" / read only hfs+ partition after crash

Post by fabien85 »

Girafenaine wrote: Thu Sep 27, 2018 4:32 am .ICEauthority is in this partition.
So you have put your home (/home/username/) on that partition ??

If not :
- boot a live USB
- mount the linux root partition (of the system installed on the macbook), navigate to /etc and open /etc/fstab as root
you can do that either through the graphical interface (in the file manager, right click > Open as administrator), or via the terminal.
- comment out the line referring to the document partition by putting a # in front.
Example : my fstab looks like this

Code: Select all

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sdb2 during installation
UUID=blabla     /     ext4    errors=remount-ro   0       1
# /boot/efi was on /dev/sdb1 during installation
UUID=blabla     /boot/efi     vfat    noatime,utf8,fmask=0133,errors=remount-ro      0       1
# /home was on /dev/sdb3 during installation
UUID=blabla     /home     ext4    defaults        0       2
# /var was on /dev/sda1 during installation
UUID=blabla     /var      ext4    defaults        0       2
# Data partition
UUID=blabla     /data     ext4    defaults        0       2
If I want to prevent the /data partition to be mounted, I would change the last line to

Code: Select all

#UUID=blabla     /data     ext4    defaults        0       2
- save, unmount the root partition, shutdown, unplug the live USB, reboot.
- hopefully you should now be able to boot Mint. Tell us if it works. (if so, we can tackle the next problem: getting the doc partition to work again)


If yes :
- oh god, you are in trouble.
- my personal experience of sharing a hfs+ partition between macOS and Mint is bad. I tried to share a simple data partition, not even home, and got all sorts of permissions problems, tried changing the uid of my Mint user to 501 = macOS user but that made Mint go crazy... In the end I gave up and used a FAT32 partition (maybe exfat can work nowadays) to share, and that worked ok.
- nowadays, even sharing home between different linux distros is discouraged
- if home is read-only, then yes you wont be able to log in. I'm not knowledgeable here but I have understood that the graphical login will need read and write access to .ICEauthority.
- can you boot a live USB and post here the content of the /etc/fstab of the installed system ?
- to repair all this you will need to use recovery mode, drop to root shell prompt and run (probably many) commands there
- if /home is still on a linux partition, you can try creating a new user (with adduser some-username), then reboot and try logging into it. Already a good start if this works.
Girafenaine

Re: LM19 xfce "login loop" / read only hfs+ partition after crash

Post by Girafenaine »

Hello Fabien,

Thanks for your help !
- my /home is on the same ext4 partition than my /
- in my /home, i have put links to the folders of my hfs+ partition (documents, movies, music, pictures, download). It works rather well, but when there is a crash, this hfs+ partition is blocked in read only mode and I have to boot MacOs to have a proper fsck on this partition. Then it works again.
- I have just tried to comment my fstab file. It does not work (actually the .ICEauthority file is in the /home on the ext4 partition, not on the hfs+ partition, so I can understand that nothing changes). My own idea that the problem could come from this hfs+ partition is not a good one.
- in recovery mode, I can see that the ext4 partition with my / is in read only. The fsck command tells "ok". Yet there is someting blocked on it... how can I get my / partition to come back in read/write mode ?

Girafenaine
fabien85
Level 7
Level 7
Posts: 1877
Joined: Tue Mar 11, 2014 4:30 pm

Re: LM19 xfce "login loop" / read only ext4 partition after crash

Post by fabien85 »

Ok, good news that your home is not on hfs+.
So the problem seems unrelated to that partition. Keep it commented out in the fstab though, so we can focus on one problem at a time.

For he / partition :
- I think you must use a live USB to fsck that partition. Do it.
- Boot in recovery mode, drop to root shell prompt and issue

Code: Select all

mount -a
this should mount all partitions in the fstab, so including that / partition. This should either give an error message about said partition (if so, report the error here), or mount the / read-write (if so, try to get to the graphical login with init 5).
Girafenaine

Re: LM19 xfce "login loop" / read only ext4 partition after crash

Post by Girafenaine »

I have done fsck from a live USB, with nothing to repair.

I also checked the SMART state of the disk, no error was reported.

Under recovery mode and root shell, I launched mount -a : nothing was displayed
Then I launched init 5, with the following result :
"Time out waiting for device dev-disk-by\x2duuid-70D6\x21701.device.
Dependency failed for File System Check on /dev/disk/by-uuid/70D6-1701"
Same two lines for another dev-disk
And : "dependency failed for Swap"

Then nothing happens and I cannot write anything.

What can I try now ?

Girafenaine
fabien85
Level 7
Level 7
Posts: 1877
Joined: Tue Mar 11, 2014 4:30 pm

Re: LM19 xfce "login loop" / read only ext4 partition after crash

Post by fabien85 »

"Time out waiting for device dev-disk-by\x2duuid-70D6\x21701.device.
Dependency failed for File System Check on /dev/disk/by-uuid/70D6-1701"
70D6-1701 is very probably the uuid of a FAT32 partition. linux partitions (and I think hfs+ too) have longer uuids, while FAT32 partition have an uuid of this form (4 characters, dash, 4 characters).
Unless you have another FAT32 partition, this could be a problem with your EFI partition, which is usually the first one (/dev/sda1) on a mac.
try a fsck on that partition.

Also drop to root shell prompt and report the outputs of the following commands :

Code: Select all

cat /etc/fstab
blkid
mount | grep /dev/sd
mount -a
mount | grep /dev/sd
gm10

Re: LM19 xfce "login loop" / read only ext4 partition after crash

Post by gm10 »

Girafenaine wrote: Thu Sep 27, 2018 4:32 am I can start in recovery mode.
[...]
it is hard to understand why it is mounted as read-only when it starts on Linux Mint.
Recovery mode mounts everything read-only. This is by design to prevent data loss since it does not know what you are recovering from, so it plays it safe.

To be able to write to the drive, just remount it in read/write mode:

Code: Select all

mount -o rw,remount /
After that you can delete .ICEauthority and .Xauthority in your user folder and you should be able to log in again after a regular reboot.
Girafenaine

Re: LM19 xfce "login loop" / read only ext4 partition after crash

Post by Girafenaine »

Here are main results of the requested command lines :

Cat /etc/fstab :
UUID=... / ext4 errors=remount-ro 0 1
UUID=... /boot/efi vfat umask= 0077 0 1
UUID=... none swap sw 0 0
Then my commented documents hfs+ partition

Blkid :
sda1 label=efi vfat...
sda2 label=systeme hfsplus (MacOs)...
sda3 ext4 (linuxmint 19)...
sda4 swap...
sda5 label=documents hfsplus...

Mount | grep /dev/sd :
/dev/sda3 on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)

Mount -a:
Same lines than last try, eg :
timed out waiting for device dev-disk-by\x2duuid-70D6\x2d1701.device.
Dependency failed for file system check on /dev/disk/by-uuid/70D6-1701
Timed out waiting for device dev-disk-by\x2duuid-ec03909e\x2dc435\x2d48da\x2d976c\x2ddbe6c684bee9.device.
Dependency failed for /dev/disk/by-uuid/ec03909e-c435-48da-976c-dbe6c684bee9.
Dependency failed for Swap.

And then nothing happens, I cannot write anymore.

If I do mount -a before, I got for Mount | grep /dev/sd :
/dev/sda3 on / type ext4 (ro,relatime,data=ordered)

Girafenaine
fabien85
Level 7
Level 7
Posts: 1877
Joined: Tue Mar 11, 2014 4:30 pm

Re: LM19 xfce "login loop" / read only ext4 partition after crash

Post by fabien85 »

Do the uuids coincide between blkid and the fstab ?
(that was one of the point of asking these outputs)
70D6-1701 should be the uuid of the EFI partition sda1
ec03909e-c435-48da-976c-dbe6c684bee9 should be the uuid of either / (/dev/sda3) or swap (/dev/sda4)

gm10 is more knowledgeable, his instructions may be enough to get you back running.
Girafenaine

Re: LM19 xfce "login loop" / read only ext4 partition after crash

Post by Girafenaine »

Fabien :
Yes, the uuid are the same in blkid and cat /etc/fstab outputs.
You're right in attributing the first uuid at EFI partition sda1, and the second one at the swap partition sda4.

Gm10 :
After I enter the mount -o rw,remount / command you suggested, and after a few seconds, the messages I have already wrote are displayed, about "timed out" and "dependency failed" and concerning the EFI partition and the swap partition.

I tried to rm .Xauthority and .ICEauthority before these lines display, but nothing noticeable has changed since. The "timed out" and "dependency failed" lines do appear a short time after my commands.

Actually the problem seems to be not just about .Xauthority and .ICEauthority, but to be a deeper problem with access to some partitions. According to the SMART state I checked from a live USB, there is no material error or problem. However from the recovery menu, If i check the "system summary" entry, I can read : LVM : physical volumes : bad ; volumes groups : good.

From the recovery root shell, if i launch exit and come back to the recovery menu, and then launched "resume" or "fsck", some lines are quickly dropped as if a process started but the macbook deeply hibernates in an unattended way after 2 seconds. I have to hold the power button for a few seconds to shut down, and then only am I able to reboot.

Girafenaine
Last edited by Girafenaine on Sun Sep 30, 2018 1:59 pm, edited 1 time in total.
gm10

Re: LM19 xfce "login loop" / read only ext4 partition after crash

Post by gm10 »

Girafenaine wrote: Sun Sep 30, 2018 4:50 am After I enter the mount -o rw,remount / command you suggested, and after a few seconds, the messages I have already wrote are displayed, about "timed out" and "dependency failed" and concerning the EFI partition and the swap partition.
So remounting / gets you errors from the other partitions? That one I did not expect. I would try these two:
- re-format the swap partition from a live USB and see if the error regarding that one goes away. if not, then:
- comment out both EFI and swap partitions in /etc/fstab (you can boot with just / root alone) and see if you can boot now

Instead you could also try changing the mount-options of all but the / root partition to noauto,x-systemd.automount, but this is mainly something I would expect to help with the hfs+ partitions, not EFI and swap
Girafenaine

Re: LM19 xfce "login loop" / read only ext4 partition after crash

Post by Girafenaine »

Gm10, thanks for your help.

Actually the message about "timed out" and "dependency failed" concerning EFI and swap occurs even when I do not enter any command line. If I only wait in the recovery menu, this message appears as well after some 20 seconds. So it is probably not the "mount" command that urges it.

This matter may have concerned the / partition also in some cases, but not during my last attempts.

I will try what you put forward as soon as I will be home, in a few hours.

Girafenaine
fabien85
Level 7
Level 7
Posts: 1877
Joined: Tue Mar 11, 2014 4:30 pm

Re: LM19 xfce "login loop" / read only ext4 partition after crash

Post by fabien85 »

As gm10 says, try commenting them out in the fstab.

If that works, reformat the swap partition : with a live USB, open gparted, select the partition then Partition > Format to > linux-swap > Apply. This will change the uuid of that partition, so go to Partition > Informaton and copy the new uuid. Then edit the fstab, uncomment the swap line and replace the old uuid by the new one. Then reboot to see if that works.

For he EFI partition, it probably needs a fsck.
Girafenaine

Re: LM19 xfce "login loop" / read only ext4 partition after crash

Post by Girafenaine »

Hello,

1. The commented swap and efi lines in the fstab file do prevent warning messages from appearing under recovery mode root shell... but that do not change anything concerning login. I still face the same login loop, and am unable to start a session.

So it tends to show that the problem with swap and EFI partition is not the cause, but a consequence of the same problem that prevent me from logging into a session.

2. I gave a try at formatting the swap partition (uncommented line in the fstab file), and fsck to the EFI partition (no error message), it did not change anything to the login loop.

3. With the swap and EFI lines in the fstab file uncommented, I booted again in recovery mode and on the root shell, just after a few seconds, without any command lines, I read :
Timed out waiting for...
Dependency failed for...
(For both the swap and EFi partitions)
Dependency failed for Local File Systems
Dependency failed for Clean Up any mess left by 0dns-up
Starting Set Console font and keymap...
OK Reached target Timers.
OK Reached target Login Prompts.
Starting Set console scheme...
OK Closed Syslog Socket.
(It continues until the following line :)
OK Started Stop unreadahead data collection.
(Then nothing happens)

Any other idea, appart from reinstalling ?

4. From the given link I can figure out that my matter lays on "lvm2"... but it is quite different because in this thread no one is blocked outside is own session : they can continue to login after the "timed out" and "dependency failed" error messages. I can't ! This "lvm" clue is consistent with the result of the system-summary on recovery mode, telling : lvm state : physical volumes : not ok (bad).
gm10

Re: LM19 xfce "login loop" / read only ext4 partition after crash

Post by gm10 »

I didn't expect it to change a thing about the login loop but at least we know that there's probably nothing actually wrong with the disk if the error persists even after formatting the swap. You said your system worked properly before the crash, therefore my current guess would be that something got corrupted on your / root partition when you crashed, which is now causing the problems.

Because of that my suggestion would indeed be a reinstall (if you don't check the box to format / root you might be able to do it without having to delete anything, but please do create a backup of your data & settings first regardless - also a clean install is preferred). Maybe wait to see what to see what fabien85 thinks first though, maybe he's got a better idea.

In the meantime you could also try creating a new user (adduser username) from the root shell and then try to log into that. Even if that works that won't fix your "dependency failed" errors though.
fabien85
Level 7
Level 7
Posts: 1877
Joined: Tue Mar 11, 2014 4:30 pm

Re: LM19 xfce "login loop" / read only ext4 partition after crash

Post by fabien85 »

I dont really have any other idea than gm10.

+1 on trying to create another user.
(if that works, you can always transfer all the data to that new user)

Maybe a possibility is to boot from a live USB, then chroot into the installed system, see if chroot work correctly, e.g. if you can do an apt-get update, switch user to your normal user (su username)...
The procedure to chroot is steps 1-7 in https://sites.google.com/site/easylinuxtipsproject/6. Do adapt the partition numbers to your case (i.e. EFI partition is sda1, vs sda2 in the tuto, and root partition is sda3, vs sda5 in the tuto)
In principle, if you can successfully chroot, you could repair the whole system. That said I dont know how to do it, it's beyond my pay grade... You can always try to see if there were packages that had not finished to be installed : dpkg-configure -a. You could try also to downgrade lvm2, following the arch thread.

Edit: did you encrypt your installation ? or did you check the box "logical volume management" during install ?
If you answered no to both these questions, I think you do not need lvm. So maybe it's possible to remove all the lvm packages so as to get rid of this warning about logical volumes being in a bad state. I have to check if it's possible to remove lvm on a Mint install without troubles.
Also, please boot a live USB and provide the output of

Code: Select all

sudo gdisk -l /dev/sda
(the option is a lowercase L)
Girafenaine

Re: LM19 xfce "login loop" / read only ext4 partition after crash

Post by Girafenaine »

Gm10 and Fabien85, thanks for your help.

I added an user from the recovery mode. The "timed out" and "dependency failed" messages appeared while the command was executing, I guess it was not perfect conditions.

When I tried to reboot, I couldn't first reach either the login screen, nor the the recovery mode - Macbook shut down at earlier stage (but after the grub screen). After the night, I tried again and I was able to reach both login screen and recovery mode (I don't know what has changed since yesterday. I just boot from two different live USB - a Cinnamon 19 that ran well, and a xfce 19 that displayed errors during the boot process, then from MacOS - which runs very well). From login screen, I saw my new user, which behaves like old ones : login loop that comes back to the login screen after a 2 seconds black screen.

I have no encryption, and I didn't check the lvm box during install.

Here is the output of sudo gdisk -l /dev/sda from a live session :

Code: Select all

mint@mint:~$ sudo gdisk -l /dev/sda
GPT fdisk (gdisk) version 1.0.3

Partition table scan:
  MBR: hybrid
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with hybrid MBR; using GPT.
Disk /dev/sda: 976773168 sectors, 465.8 GiB
Model: WDC WD5000LPVX-2
Sector size (logical/physical): 512/4096 bytes
Disk identifier (GUID): 9D37B812-7731-4501-BACA-5FBE283AD1D9
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 976773134
Partitions will be aligned on 8-sector boundaries
Total free space is 2069 sectors (1.0 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1              40          409639   200.0 MiB   EF00  EFI System Partition
   2          409640        61962704   29.4 GiB    AF00  
   3       895170560       970756095   36.0 GiB    8300  LinuxMint19
   4       970756096       976771071   2.9 GiB     8200  
   5        61962705       895170559   397.3 GiB   AF00  
If I reinstall LM xfce 19, can I do an install and keep the same MBR and grub install ? Since grub works well and is able to launch LM and MacOS (actually by an "exit" entry), I would like not to bother it. Will grub be able to find the new LM xfce install ?

Girafenaine
fabien85
Level 7
Level 7
Posts: 1877
Joined: Tue Mar 11, 2014 4:30 pm

Re: LM19 xfce "login loop" / read only ext4 partition after crash

Post by fabien85 »

It's a shame creating a new user didnt work.

I checked in a virtual box, and purging lvm2 does not change anything to the system, I still could boot graphically without any difference I could see.
So it's something you can try : chroot to the installed system following my previous message, then apt purge lvm2, then exit the chroot, unmount everything, shutdown, unplug the USB and try to reboot.
Girafenaine wrote: Mon Oct 01, 2018 2:28 am If I reinstall LM xfce 19, can I do an install and keep the same MBR and grub install ?
If I remember correctly from your thread viewtopic.php?f=46&t=272090 , your grub is installed in EFI mode, not Legacy/BIOS. Your grub is thus not located in the MBR but in the EFI partition.
You can check your boot mode by going to recovery mode, dropping to root shell prompt and issuing

Code: Select all

[ -d /sys/firmware/efi ] && echo "EFI mode" || echo "Legacy Bios mode"
Because you have a hybrid MBR, as shown by the gdisk output, both modes are actually possible.
By the way did you make any change to your partition layout recently ? (if not, forget it)

You can reinstall Mint without changing the grub program (by launching the installer with ubiquity -b from a terminal), but the grub menu will change anyway. The grub menu is controlled by the config file /boot/grub/grub.cfg on the Mint partition, and that will get overwritten by the reinstall.
If I remember correctly from your previous thread, your concern is about having a grub entry to boot macOS. That will indeed get overwritten, but you can re-apply the step 7bis) that I gave in my second post, i.e. create a custom grub entry "exit to macOS".
Girafenaine

Re: LM19 xfce "login loop" / read only ext4 partition after crash

Post by Girafenaine »

1. Before I reinstall LM 19 xfce, I am going to try the lvm2 removing, mainly because it's an opportunity to train my beginner's skills... with the chroot process, as far as I am concerned, I can proceed without any internet connection ? With my xfce live usb, I cannot get wifi connection (Broadcom driver to install first, which i can't do on the live usb), and don't have any wired connection. It seems to me that I can do the whole process and rm lvm2 without any connection. However i cannot do "apt-get"

2. If I need to reinstall, i can deal with the grub menu (and the "mac OS entry"), but my question is : will the present grub detect easily the newly reinstalled LM xfce ? Is there anything to do during install to ensure grub will find the new LM ?

By the way, I don't know the "ubiquity" command to install without grub. May I get the same result with some option in the graphical install process ? i have never installed LM through command lines.

I will check my boot mode thanks to your last post. I haven't change anything since the thread you linked to ! So it should be EFI mode.

Girafenaine
Locked

Return to “Storage”