Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[solved]Howto recover hw-locked pendrive's data?

Need help with peripherals or devices?
Message
Author
p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Howto repair a particular pendrive to again read its dat

#21 Post by p.H »

The pendrive is locked in read-only mode by hardware for ever, bear with it. Setting the device in read-write mode won't help against a hardware lock. Do you seriously believe that setting a CD-ROM device in read-write mode would allow to write on a CD-ROM ?
pylkko wrote:I suggest you dd/ddrescue the data away from the drive and see if you can find a way to use it.
At least a first sensible advice after so many useless posts. The filesystem is damaged and requires write access to be repaired. But write access won't happen on the pendrive.

But the suggested command must be corrected. The pendrive appears to contain two partitions. Partition 1 seems to be mountable and readable as is, so let's concentrate on partition 2.

Create a copy of partition 2 :

Code: Select all

dd if=/dev/sdc2 of=partition2.img bs=4k
ddrescue is not needed if the pendrive can be read without error.
bkpsusmitaa wrote:Won't the resulting .img file be readable by any ISO reading package?
Of course not. Why do so many people confuse a disk image and an ISO 9660 filesystem ?
Any image is not an "ISO" image. Disk or partition images do not usually contain an ISO 9660 filesystem, one exception being installation/live hybrid images. Only images of optical media may be ISO images.

/dev/sdc2 contains an ext4 filesystem, so the image file contains an ext4 filesystem too. It can be mounted like a regular partition with the mount command (the "-o loop" option is not required any more) or checked with e2fsck.

User avatar
RU55EL
Posts: 546
Joined: 2014-04-07 03:42
Location: /home/russel

Re: Howto repair a particular pendrive to again read its dat

#22 Post by RU55EL »

bkpsusmitaa wrote:[...]When I want to learn, people don't help me beyond a certain point, but point at the internet resources. Indirectly, they appear to say to me, that for me to know the real areas I need to pay them. Man, I am ready to pay you! But who decides that the transaction and the cost is precise and fair?[...]
No one here appears to be seeking pay in any form. I think it's more like: "Give a man a fish and he eats for a day. Teach a man how to fish and he eats for a lifetime."

If you are accessing this forum, you are sitting in front of a machine that has access to huge quantities of information, good, bad and in between. By pointing someone toward good information, you are helping them learn to find the answers themselves, rather than simply giving them the answer.

Of course, your mileage may vary. Each one of use see things from our own unique perspective.

bkpsusmitaa
Posts: 485
Joined: 2009-07-04 06:32
Location: Home: Barrackpore and Mysore
Has thanked: 5 times

Re: Howto repair a particular pendrive to again read its dat

#23 Post by bkpsusmitaa »

Thank you, Pyikko, RUSSEL, p.H., for the belated warm-up!
The 'fish and fishing' gospel is alright! But suppose the pupil doesn't have eyesight. How will you teach the pupil 'fishing'. Don't say you can't teach him. That's your demerit. Example, Helen Keller. That is what I counter-teach! Each one according to his own way!
I didn't want codes. I put forward questions. I desire specific answers or counter-questions for further clarity, neither codes, nor advises, unless I request specifically.
Piykko says,
... something along the lines that because people don't do your work for you ...
No, I frankly don't ask them that.
Pyikko further says:
... one with stuff about God and morality) two times after that and maybe you deleted this content away ...
Pyikko, I am an atheist. I don't talk about God. I say that morality can exist very well without God. If you let it, I mean! It is your choice! I just edited my post for better comprehension, that's all. I didn't delete.

Friends, don't post anything any more! If I require your suggestions and advises, I will ask specific questions. You please answer specifically. No code helps, just explanations, if required.
Last edited by bkpsusmitaa on 2017-10-14 05:08, edited 1 time in total.
Freedom is impossible to conceive.
Books that help:
Dale Carnegie's How To Win Friends And Influence People and Emilie Post's Etiquette In Society, In Business, In Politics, And At Home

bkpsusmitaa
Posts: 485
Joined: 2009-07-04 06:32
Location: Home: Barrackpore and Mysore
Has thanked: 5 times

Re: Howto repair a particular pendrive to again read its dat

#24 Post by bkpsusmitaa »

p.H wrote:/dev/sdc2 contains an ext4 filesystem, so the image file contains an ext4 filesystem too. It can be mounted like a regular partition with the mount command (the "-o loop" option is not required any more) or checked with e2fsck.
Great insight! That was what I was trying to know! You are my man!
p.H wrote: ... The pendrive is locked in read-only mode by hardware for ever ...
&
p.H wrote: ... But write access won't happen on the pendrive ...
Yeah! This is what I was intuitively guessing! How did you know? The clues? Please explain.
p.H wrote:Why do so many people confuse a disk image and an ISO 9660 filesystem ?
Because the information overload made it difficult for me to know more about disk images and details about Disk Imaging. Also look at the reply to my query. It will illustrate the matter better than I could explain!
p.H wrote: ... ddrescue is not needed if the pendrive can be read without error ...
Yes, the fat32 partition can be read/written.
Freedom is impossible to conceive.
Books that help:
Dale Carnegie's How To Win Friends And Influence People and Emilie Post's Etiquette In Society, In Business, In Politics, And At Home

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Howto repair a particular pendrive to again read its dat

#25 Post by p.H »

bkpsusmitaa wrote:How did you know? The clues? Please explain.
From this message in the kernel log :

Code: Select all

[ 2549.667988] sd 6:0:0:0: [sdc] Write Protect is on
I have learnt from experience this is a firmware/hardware lock.

User avatar
pylkko
Posts: 1802
Joined: 2014-11-06 19:02

Re: Howto repair a particular pendrive to again read its dat

#26 Post by pylkko »

But several posts ago you were told that the kernel log is indicating the the disk is read only and that therefore this is very likely not a mounting problem... but a hardware/firmware problem.

http://forums.debian.net/viewtopic.php? ... 23#p655942

However, notice that this has only been told to you by people that you don't know on the internet, and not by kernel documentation/manual or other official source.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Howto repair a particular pendrive to again read its dat

#27 Post by p.H »

pylkko wrote:the disk is read only and that therefore this is very likely not a mounting problem... but a hardware/firmware problem.
It is both.
- The filesystem is not clean and cannot been mounted without being fixed (it probably just need a journal recovery).
- Fixing the filesystem requires writing to it but the underlying storage device is read only. So it cannot be fixed, so it cannot be mounted.

The primary problem is the filesystem state, not the read only state. The other partition on the same read-only device could be mounted (read only of course), because its filesystem was clean enough.

Digging deeper, it is likely that the filesystem is in an unclean state because it was mounted when the device became read-only and prevented any further pending write.
Last edited by p.H on 2017-10-14 09:22, edited 1 time in total.

User avatar
pylkko
Posts: 1802
Joined: 2014-11-06 19:02

Re: Howto repair a particular pendrive to again read its dat

#28 Post by pylkko »

p.H wrote:
pylkko wrote:the disk is read only and that therefore this is very likely not a mounting problem... but a hardware/firmware problem.
It is both.
- The filesystem is not clean and cannot been mounted without being fixed fixed (it probably just need a journal recovery).
- Fixing the filesystem requires writing to it but the underlying storage device is read only. So it cannot be fixed, so it cannot be mounted.

The primary problem is the filesystem state, not the read only state. The other partition on the same read-only device could be mounted (read only of course), because its filesystem was clean enough.

Digging deeper, it is likely that the filesystem is in an unclean state because it was mounted when the device became read-only and prevented any further pending write.
So something like this?
http://forums.debian.net/viewtopic.php? ... 23#p656041

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Howto repair a particular pendrive to again read its dat

#29 Post by p.H »

I can only speculate about the reason why the device became read-only.

bkpsusmitaa
Posts: 485
Joined: 2009-07-04 06:32
Location: Home: Barrackpore and Mysore
Has thanked: 5 times

Re: Howto repair a particular pendrive to again read its dat

#30 Post by bkpsusmitaa »

Pyikko, please don't enter into an academic argument in my thread.

If you desire for an academic argument, you are free to create your own thread and free to invite p.H. to your thread.

This is my thread, and I have decided that I am going to ask p.H. my questions stepwise, because he is near my wavelength.

Piykko, you have said:

Code: Select all

... ... But several posts ago you were told that the kernel log is indicating the the disk is read only and that therefore this is very likely not a mounting problem... but a hardware/firmware problem.  ... ...
But you only said so. We are science-believing rationalists. We like to be pointed to the evidence.

Mr. p.H. pointed to the exact code. He is the teacher for me, he is a teacher, believes in and practices transparency, prima facie. You are apparently not! You didn't practice transparency in your interactions. Why, I don't know, and don't need to know! It is your perspective and your angle, and I respect them. You are welcome to follow your value system.

I thank you, RUSSEL and Debiman for interacting this long with me and compelling me to multiply raise and waive the red-herrings to attract the right kind of people,
Freedom is impossible to conceive.
Books that help:
Dale Carnegie's How To Win Friends And Influence People and Emilie Post's Etiquette In Society, In Business, In Politics, And At Home

bkpsusmitaa
Posts: 485
Joined: 2009-07-04 06:32
Location: Home: Barrackpore and Mysore
Has thanked: 5 times

Re: Howto repair a particular pendrive to again read its dat

#31 Post by bkpsusmitaa »

To p.H.,
I have read about Ext4 but that is only academic knowledge. If I could look at one Logical Block what I am I likely to encounter? Not the academic symbolism or theoretical/pictorial concept-building drawing, but hard-core values, in digits! And for two contiguous LBs?

I looked at the outputs from the two applications, (1) gparted, (2) dmesg and (3) e2fsck. I quote them below. One says that the block is ext4 while the other, ext2.

Code: Select all

Libparted 2.3
Check and repair file system (ext4) on /dev/sdc2  00:00:00    ( ERROR )

Code: Select all

[ 2650.406111] EXT4-fs (sdc2): INFO: recovery required on readonly filesystem

Code: Select all

e2fsck: Bad magic number in super-block while trying to open /dev/sdc

The superblock could not be read or does not describe a correct ext2
filesystem.  If the device is valid and it really contains an ext2
Last edited by bkpsusmitaa on 2017-10-14 10:02, edited 1 time in total.
Freedom is impossible to conceive.
Books that help:
Dale Carnegie's How To Win Friends And Influence People and Emilie Post's Etiquette In Society, In Business, In Politics, And At Home

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Howto repair a particular pendrive to again read its dat

#32 Post by p.H »

bkpsusmitaa wrote:e2fsck: Bad magic number in super-block while trying to open /dev/sdc
You did not run fsck on the right device. The filesystem is in the partition /dev/sdc1, not the whole drive /dev/sdc.

bkpsusmitaa
Posts: 485
Joined: 2009-07-04 06:32
Location: Home: Barrackpore and Mysore
Has thanked: 5 times

Re: Howto repair a particular pendrive to again read its dat

#33 Post by bkpsusmitaa »

I had, but forgot to post.

Code: Select all

sudo e2fsck -f -n -v /dev/sdc1

Code: Select all

e2fsck 1.42.5 (29-Jul-2012)
ext2fs_open2: Bad magic number in super-block
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open /dev/sdc1

The superblock could not be read or does not describe a correct ext2
filesystem.  If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
Freedom is impossible to conceive.
Books that help:
Dale Carnegie's How To Win Friends And Influence People and Emilie Post's Etiquette In Society, In Business, In Politics, And At Home

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Howto repair a particular pendrive to again read its dat

#34 Post by p.H »

My mistake, the ext4 filesystem is in the second partition /dev/sdc2.
According to your previous messages, the first partition contains a FAT filesystem.

User avatar
pylkko
Posts: 1802
Joined: 2014-11-06 19:02

Re: Howto repair a particular pendrive to again read its dat

#35 Post by pylkko »

bkpsusmitaa wrote:Pyikko, please don't enter into an academic argument in my thread.

If you desire for an academic argument, you are free to create your own thread and free to invite p.H. to your thread.

This is my thread, and I have decided that I am going to ask p.H. my questions stepwise, because he is near my wavelength.

Piykko, you have said:

Code: Select all

... ... But several posts ago you were told that the kernel log is indicating the the disk is read only and that therefore this is very likely not a mounting problem... but a hardware/firmware problem.  ... ...
But you only said so. We are science-believing rationalists. We like to be pointed to the evidence.

Mr. p.H. pointed to the exact code. He is the teacher for me, he is a teacher, believes in and practices transparency, prima facie. You are apparently not! You didn't practice transparency in your interactions. Why, I don't know, and don't need to know! It is your perspective and your angle, and I respect them. You are welcome to follow your value system.

I thank you, RUSSEL and Debiman for interacting this long with me and compelling me to multiply raise and waive the red-herrings to attract the right kind of people,
I don't know what you mean by academic discussion and that you have p.h as your teacher. But I do understand that you do not want me to write more in this thread. But when you blame me for not being 'transparent', I would like to say that in my opinion that is just factually and morally wrong. You have an attitude problem. The fact that you refer to there is deductible from many other factors in addition to the one line of output and if you suggest that I deliberately obfuscated where exactly it is stated is just mean especially taking into consideration that I was trying to, well, help you for nothing in return. You need to grow up.

bkpsusmitaa
Posts: 485
Joined: 2009-07-04 06:32
Location: Home: Barrackpore and Mysore
Has thanked: 5 times

Re: Howto repair a particular pendrive to again read its dat

#36 Post by bkpsusmitaa »

Pyikko,
But when you blame me for not being 'transparent'
I did not blame you, I simply said, with evidence, that you were not transparent.
You have an attitude problem.
I won't deny when you say that, when I caused you hurt. I feel the same. But some things need to be said as clearly as possible.
You need to grow up.
We keep growing our entire lives! So I can't grow up! :-)

Thank you for understanding! Hope that on hindsight, i.e., when you look back, this interaction gives you ample windows of opportunities to mend your ways. Now I need to stop engaging with you and be with Mr. p.H. and learn from him.
Freedom is impossible to conceive.
Books that help:
Dale Carnegie's How To Win Friends And Influence People and Emilie Post's Etiquette In Society, In Business, In Politics, And At Home

bkpsusmitaa
Posts: 485
Joined: 2009-07-04 06:32
Location: Home: Barrackpore and Mysore
Has thanked: 5 times

Re: Howto repair a particular pendrive to again read its dat

#37 Post by bkpsusmitaa »

p.H., if you look at this post, you would see that I had posted the outputs for

Code: Select all

e2fsck -f -n -v /dev/sdc2
.
The output included these comments:

Code: Select all

e2fsck 1.42.5 (29-Jul-2012)
Warning: skipping journal recovery because doing a read-only filesystem check.
While:

Code: Select all

sudo e2fsck -f -n -v /dev/sdc1
outputs:

Code: Select all

e2fsck 1.42.5 (29-Jul-2012)
ext2fs_open2: Bad magic number in super-block
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open /dev/sdc1

The superblock could not be read or does not describe a correct ext2
filesystem.  If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
I apologise for an erroneous comment earlier. The filesystem sdc1 is read-only, not read-write. I had erroneously stated that I could read-write.

I can very well understand that it is easy to lose perspective, amidst all these cacophony going around us. Would you like me to coalesce all the posts and repost in one, so that both you and I are clear as to which next step do we need to take next?

Code: Select all

sudo e2fsck -f -n -v /dev/sdc2

Code: Select all

e2fsck 1.42.5 (29-Jul-2012)
Warning: skipping journal recovery because doing a read-only filesystem check.
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

       29666 inodes used (9.22%, out of 321920)
          88 non-contiguous files (0.3%)
          12 non-contiguous directories (0.0%)
             # of inodes with ind/dind/tind blocks: 0/0/0
             Extent depth histogram: 29601/51
      731236 blocks used (56.83%, out of 1286656)
           0 bad blocks
           1 large file

       27577 regular files
        2074 directories
           0 character device files
           0 block device files
           0 fifos
           0 links
           6 symbolic links (6 fast symbolic links)
           0 sockets
------------
       29657 files
I finally remember: I had also kept a snapshot for uploading but Debian Forum has picture quota exceeded. So I could not upload, and then forgot altogether to post a link of, the snapshot to my Google Drive. I have now! Apologise again!
Last edited by bkpsusmitaa on 2017-10-14 12:34, edited 3 times in total.
Freedom is impossible to conceive.
Books that help:
Dale Carnegie's How To Win Friends And Influence People and Emilie Post's Etiquette In Society, In Business, In Politics, And At Home

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: Howto repair a particular pendrive to again read its dat

#38 Post by debiman »

did you look at this person's blog?
clearly they're on a mission, one that involves A LOT of preaching.
i don't think we can stop them (to get them to listen).
well, maybe someone can stop them from posting...

bkpsusmitaa
Posts: 485
Joined: 2009-07-04 06:32
Location: Home: Barrackpore and Mysore
Has thanked: 5 times

Re: Howto repair a particular pendrive to again read its dat

#39 Post by bkpsusmitaa »

p.H.I am not aware of any command line version similar to gparted. If there is please let me know, if you are comfortable with the command line outputs. Posted the e2fsck for either of the partitions, and the gparted link image in the earlier post.
Last edited by bkpsusmitaa on 2017-10-15 00:11, edited 1 time in total.
Freedom is impossible to conceive.
Books that help:
Dale Carnegie's How To Win Friends And Influence People and Emilie Post's Etiquette In Society, In Business, In Politics, And At Home

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Howto repair a particular pendrive to again read its dat

#40 Post by Head_on_a_Stick »

bkpsusmitaa wrote:I am not aware of any command line version similar to gparted. If there is please let me know
https://packages.debian.org/stretch/parted

@OP, your posts are too prolix.
deadbang

Post Reply