Mounting problem at last step in encryption partition - lvm2

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

Mounting problem at last step in encryption partition - lvm2

Post by karamjeet »

Hello Experts
Please help i have stated my problem as follows :
Problem in mounting my encryption partition due to this i have an error which is "initramfs" error of "Busybox 1.21.1".
I was following the this post from a thread : viewtopic.php?f=50&t=198706#p1043424
Upto 8th point number from post, commands are successful for me

Code: Select all

mint@mint ~ $ sudo apt-get install cryptsetup lvm2
Reading package lists... Done
Building dependency tree 
Reading state information... Done
cryptsetup is already the newest version.
lvm2 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
mint@mint ~ $ sudo modprobe dm-crypt
mint@mint ~ $ sudo modprobe dm-mod
mint@mint ~ $ sudo cryptsetup luksOpen /dev/sd
sda sda1 sda2 sda3 sda5 sdb sdb1 sdc 
mint@mint ~ $ sudo cryptsetup luksOpen /dev/sda5 MYDATA
Enter passphrase for /dev/sda5:
mint@mint ~ $ sudo vgscan
Reading all physical volumes. This may take a while...
Found volume group "mint-vg" using metadata type lvm2
mint@mint ~ $ sudo vgchange -ay mint-vg
2 logical volume(s) in volume group "mint-vg" now active
mint@mint ~ $ sudo lvscan
ACTIVE '/dev/mint-vg/root' [927.32 GiB] inherit
ACTIVE '/dev/mint-vg/swap_1' [3.90 GiB] inherit
mint@mint ~ $ sudo mkdir /media/root
but when i ran command #9 there is problem like i have shown as follows:


mint@mint ~ $ sudo mount /dev/mint-vg/root /media/root
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

Please let me know for further info if required.

Heading to this from many hours :( :( , Please help as soon as possible.
Thanks in advance.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
WharfRat

Re: Mounting problem at last step in encryption partition - lvm2

Post by WharfRat »

There is no need to install any packages for LVM as they are already installed. Otherwise you would have never been able to boot.

What you should try first is running fsck on the /boot partition which is most likely sda1, but check first before doing so and make sure it's not mounted

Use fsck -fvy /dev/sda1
Mute Ant

Re: Mounting problem at last step in encryption partition - lvm2

Post by Mute Ant »

This error..."mount: wrong fs type, bad option, bad superblock on /dev/mapper/mint--vg-root" ...means the contents of the logical volume are too 'odd' to be recognised as a mountable file system. The encryption and LVM are irrelevant since you unlocked them. If you are working with a standard Ubuntu Encrypted OS it should be an ext4 file system.

You can usefully try a do-not-write-anything check... sudo e2fsck -n /dev/mapper/mint--vg-root ...to see how much damage there is.
karamjeet

Re: Mounting problem at last step in encryption partition - lvm2

Post by karamjeet »

Hello sir
Thanks for answering my question:
One short clarification.
When I have to run this command?
1 Terminal on live USB stick and after the steps I have followed from post mentioned URL above?
2 Terminal without running Live USB stick on screen where error 'initramfs' occurs? (It is giving me error here /bin/sh: fsck: not found)

Thanks again.
karamjeet

Re: Mounting problem at last step in encryption partition - lvm2

Post by karamjeet »

Hello @Mute Ant

Thanks for giving time.
You can usefully try a do-not-write-anything check... sudo e2fsck -n /dev/mapper/mint--vg-root ...to see how much damage there is.
Please clarifies me on this with various steps.
On Live install terminal, because without live install i am able to run any command on error screen "initramfs" .

waiting for reply thanks.
WharfRat

Re: Mounting problem at last step in encryption partition - lvm2

Post by WharfRat »

Did you fsck the /boot partition :?:

If you want to fsck the logical volume sudo e2fsck -fvy /dev/mapper/mint--vg-root

You would mount it with sudo mount /dev/mapper/mint--vg-root /mnt
karamjeet

Re: Mounting problem at last step in encryption partition - lvm2

Post by karamjeet »

Hello Sir

I have pasted screenshots to easily understand. Because may some gap of communication due to lack of proper knowledge from my side.
By seeing these you can understand the exact situation, if required further please let me know.

Sir I have followed that link and put command and current situation is this after following your given commands
Did you fsck the /boot partition :?:

If you want to fsck the logical volume sudo e2fsck -fvy /dev/mapper/mint--vg-root

You would mount it with sudo mount /dev/mapper/mint--vg-root /mnt
Image ImageImage
Response for these command

Image

and here below the structure that is looking like now from linux mint live version.

Image

Please let me know, if there is anything went wrong or i can do backup for encrypted partition from live USB stick.

Thanks & Regards,
Karamjeet Singh
karamjeet

Re: Mounting problem at last step in encryption partition - lvm2

Post by karamjeet »

Hello @Mute_Ant

Please check the following :
This error..."mount: wrong fs type, bad option, bad superblock on /dev/mapper/mint--vg-root" ...means the contents of the logical volume are too 'odd' to be recognised as a mountable file system. The encryption and LVM are irrelevant since you unlocked them. If you are working with a standard Ubuntu Encrypted OS it should be an ext4 file system.

You can usefully try a do-not-write-anything check... sudo e2fsck -n /dev/mapper/mint--vg-root ...to see how much damage there is.
I have run the command

Code: Select all

sudo e2fsck -n /dev/mapper/mint--vg-root
suggested by you and it ran for a long time in live cd terminal and i have attached an image for the output of this this please check image below :

Image

and provide solution please, i even don't understand the output of this.
Thanks
Mute Ant

Re: Mounting problem at last step in encryption partition - lvm2

Post by Mute Ant »

The read-only check assumed it is an ext4 file system, but it only found 11 things it could recognise as files, in a 1TB space. I guess it's not a lightly-damaged ext4 that can be fixed, it's a large, seriously damaged lump.

Copying 1TB takes hours. My machine manages 60MiB/s read and 30MiB/s write. That's 4.5 hours to read the data and 9 hours to write it to a backup drive. If the cause of the initial failure was the drive hardware, hours of continuous reading might be enough to finish it off. You can duplicate a damaged volume as a file on another drive using the ddrescue command. You would need to install the gddrescue package into your Live Session. Or you can search for intact files using the photorec command. You would need to install the testdisk package for that.

The Repair Shop solution would be to get the hardware working again. Replace the drive, run a RAM test and a Disks benchmark, then re-install Mint. The problem drive, along with what-has-failed and why-it-failed can then be packed in an anti-static bag and returned to the customer. If they didn't backup their encrypted 1TB partition [coarse-norfolk-explicatives] they are having.
karamjeet

Re: Mounting problem at last step in encryption partition - lvm2

Post by karamjeet »

Hello @Mute_Ant

Thanks for sharing your experience sir really grateful to you for this. I am so glad you answer and will be onwards.

I know ask a lot silly questions, but let me tell you sir i have not enough knowledge to prepare problems like this and even this one is not understandable by me. i am sorry for that. So please give me the answers for both questions in next reply.

The main thing i did not understand is that is my hard drive have got damaged ?

Could my data be recovered ?

I know encryption that is correct.
The read-only check assumed it is an ext4 file system, but it only found 11 things it could recognise as files, in a 1TB space. I guess it's not a lightly-damaged ext4 that can be fixed, it's a large, seriously damaged lump.
Thanks for find out that and to answer about. Is this recoverable sir ?

Copying 1TB takes hours. My machine manages 60MiB/s read and 30MiB/s write. That's 4.5 hours to read the data and 9 hours to write it to a backup drive. If the cause of the initial failure was the drive hardware, hours of continuous reading might be enough to finish it off. You can duplicate a damaged volume as a file on another drive using the ddrescue command. You would need to install the gddrescue package into your Live Session. Or you can search for intact files using the photorec command. You would need to install the testdisk package for that.


No issue sir i can sit for the sake of my data recovery for hours long . The main problem is that i did not understand the exact commands to follow now because in same thread some other expert posted
There is no need to install any packages for LVM as they are already installed. Otherwise you would have never been able to boot.
so due to this i am afraid about doing any installation to avoid any other major loss because i have lesser knowlwdge and experience over terminal commands.
Could you please do me favor for making short list of commands here in next reply? just line by line or if possible like here in this post : viewtopic.php?p=1390737#p1043424


The Repair Shop solution would be to get the hardware working again. Replace the drive, run a RAM test and a Disks benchmark, then re-install Mint. The problem drive, along with what-has-failed and why-it-failed can then be packed in an anti-static bag and returned to the customer. If they didn't backup their encrypted 1TB partition [coarse-norfolk-explicatives] they are having.
I did not get it sir, is this means that i need another hard drive ? i am using this machine at home.
I can have a live chat session with you if it's possible by you. Please help to restore my data. I would be thankful to you.

Thanks a lot.
Mute Ant

Re: Mounting problem at last step in encryption partition - lvm2

Post by Mute Ant »

From a distance I see...

o A standard Ubuntu encrypted OS installation which won't boot past initramfs because it can't mount the root file system.

o Exactly correct manual unlocking works, but shows the same problem, an unmountable, unrepairable 'lump' instead of a root OS.

Normally I would move on to the Repair Shop solution. It's a one-off problem with that drive, not a generic fault in the software, so replace the drive and rebuild a Mint in there. If the owner has a backup, they get an empty machine to restore it. If they don't have a backup, they have the original drive.

"Is my hard drive damaged?" Logically damaged, yes. The file system is damaged so badly it can't be mounted (the start of the problem) and it can't be automatically repaired (shown by your work since). Perhaps an expert in ext4 can rebuild the file-system around what's left, but I am not that expert.

"Could my data be recovered?" If the damage was a random accident, I guess mostly yes. Physically the drive appears to be working if LUKS and LVM unlock correctly. If the damage was deliberate, a ransomware strike for example, I guess mostly no, but that is just a guess.
karamjeet

Re: Mounting problem at last step in encryption partition - lvm2

Post by karamjeet »

Hello @Mute_Ant

Thanks so much sir for clear the things.
Should i give try with "ddrescue" ? (is it a good way to attempt for data recovery)
Or it would solve with new hard drive ? (should i have to purchase a new one than install linux mint)

Thanks again.
Mute Ant

Re: Mounting problem at last step in encryption partition - lvm2

Post by Mute Ant »

ddrescue won't recover any files for you, it copies whole volumes with a tolerant approach to unreadable blocks. You need a destination drive at least as big as the source volume.

photorec will find and duplicate recognisable files on any unmounted volume. You need a destination drive at least as big as the data you are recovering. If that turns out to be too small, you can delete recovered files that you don't need and continue the recovery

It is no problem installing repository software into a Live Session. It is kept in RAM and simply vanishes next boot.
karamjeet

Re: Mounting problem at last step in encryption partition - lvm2

Post by karamjeet »

Hello @Mute_Ant

Thanks a lot so far.

if i directly installed linux mint than it will vanishes all data and partitions. To over come this problem i have one thing in mind.

before going ahead need to discuss with you.

I want to copy the encrypted partition in live linux mint, is it possible do easily ? (will purchase a hard drive and move data to that)

If so than i have question in that case, is this copied partition could be use for data recovery purpose after copied to some where else ?



Thanks.
karamjeet

Re: Mounting problem at last step in encryption partition - lvm2

Post by karamjeet »

Hello @Mute_Ant

can a copy the encrypted disk in live mode and is it correct after copied to other disk that encrypted disk can be recoverable ?

Please reply to me.

Thanks & Regards,
Karamjeet Singh
Locked

Return to “Storage”