LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-17-2018, 12:58 AM   #1
wearetheborg
Member
 
Registered: Sep 2004
Distribution: Mint 19.1
Posts: 298

Rep: Reputation: 41
Bad Superblock with TrueCrypt - How to Fix?


I have two HDDs in my system, one has two truecrypt (non-hidden) partitions /dev/sdb1 and /dev/sdb2

Lately I have been having some read errors, so I decided to do a backup.

/dev/sdb1 gave a lot of read errors like:
Code:
cp: error reading ...: Input/output error

cp: failed to extend...: Input/output error

/dev/sdb2 failed to mount
Code:
Error: mount: wrong fs type, bad option, bad superblock on..
Question 1: How do I fix the bad superblock?
Note that if I give the wrong password, truecrypt immediately says wrong password.

Question 2: Can I fix the input-output errors on /dev/sdb1?

For Question 1, I came across this: https://www.cgsecurity.org/wiki/Reco...ueCrypt_Volume
Under recovery for linux, it says
Find the fuse device and run TestDisk on the volume device.

What's a fuse device, how do I find it?
What's a volume device in my case?


In the code, that page says:
Code:
$ ./truecrypt -t --filesystem=none /data/data_for_testdisk/truecrypt.dd 
Enter password for /data/data_for_testdisk/truecrypt.dd: 
Enter keyfile [none]: 
Protect hidden volume? (y=Yes/n=No) [No]: 
Enter system administrator password: 
$ mount
...
truecrypt on /tmp/.truecrypt_aux_mnt1 type fuse.truecrypt (rw,nosuid,nodev,allow_other)
$ sudo testdisk /tmp/.truecrypt_aux_mnt1/volume
What is /data/data_for_testdisk/truecrypt.dd in my case?

Is the password the trucrypt volume password?

PS: Ext4 filesystem

Last edited by wearetheborg; 05-18-2018 at 12:14 AM.
 
Old 05-17-2018, 06:22 PM   #2
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,501

Rep: Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489
Quote:
Error: mount: wrong fs type, bad option, bad superblock on..
Given the above error, I reviewed your post to find what filesystem you might have on either/both partitions and found nothing. Posting that info would be a good first step. Methods to repair corrupted filesystem, if that is the problem, will vary with filesystem. With regard to fuse, the link below should be helpful.

https://en.wikipedia.org/wiki/Filesystem_in_Userspace
 
Old 05-18-2018, 12:14 AM   #3
wearetheborg
Member
 
Registered: Sep 2004
Distribution: Mint 19.1
Posts: 298

Original Poster
Rep: Reputation: 41
Quote:
Originally Posted by yancek View Post
Given the above error, I reviewed your post to find what filesystem you might have on either/both partitions and found nothing. Posting that info would be a good first step. Methods to repair corrupted filesystem, if that is the problem, will vary with filesystem. With regard to fuse, the link below should be helpful.

https://en.wikipedia.org/wiki/Filesystem_in_Userspace
Thanks. Missed the filesystem!
It is ext4
 
Old 05-18-2018, 07:39 AM   #4
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,501

Rep: Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489
Did you mount sdb2 manually and if so, what exact command did you use?
Problems with filesystems can be somewhat resolved by running a filesystem check, fsck with various options is commonly used on Linux. You can get more details on options using the Search option here at LQ or doing an online search. I don't use encryption so I don't know what effect that might have.
 
Old 05-18-2018, 07:48 AM   #5
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
The first thing I would do if I were you is make exact duplicates of both drives to an external medium, if you have sufficient capacity. You don't want to do any further damage to either filesystem in the process of trying to recover them (or, if you do, you want to be able to revert).

For /dev/sdb2, is it TrueCrypt that is generating the "bad superblock" error?

For recovering from a bad superblock in general, see http://erikimh.com/linux-recover-cor...ad-superblock/

Physically, check the HDD cable connections.
 
Old 05-19-2018, 04:58 AM   #6
wearetheborg
Member
 
Registered: Sep 2004
Distribution: Mint 19.1
Posts: 298

Original Poster
Rep: Reputation: 41
Quote:
Originally Posted by yancek View Post
Did you mount sdb2 manually and if so, what exact command did you use?
Problems with filesystems can be somewhat resolved by running a filesystem check, fsck with various options is commonly used on Linux. You can get more details on options using the Search option here at LQ or doing an online search. I don't use encryption so I don't know what effect that might have.
I mounted using the truecrypt gui.
 
Old 05-19-2018, 05:03 AM   #7
wearetheborg
Member
 
Registered: Sep 2004
Distribution: Mint 19.1
Posts: 298

Original Poster
Rep: Reputation: 41
Quote:
Originally Posted by hydrurga View Post
The first thing I would do if I were you is make exact duplicates of both drives to an external medium, if you have sufficient capacity. You don't want to do any further damage to either filesystem in the process of trying to recover them (or, if you do, you want to be able to revert).

For /dev/sdb2, is it TrueCrypt that is generating the "bad superblock" error?

For recovering from a bad superblock in general, see http://erikimh.com/linux-recover-cor...ad-superblock/

Physically, check the HDD cable connections.

To copy the partitions, would these be the commands I would use?

Code:
dd if=/dev/sdb1 of=/media/sdb1/backup1.img bs=1M
dd if=/dev/sdb2 of=/media/sdb1/backup2.img bs=1M
Yes, for sdb2, it is Truecrypt which is generating the error.
And I get read errors on sdb1, generated from normal cp. Is there any way to fix the read errors?
 
Old 05-19-2018, 05:25 AM   #8
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
I would recommend that you look at ddrescue instead of dd.

Also, you should back up to a completely different device.

Once you have backed up, if you decide to do that (that decision depends on the value of the data you might lose if you don't), use TrueCrypt to mount the first partition and run a fsck on it. You need to concentrate on one of the partitions at a time, and that is the most suitable to start with as you can actually mount it.

Did you check the cables?

Another thing you should do is check the SMART data from the HDD. The drive could be failing.
 
Old 05-19-2018, 01:38 PM   #9
wearetheborg
Member
 
Registered: Sep 2004
Distribution: Mint 19.1
Posts: 298

Original Poster
Rep: Reputation: 41
Quote:
Originally Posted by hydrurga View Post
I would recommend that you look at ddrescue instead of dd.

Also, you should back up to a completely different device.

Once you have backed up, if you decide to do that (that decision depends on the value of the data you might lose if you don't), use TrueCrypt to mount the first partition and run a fsck on it. You need to concentrate on one of the partitions at a time, and that is the most suitable to start with as you can actually mount it.

Did you check the cables?

Another thing you should do is check the SMART data from the HDD. The drive could be failing.

Thanks. I will use ddrescue (to a different device.

It's an internal HDD (I have two internal HDDs), so I don't have cable to worry about.

The drive is failing. SMART checks were quiting with read errors.
 
Old 05-19-2018, 01:50 PM   #10
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by wearetheborg View Post
Thanks. I will use ddrescue (to a different device.

It's an internal HDD (I have two internal HDDs), so I don't have cable to worry about.

The drive is failing. SMART checks were quiting with read errors.
Internal HDDs still have cables to connect them to the motherboard, but that's of no importance if the drive is failing. After you've made an image of it, try to rescue as much as you can from it using e.g. TestDisk & Photorec (was there much on that drive?), not easy when TrueCrypt is also involved.

In the future, it would be much better to make regular backups rather than wait for problems to occur (but easy to say in hindsight).
 
Old 05-21-2018, 05:55 AM   #11
wearetheborg
Member
 
Registered: Sep 2004
Distribution: Mint 19.1
Posts: 298

Original Poster
Rep: Reputation: 41
Quote:
Originally Posted by hydrurga View Post
Internal HDDs still have cables to connect them to the motherboard, but that's of no importance if the drive is failing. After you've made an image of it, try to rescue as much as you can from it using e.g. TestDisk & Photorec (was there much on that drive?), not easy when TrueCrypt is also involved.

In the future, it would be much better to make regular backups rather than wait for problems to occur (but easy to say in hindsight).

Thought I'd give an update

I ran ddrescue on both sdb1 (200GB) and sdb2(500GB partions).
The lost data according to ddrescue was about 3MB for sdb1 and 300kb for sdb2.
Unfortunately the recovered image from sdb1 did not mount under truecrypt.

I tried to repair using testdisk and fsck, but fsck asked to be run manually due to unexpected errors, and after recovery (in which a bunch of things were changed), 50GB is gone, and the rest is in lost+found.

sdb2 was a success story, the image mounts under truecrypt.
 
Old 05-21-2018, 12:04 PM   #12
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
Linux tools don't always account for encryption. Use with caution. The thing about encryption is you can't do a normal rescue, because for that the drive has to be totally unmounted.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mount command yields wrong fs type, bad option, bad superblock kern68 Linux - General 3 01-01-2017 04:20 PM
mount: wrong fs type, bad option, bad superblock on /dev/sda1 dvalente Ubuntu 17 01-31-2016 01:14 PM
[SOLVED] How to Fix Bad Superblock on Pen Drive. hack3rcon Linux - Desktop 2 10-26-2015 04:27 AM
Bad mount of .mdf - "wrong fs type, bad option, bad superblock, on /dev/loop0" Maybe-not Linux - General 2 02-29-2008 01:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration