LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 05-10-2016, 08:40 AM   #16
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,838

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308

anyone, but especially the badblocks
 
Old 05-10-2016, 08:42 AM   #17
linustalman
LQ Guru
 
Registered: Mar 2010
Location: Ireland
Distribution: Debian 12 Bookworm
Posts: 5,714

Original Poster
Rep: Reputation: 479Reputation: 479Reputation: 479Reputation: 479Reputation: 479
Wink

Quote:
Originally Posted by pan64 View Post
anyone, but especially the badblocks
Ok, thanks.
 
Old 05-10-2016, 08:50 AM   #18
Teufel
Member
 
Registered: Apr 2012
Distribution: Gentoo
Posts: 616

Rep: Reputation: 142Reputation: 142
If badblocks hangs completely it may be due to bad blocks.
Check it for badblocks with HDDScan instead of badblocks.
Start HDDScan, select your device in dropdown list.
Press "Tasks" button and select "Surface tests" item.
When new window appeared check "Read" option and press "Add Test" button. It will start new window with your task added to tasts list. Dowbleckick added task, it will open task details windows, there you can control task executing as map or as graph or as text report. If there are bad blocks you will be informed.

Look screenshots there: http://hddscan.com/

Do not erase a stick, just perform read test to search for bad blocks, especially at the very beginning.

Last edited by Teufel; 05-10-2016 at 08:56 AM.
 
Old 05-10-2016, 09:01 AM   #19
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,838

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
http://superuser.com/questions/68943...ith-i-o-errors
here you can find some links to some tools to try to "low level format" your pendrive and try to repair it, although I definitely cannot guarantee anything.
 
Old 05-10-2016, 09:15 AM   #20
linustalman
LQ Guru
 
Registered: Mar 2010
Location: Ireland
Distribution: Debian 12 Bookworm
Posts: 5,714

Original Poster
Rep: Reputation: 479Reputation: 479Reputation: 479Reputation: 479Reputation: 479
Post

Quote:
Originally Posted by Teufel View Post
If badblocks hangs completely it may be due to bad blocks.
Check it for badblocks with HDDScan instead of badblocks.
Start HDDScan, select your device in dropdown list.
Press "Tasks" button and select "Surface tests" item.
When new window appeared check "Read" option and press "Add Test" button. It will start new window with your task added to tasts list. Dowbleckick added task, it will open task details windows, there you can control task executing as map or as graph or as text report. If there are bad blocks you will be informed.

Look screenshots there: http://hddscan.com/

Do not erase a stick, just perform read test to search for bad blocks, especially at the very beginning.
I am running HDDScan inside VirtualBox -- would that be a problem? I presume it's best to rightclick the exe and run as administrator - which I did. Attached are screenshots of the results for graph, map, & report. It seems to be badblock city *_*.
Attached Thumbnails
Click image for larger version

Name:	Graph.png
Views:	13
Size:	39.2 KB
ID:	21733   Click image for larger version

Name:	Map.png
Views:	13
Size:	51.6 KB
ID:	21734   Click image for larger version

Name:	Report.png
Views:	15
Size:	38.1 KB
ID:	21735  
 
Old 05-10-2016, 09:38 AM   #21
Teufel
Member
 
Registered: Apr 2012
Distribution: Gentoo
Posts: 616

Rep: Reputation: 142Reputation: 142
Quote:
Originally Posted by LinusStallman View Post
I am running HDDScan inside VirtualBox -- would that be a problem? I presume it's best to rightclick the exe and run as administrator - which I did. Attached are screenshots of the results for graph, map, & report. It seems to be badblock city *_*.
Can't say for sure will it work in VirtualBox correctly, screenshot shows that there are a lot of damaged blocks, but at the same time the graph shows that all seems OK. To be correct HDDScan needs full low level access to the drive, without virtualization layer.

Last edited by Teufel; 05-10-2016 at 09:39 AM.
 
Old 05-10-2016, 09:46 AM   #22
linustalman
LQ Guru
 
Registered: Mar 2010
Location: Ireland
Distribution: Debian 12 Bookworm
Posts: 5,714

Original Poster
Rep: Reputation: 479Reputation: 479Reputation: 479Reputation: 479Reputation: 479
Quote:
Originally Posted by Teufel View Post
Can't say for sure will it work in VirtualBox correctly, screenshot shows that there are a lot of damaged blocks, but at the same time the graph shows that all seems OK. To be correct HDDScan needs full low level access to the drive, without virtualization layer.
So the USB drive is salvageable? I have no access to a computer with Windows natively installed on it.
 
Old 05-10-2016, 09:59 AM   #23
sgosnell
Senior Member
 
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian Stable and Unstable
Posts: 1,943

Rep: Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542
Is there any chance this drive has had a gpt partition table installed on it at some time? Mixing gpt and mbr can cause these symptoms. If it has, you need to use gdisk, from Linux, to remove the remaining traces of the gpt table.
 
Old 05-10-2016, 09:59 AM   #24
Teufel
Member
 
Registered: Apr 2012
Distribution: Gentoo
Posts: 616

Rep: Reputation: 142Reputation: 142
Not sure it salvageable.
I have no VirtualBox installed to make conclusion about it behaviour.
I would try to perform low level format as it suggested above, but I suspect that HP Low Level Format tool needs direct access to drive.

Did you try to delete partition table with dd command as it suggested above?

Code:
sudo dd if=/dev/zero of=/dev/sdX bs=1M count=1
 
Old 05-10-2016, 01:45 PM   #25
linustalman
LQ Guru
 
Registered: Mar 2010
Location: Ireland
Distribution: Debian 12 Bookworm
Posts: 5,714

Original Poster
Rep: Reputation: 479Reputation: 479Reputation: 479Reputation: 479Reputation: 479
Unhappy

I had 'sudo dd if=/dev/zero of=/dev/sdf' running for over an hour but nothing happened.

The reason it is sdf and not sdb this time is because I tried it in VirtualBox Win 7 earlier and this changes the drive letter in GNU/Linux.

Last edited by linustalman; 05-10-2016 at 01:46 PM.
 
Old 05-10-2016, 02:37 PM   #26
Teufel
Member
 
Registered: Apr 2012
Distribution: Gentoo
Posts: 616

Rep: Reputation: 142Reputation: 142
No need to run it for hour to erase partition table. It takes one second.
run
Code:
sudo fdisk -l
to see where your stick attached: /dev/sdf or /dev/sdb or somewhere else. It would be nice to detach all the sticks and external usb drives if they attached before running fdisk
then run
Code:
sudo dd if=/dev/zero of=/dev/sdX bs=1M count=1
replace /dev/sdX with the value from fdisk output
dd should return in less than 1 second.
if it returns immediately - open gparted (or use fdisk if you familiar with it) and create new partition table, add partition and format it. Do not use any gnome-***** utility. Only gparted or fdisk.

If it doesn't help - get Vendor ID and Device ID and search web for manufacturer's restoration tool for your device and try to restore flash drive. But this requires native Windows installation to run such a tools (if you can found it), not a VirtualBox installation.

Vendor ID and Device ID can be found from
Code:
sudo lspci -k
and
Code:
sudo lspci -n
output
 
Old 05-11-2016, 05:03 AM   #27
linustalman
LQ Guru
 
Registered: Mar 2010
Location: Ireland
Distribution: Debian 12 Bookworm
Posts: 5,714

Original Poster
Rep: Reputation: 479Reputation: 479Reputation: 479Reputation: 479Reputation: 479
Quote:
Originally Posted by Teufel View Post

Code:
sudo fdisk -l
...
Portion of output:
Code:
WARNING: GPT (GUID Partition Table) detected on '/dev/sdf'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdf: 31.0 GB, 31024349184 bytes
255 heads, 63 sectors/track, 3771 cylinders, total 60594432 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0008b89c

   Device Boot      Start         End      Blocks   Id  System
/dev/sdf1              63    60594431    30297184+   c  W95 FAT32 (LBA)

Last edited by linustalman; 05-11-2016 at 05:04 AM.
 
Old 05-11-2016, 05:07 AM   #28
linustalman
LQ Guru
 
Registered: Mar 2010
Location: Ireland
Distribution: Debian 12 Bookworm
Posts: 5,714

Original Poster
Rep: Reputation: 479Reputation: 479Reputation: 479Reputation: 479Reputation: 479
Unhappy

Quote:
Originally Posted by Teufel View Post
No need to run it for hour to erase partition table. It takes one second.

...

Code:
sudo dd if=/dev/zero of=/dev/sdX bs=1M count=1
...
Both hung:

Code:
sudo dd if=/dev/zero of=/dev/sdf bs=1M count=1
and


Code:
sudo dd if=/dev/zero of=/dev/sdf1 bs=1M count=1
 
Old 05-11-2016, 05:35 AM   #29
linustalman
LQ Guru
 
Registered: Mar 2010
Location: Ireland
Distribution: Debian 12 Bookworm
Posts: 5,714

Original Poster
Rep: Reputation: 479Reputation: 479Reputation: 479Reputation: 479Reputation: 479
Quote:
Originally Posted by sgosnell View Post
Is there any chance this drive has had a gpt partition table installed on it at some time? Mixing gpt and mbr can cause these symptoms. If it has, you need to use gdisk, from Linux, to remove the remaining traces of the gpt table.
Hi sgosnell.

Here's some output from using gdisk:

Code:
GPT fdisk (gdisk) version 0.8.8

Type device filename, or press <Enter> to exit: /dev/sdf
Partition table scan:
  MBR: MBR only
  BSD: not present
  APM: not present
  GPT: not present


***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory. THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by
typing 'q' if you don't want to convert your MBR partitions
to GPT format!
***************************************************************


Warning! Secondary partition table overlaps the last partition by
33 blocks!
You will need to delete this partition or resize it in another utility.

Command (? for help): 


Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/sdf1.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot.
The operation has completed successfully.
Should I convert the 2 partitions to one of these?:
1 - MBR
2 - GPT
3 - Create blank GPT

Last edited by linustalman; 05-11-2016 at 05:36 AM.
 
Old 05-11-2016, 05:51 AM   #30
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,838

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
You can try, but if dd did not work for you .... (this will not either). Did you check post 19?
 
  


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
[SOLVED] How to format a Pen Drive (with USB live image) ? kishor joshi Linux - Newbie 2 07-30-2013 07:50 AM
[SOLVED] USB pen drive format jjonas Linux - Hardware 3 01-15-2012 01:25 PM
Best filesystem to format USB pen drive with to be usable from Windows, Mac, Linux? veeruk101 Linux - Newbie 1 11-04-2011 02:39 PM
[SOLVED] Trying to format Pen drive to ext 3 Tony_photoplus Linux - General 3 01-24-2011 06:39 AM
Software required for recovering data from corrupted pen drive shakes82 Linux - Software 2 07-09-2010 06:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 07:30 PM.

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