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

Getting your soundcard to work, using Debian on non-i386 hardware, etc

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

Postby pylkko » 2017-10-12 11:43

bkpsusmitaa wrote:
pylkko wrote:... But if the drive is failing and some parts of it cannot be read ...
Let's set aside the negative scenarios. Which applications could be used to read those backups? Brasero, K3B?


Well, you could search Google to get answers to questions like this immediately . But I can tell you that you can just mount disk images.

Write to .img then mount it or write it to a new USB stick, SD card whatever you want.
User avatar
pylkko
 
Posts: 1208
Joined: 2014-11-06 19:02

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

Postby bkpsusmitaa » 2017-10-13 02:18

So in the present endeavour I learnt somewhat about hdparm and ddrescue, particularly, that the man hdparm and info ddrescue are huge files and need time to comprehend.
What remains is to learn, in which file format does the ddrescue store the disk data, and which packages could be used to read and write that data into a DVD-RW! Pyikko says that Google should help! Very well, I will search Google. Thank you, Pyikko, Debiman and HOAS! But what I needed was knowing your personal experiences, personal angles, pointers to where exactly to look into, ...

I can use the metaphor of a medieval, impregnable castle. But having been designed by men, it must have some points of weakness, or some special places from where one could stealthily enter. I was likewise expecting you to provide me with the unique angles with the help of which I could grasp the Big Picture of recovering data in the affected partitions.

I acknowledge that I would need time to read the info ddrescue exhaustively to recover the data contained therein.
But there is one thing that I learnt: Never to partition a pendrive for optimisation!

This present exercise helped me learn a very pertinent issue: Why the system fails.

I found that the internet is virtually a limitless repository of information. So much that it causes information overload. Now regarding the present exercise, I would have liked to get professional help. I have nothing against paying the professionals for the services they provide. We are not supposed to know everything, so we turn to the specialists, who are in position to help us. Ideally, such a world would be full of specialists, and if we encounter problems we can't solve, we approach the specialists and they solve our problems, and life becomes very smoothly operable.

But looking at the grocers, the hawkers and the like, we find by interactions and experiences that people can't be trusted. To trust people we have to cultivate them: be with them, study their interactions with other people, their value systems, et al. That is a huge investment of time and energy. So, as a matter of safety we lose trust and by limiting how the immoral opportunists could harm us, we also deny the moral opportunists from helping us!

Now, in such a scenario, life becomes overbearing! Nothing seems to work. and people aren't happy anywhere, except when they believe in God and miracle! Morality without God appears impossible, whereas it shouldn't have been.

If we look at the Happy Planet Index, we find that no country that has advanced science and technology has its people happy! The happy people are in the poor, ill-educated, technologically backward countries. Which in turn reinforces the adage: Ignorance Is Bliss.

But I am sure that morality could very well exist without God. There was no reason for one to squeeze out a little more from the other, in the cases of business transactions. But at this very point people fail. Some give a little more than necessary, some take a little more than necessary. This doesn't seem enormous!

But considering the sheer number of transactions, those tiny little displeasures of losing tiny little extra and the elation of squeezing out extra, add up to make a Tsunami, and ruin civilisations in the end.

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?

Perhaps this is why, despite its obvious advantages, FOSS fails, while secrecy, proprietary software, etc., continue to prevail. And generally, Good fails, while Immoral Opportunism continues to be successful.
Last edited by bkpsusmitaa on 2017-10-13 15:19, edited 2 times in total.
Freedom is impossible to conceive.
bkpsusmitaa
 
Posts: 333
Joined: 2009-07-04 06:32
Location: Home: Barrackpore and Mysore

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

Postby bkpsusmitaa » 2017-10-13 07:19

The pages I found in Google with the string "recover pendrive partition ddrescue". I will record how I began the process of learning, so that someone like me, searching for solution, stumbles on to this page.

Found the following first links among 38,000 pages.

ddrescue - recovery of usb flash drive: extracted image is full of zeros ...

https://unix.stackexchange.com/.../reco ... -is-full...

Aug 20, 2016 - You haven't any chance to rescue data from the USB
flash. I think the flash was zeroed. But you can try to find the lost
partition by testdisk , look ...

Guide to Using DDRescue to Recover Data - Technibble

https://www.technibble.com
Blog › On the Job

/dev/sdb, which is my attached USB drive and contains a
single partition: /dev/sdb1 ... As you can see in this
screenshot, ddrescue failed to recover 512 bytes.

Get Your Data Back with Linux-Based Data Recovery Tools - Linux.com

https://www.linux.com/learn/get-your-da ... very-tools

Feb 13, 2015 - Thankfully, Linux is no stranger to data recovery.
... system from either the CD or USB drive and then uses the
tools to work with your file system. ... Let's use Ddrescue
to copy a partition from drive /dev/sdg to drive /dev/sdb.

DataRecovery - Community Help Wiki - Official Ubuntu Documentation

https://help.ubuntu.com/community/DataRecovery

Feb 6, 2017 - Run Parted from the command line to recover
your partition. ... GNU ddrescue (packaged as
gddrescue, though once installed the command is "ddrescue")
... (VFAT) filesystem (usually found on USB drives) to store
the image, ...

linux - Partition table corrupted (USB flash drive) - Super User

https://superuser.com/questions/32825/p ... lash-drive

It may be worth running testdisk over the device, it sounds like
your partition table may have gone pop. Testdisk ...
ddrescue is a data recovery tool. It copies
data ...

linux - Do I need to format/partition ddrescue destination drive ...

https://superuser.com/questions/1221411 ... ../1221416

Jun 21, 2017 - No. ddrescue will prepare everything for
you. You just need to setup things after the rescue, but only if the
partition table was damaged.

My flash pendrive is damaged! How to recover data using ddrescue ...

blog.hakimodo.pl/my-flash-pendrive-is-damaged-how-to-recover-data-using-ddrescue/

Oct 30, 2013 - How to recover data using ddrescue?
... pendrive In march 2013 my flash pendrive has
gone crazy. This is an unwanted situation .... 9 14:26:46 localhost
kernel: [74411.049173] sdb: unknown partition table Mar 9
14:26:46 ...

How to Clone Hard Disks with ddrescue | Datarecovery.com

https://datarecovery.com/rd/how-to-clon ... -ddrescue/

Aug 20, 2015 - At Datarecovery.com, we recommend contacting a data
recovery expert at ... a system rescue disk for Linux that
can be used as a bootable USB ...

Recovering data from a dead Windows (NTFS) disk using Linux | Vlad ...

https://vtopan.wordpress.com/.../recove ... isk-usin...

Nov 15, 2009 - Up until a while ago, particularly if the
partitions were formatted with NTFS, the ... It also has a
data-recovery-oriented cousin called ddrescue,
which ... prefix means a serial disk (usually an internal SATA or
external USB disk).

Restore hard disk partitions and files in Linux Mint - Linux Mint Guide

https://mintguide.org › Tools

May 21, 2015 - ... hard disk, a
scratched CD with photos of your beloved deceased pet, or even a
flash drive. ... Software to recover hard disk
partitions, files and data .... 3. ddrescue is a
very useful utility with its unique and interesting history.

... ... ...
Freedom is impossible to conceive.
bkpsusmitaa
 
Posts: 333
Joined: 2009-07-04 06:32
Location: Home: Barrackpore and Mysore

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

Postby bkpsusmitaa » 2017-10-13 07:51

I ignored the very first link with stackexchange. It is a difficult place for those who are initiating a new experiment. I would treat it as a place for bullies.

The second contains a lot of information about using ddrescue through a possible Linux booted system called Parted Magic. I went through the page and collected the necessary information available. Since we already have a Linux system, the Learning Curve would not be very steep for us.

The third one contains an ncurses application called testdisk in addition to ddrescue. I have a Knoppix system, so entered
Code: Select all
whereis testdisk
and found it pre-installed.

I am continuing to read and find out solutions.
Last edited by bkpsusmitaa on 2017-10-14 09:04, edited 1 time in total.
Freedom is impossible to conceive.
bkpsusmitaa
 
Posts: 333
Joined: 2009-07-04 06:32
Location: Home: Barrackpore and Mysore

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

Postby pylkko » 2017-10-13 17:19

I noticed that you wrote something along the lines that because people don't do your work for you, that is because linux fails and that proprietary is where you get real help. I see that you edited your long rant (the one with stuff about God and morality) two times after that and maybe you deleted this content away. Anyway, here's the thing: it has nothing to do with proprietary or free/open source. There are indeed data recovery businesses that will help you, and they will charge the same price whether or not you are on Windows or a free OS. A very very high price... I wouldn't be surprised if it was it was many times higher if you are on a proprietary system. People here don't have any interest or need to help you, and they probably have their own lives, jobs and families that they attend to before the attend to you. And that they do so, is not because they are greedy or immoral, it is because that's how life works.

You need to learn at least three things here:

1) You absolutely need to realize something that most people realize immediately. Consumer grade (cheap chinese) USB pendrives and other flash storage media are low quality POS when it comes to data reliability. The manufacturers themselves think of these products as single-use plastic cups. I just now went to see how much my closest computer parts store charges for an enterprise USB (Kingston Ironkey 32 GB)... the price is... wait for it... 700 USD. So what can we conclude here? Well the sad truth is that you should never, ever store anything important on a USB pendrive. These devices are only good for temporary storage/moving data from one place to another. They are cheap enough that when you have any problem/they stop working, you use a new one.

2) You always should have a backup. If you have a backup, you don't need to study cryptic data recovery magic off the internet for hours and hours. You made your choice, you chose that you don't want an easy life. Is it the fault of God? Is it the fault of greedy selfish Westeners? Is the fault of open source? No, understanding morality begins with facing the facts/reality.

3) You suggest - between the lines - that experienced users here don't want to help you because, surely, someone has done what you want to do. No. That is just wrong. The more experienced the user is, the more likely it is that they have never let themselves in the situation where they need to use data recovery software. Only beginners need it.

Now, let me help you after all this lecturing.

This page seems to explain how disk images are made on linux with fairly easy to undertsand English and examples:

https://www.linuxnix.com/what-you-shoul ... d-command/

dd is a tool that makes an image and ddrescue is a similar too that is fault tolerant, that is it will continue to read the disk even though it is broken/there are areas that cannot be read:
https://www.technibble.com/guide-using- ... over-data/

It will write zeros to areas that cannot be read. When you read an entire disk, if these bad areas happen to be inside some files, then perhaps only these files will be corrupt and broken. If, however, these bad areas happen to be in the "index" of the disk the entire resulting disk image might be unreadable. Both of these tools allow you to write partitions or disks to many different file formats (.iso or .img or others). When you have this file, you can either mount it in a file manager and use it like other directories in your computer or burn it to a cd or dvd or write it again to usb stick/sd card/hard drive.

There are recovery tools like the testdisk that you mention that can try to "guess" a data structure of disk image that has missing information.
User avatar
pylkko
 
Posts: 1208
Joined: 2014-11-06 19:02

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

Postby p.H » 2017-10-13 20:33

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.
p.H
 
Posts: 176
Joined: 2017-09-17 07:12

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

Postby RU55EL » 2017-10-13 22:02

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.
User avatar
RU55EL
 
Posts: 329
Joined: 2014-04-07 03:42
Location: /home/russel

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

Postby bkpsusmitaa » 2017-10-14 01:23

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.
bkpsusmitaa
 
Posts: 333
Joined: 2009-07-04 06:32
Location: Home: Barrackpore and Mysore

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

Postby bkpsusmitaa » 2017-10-14 05:07

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.
bkpsusmitaa
 
Posts: 333
Joined: 2009-07-04 06:32
Location: Home: Barrackpore and Mysore

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

Postby p.H » 2017-10-14 07:36

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.
p.H
 
Posts: 176
Joined: 2017-09-17 07:12

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

Postby pylkko » 2017-10-14 07:41

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.

viewtopic.php?f=7&t=134923#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.
User avatar
pylkko
 
Posts: 1208
Joined: 2014-11-06 19:02

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

Postby p.H » 2017-10-14 07:59

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.
p.H
 
Posts: 176
Joined: 2017-09-17 07:12

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

Postby pylkko » 2017-10-14 08:28

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?
viewtopic.php?f=7&t=134923#p656041
User avatar
pylkko
 
Posts: 1208
Joined: 2014-11-06 19:02

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

Postby p.H » 2017-10-14 08:41

I can only speculate about the reason why the device became read-only.
p.H
 
Posts: 176
Joined: 2017-09-17 07:12

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

Postby bkpsusmitaa » 2017-10-14 09:02

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.
bkpsusmitaa
 
Posts: 333
Joined: 2009-07-04 06:32
Location: Home: Barrackpore and Mysore

PreviousNext

Return to Hardware

Who is online

Users browsing this forum: No registered users and 4 guests

fashionable
cron