Boot to initramfs

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
linuxmademebald
Level 1
Level 1
Posts: 7
Joined: Tue Dec 05, 2017 11:43 pm

Boot to initramfs

Postby linuxmademebald » Wed Dec 06, 2017 12:44 am

Hi,

I have Linux mint installed on a dell laptop and my problem is that when I try booting it stops at initramfs. This has happened before (about 12 months ago) and I managed to fix it but this time I am having no joy whatsoever, last time the symptoms I was getting was that videos would freeze for 10 second periods (sound would continue), I tried shutting the laptop down and it went into the initramfs prompt.

This time round the symptoms were similar but the laptop completely froze and forced me to perform a hard restart, I presume (guess) some update (kernel?) may have been going on and it fell over and now it is trying to load a partition that is already seen as open.

I do not have a great amount of experience with Linux but will try my best to follow any instructions/help given, I really hope I don't lose my files. Please advise if I am missing any simple steps that I should be taking for diagnosis and thank you for any help given.

So to start, I boot in to the installation on the laptop and get presented with the "GNU GRUB" options as follows,

"
Linux Mint 17.1 MATE 64-bit, 3.13.0-37-generic (/dev/sda1) (tried this falls to initramfs)
Linux Mint 17.1 MATE 64-bit, 3.13.0-37-generic (/dev/sda1) -- recovery mode (tried this falls to initramfs)
Previous Linux versions (under this option I have the same as above but previous version 'Linux Mint 17.1 MATE 64-bit, 3.11.10-03111015-generic (/dev/sda1)') (tried both of these and they fall into initramfs, I will use this selection for the commands below)
"
I enter my encryption key (which is successful).

It then falls to initramfs as follows,

"BusyBox v1.21.1 (Ubuntu 1:1.21.0-1ubuntu4) built-in shell (ash)
Enter 'help' for a list of built-in commands.

(initramfs)"

I use the following command to check for root existence := ls -l /dev/[hs]da*
Which returns

"
brw------- 1 8, 5 /dev/sda5
brw------- 1 8, 5 /dev/sda2
brw------- 1 8, 5 /dev/sda1
brw------- 1 8, 5 /dev/sda
"

Then check for boot argument := cat /proc/cmdline
Which returns

"BOOT_IMAGE=/vmlinuz-3.11.10-03111015-generic root=/dev/mapper/mint--vg-root ro recovery nomodeset"

I check for loaded modules using := cat /proc/modules
Which returns a fair few, too many to type here but ends with "video 19574 1 i915, live 0xffffffffa0000000" (I am guessing these load in a certain order, I don't see any errors though).

When I type 'exit' in initramfs it returns (possibly more but all I can see on top of screen) 'Kernal panic - not syncing: Attempted to kill init! exitcode=0x00000200' and just dies so I have to hard reset.

I have created a live USB using rufus from the original ISO from the original install and tried accessing the drive from there but it requests my password but then does not let me view/mount the drive and returns an error as follows "Unable to mount location, The unlocked device does not have a recognizable file system on it". If I double click it again it says "Opening "316GB Volume", you can stop this operation by clicking cancel" after some time it returns the following error,

"Unable to mount location,

Error mounting /dev/dm-1 at /media/mint/a79etcetc: Command-line 'mount -t "ext4" -o "uhelper=udisks2,nodev,nosuid" "/dev/dm-1" "/media/mint/a79etcetc" exited with non-zero exit status 32:mount wrong fs type, bad option, bad superblock on /dev/mapper/mint--vg-root, missing codepage or helper program, or other error In some cases usefull info is found in syslog - try dmesg | tail or so"




Any help/pointers would be greatly appreciated, I wouldn't be surprised if it is something glaringly obvious to the trained eye so please forgive me for such a long post if it is.

User avatar
WharfRat
Level 20
Level 20
Posts: 10355
Joined: Thu Apr 07, 2011 8:15 pm

Re: Boot to initramfs

Postby WharfRat » Wed Dec 06, 2017 1:18 am

Hello linuxmademebald Image

Welcome to Linux Mint and the Linux Mint forum :)

Falling into the ash shell is certainly not a good scenario.

Booted to the live USB paste back the results of sudo blkid andls -lh /dev/mapper

It's late here and I'm about to pack it in for the evening. I'll check back on your results in the morning.
Image ImageImage

linuxmademebald
Level 1
Level 1
Posts: 7
Joined: Tue Dec 05, 2017 11:43 pm

Re: Boot to initramfs

Postby linuxmademebald » Wed Dec 06, 2017 5:58 am

WharfRat wrote:Hello linuxmademebald Image

Welcome to Linux Mint and the Linux Mint forum :)

Falling into the ash shell is certainly not a good scenario.

Booted to the live USB paste back the results of sudo blkid andls -lh /dev/mapper

It's late here and I'm about to pack it in for the evening. I'll check back on your results in the morning.


Hi WharfRat,

Thank you for the quick reply, the output of the commands you gave are as follows,

mint@mint ~ $ sudo blkid
/dev/loop0: TYPE="squashfs"
/dev/sda1: UUID="057ef6ef-etc-etc" TYPE="ext2"
/dev/sda5: UUID="81b1840-ect-etc" TYPE="crypto_LUKS"
/dev/sbd1: LABEL="LINUX MINT" UUID="8E17-etc" TYPE="vfat"


mint@mint ~ $ ls -lh /dev/mapper
crw------- 1 root root 10, 236 Dec 6 09:46 control

User avatar
WharfRat
Level 20
Level 20
Posts: 10355
Joined: Thu Apr 07, 2011 8:15 pm

Re: Boot to initramfs

Postby WharfRat » Wed Dec 06, 2017 9:53 am

OK, again from the live media, make sure /dev/sda1 is not mounted with mount|grep sda1.

If it is then unmount it with sudo umount /dev/sda1

Then run sudo fsck -fvCy /dev/sda7

Then try to reboot normally.

If that doesn't work then rebuilding the initrd will be tthe next step.
Image ImageImage

linuxmademebald
Level 1
Level 1
Posts: 7
Joined: Tue Dec 05, 2017 11:43 pm

Re: Boot to initramfs

Postby linuxmademebald » Wed Dec 06, 2017 11:46 am

It shows as not mounted.

When I run the 'sudo fsck -fvCy /dev/sda7' (I presume the 7 is a 1, testing me :P) it returns.

mint@mint ~ $ sudo fsck -fvCy /dev/sda1
fsck from util-linux 2.20.1
e2fsck 1.42.9 (4-Feb-2014)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information

315 inodes used (0.51%, out of 62248)
54 non-contiguous files (17.1%)
1 non-contiguous directory (0.3%)
# of inodes with ind/dind/tind blocks: 53/10/0
91663 blocks used (36.84%, out of 248832)
0 bad blocks
0 large files
299 regular files
7 directories
0 character device files
0 block device files
0 fifos
0 links
0 symbolic links (0 fast symbolic links)
0 sockets
--------------
306 files
min@mint ~$


Then tried reboot and it falls in to initramfs.

User avatar
WharfRat
Level 20
Level 20
Posts: 10355
Joined: Thu Apr 07, 2011 8:15 pm

Re: Boot to initramfs

Postby WharfRat » Wed Dec 06, 2017 12:32 pm

The sda7 was my mistake, but you ran fsck on the correct partition.

Enter this one line at a time

Code: Select all

sudo -i
/sbin/cryptsetup luksOpen /dev/sda5 crypt
mount /dev/mapper/mint--vg-root /mnt
mount /dev/sda1 /mnt/boot
mount -t proc none /mnt/proc
mount --rbind /sys /mnt/sys
mount --rbind /dev /mnt/dev
/usr/sbin/chroot /mnt /bin/bash
source /etc/profile
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
export PS1="\[\033[1;33m\]chroot to ->\[\033[1;31m\](system) #\[\e[0m\] "


Then paste back ls -lh /boot/initrd* and stay in the chroot.
Image ImageImage

linuxmademebald
Level 1
Level 1
Posts: 7
Joined: Tue Dec 05, 2017 11:43 pm

Re: Boot to initramfs

Postby linuxmademebald » Wed Dec 06, 2017 1:10 pm

Just to check should I be doing this in the live USB terminal?.

If so It falls over on this step := mount /dev/mapper/mint--vg-root /mnt

"
mint ~ # mount /dev/mapper/mint--vg-root /mnt
mount: wrong fs type, bad option, bad superblock on /dev/mapper/mint--vg-root, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so"

User avatar
WharfRat
Level 20
Level 20
Posts: 10355
Joined: Thu Apr 07, 2011 8:15 pm

Re: Boot to initramfs

Postby WharfRat » Wed Dec 06, 2017 1:21 pm

Yes, you should be doing this from the live USB terminal

Did you enter your disk's password when entering /sbin/cryptsetup luksOpen /dev/sda5 crypt and did it open the LUKS container :?:


After unlocking the disk what does ls -lh /dev/mapper show :?:
Image ImageImage

linuxmademebald
Level 1
Level 1
Posts: 7
Joined: Tue Dec 05, 2017 11:43 pm

Re: Boot to initramfs

Postby linuxmademebald » Wed Dec 06, 2017 1:33 pm

When I entered the string := /sbin/cryptsetup luksOpen /dev/sda5 crypt it requested my password which I entered and it returned the 'mint ~ #' prompt without any visible errors. Not sure what is meant by the 'LUKS container'?.

Running the string := ls -lh /dev/mapper

"
mint ~ # ls -lh /dev/mapper
total 0
crw------- 1 root root 10, 236 Dec 6 16:53 control
lrwxrwxrwx 1 root root 7 Dec 6 17:06 crypt -> ../dm-0
lrwxrwxrwx 1 root root 7 Dec 6 17:06 mint--vg-root -> ../dm-1
lrwxrwxrwx 1 root root 7 Dec 6 17:06 mint--vg-swap_1 -> ../dm-2
mint ~ #
"

Edit to add, I viewed the LUKS container using the following command := cryptsetup luksDump /dev/sda5

Which returned a dump showing enabled on key slot 0, key slots 1-7 are disabled.
Last edited by linuxmademebald on Wed Dec 06, 2017 1:56 pm, edited 1 time in total.

User avatar
WharfRat
Level 20
Level 20
Posts: 10355
Joined: Thu Apr 07, 2011 8:15 pm

Re: Boot to initramfs

Postby WharfRat » Wed Dec 06, 2017 1:51 pm

OK, that looks good so far.

What happens with mount /dev/mapper/mint--vg-root /mnt ?

Never mind I see the answer in your previous post

Try fsck -fvCy /dev/mapper/mint--vg-root
Image ImageImage

linuxmademebald
Level 1
Level 1
Posts: 7
Joined: Tue Dec 05, 2017 11:43 pm

Re: Boot to initramfs

Postby linuxmademebald » Wed Dec 06, 2017 2:16 pm

Normality has returned :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D

It did some force fixing and showed some positive results so I checked access to the hd via the live USB which worked so I restarted as normal and it has loaded in as normal.

Thank you so much for your expert help with this WharfRat. Now I just need to think/work through the steps we took and understand it thoroughly, I didn't know how to view the LUKS container an hour ago so I have learned something new today :D.

I will perform some integrity tests but I think this may well be solved!.

User avatar
WharfRat
Level 20
Level 20
Posts: 10355
Joined: Thu Apr 07, 2011 8:15 pm

Re: Boot to initramfs

Postby WharfRat » Wed Dec 06, 2017 3:25 pm

Glad to hear that you're back up and running especially after getting wrong fs type, bad option, bad superblock messages.

If you don't have a backup of your important stuff, I'd suggest doing so asap :wink:
Image ImageImage

linuxmademebald
Level 1
Level 1
Posts: 7
Joined: Tue Dec 05, 2017 11:43 pm

Re: Boot to initramfs

Postby linuxmademebald » Wed Dec 06, 2017 5:18 pm

Indeed, doing it now, I didn't have loads of files scattered about as after last install I just used the desktop as an open messy folder but they were still very important documents to me.

Luckily I had moved my BTC about a week before this happened else I probably would have been kicking myself hard for not doing a proper backup. I got lucky this time and was fortunate to have your help to get it working again.

It is so easy to become complacent/sloppy when the system is working.

Thanks again for your help WharfRat.


Return to “Newbie Questions”