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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
07-31-2020, 09:03 AM
|
#1
|
Senior Member
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,127
Rep: 
|
Clonezilla/Partimage - disk has bad sectors
I have an entry level Intel NUC running Ubuntu Mate 20.04 which I use as a headless BitTorrent/Usenet download box. The OS is installed on a Samsung 32 GB flash drive. The internal SSD is used for data storage. Works great. Last evening I decided to take a Clonezilla snapshot of the OS. I removed the flash drive and attempted to clone it in another computer which I use for that purpose. I received an error that Partimage could not copy the partition because "the disk has bad sectors..."
I ran e2fsck -f on the flash drive. The file system checked out perfect. I booted the NUC from the flash drive and copied such files as I wished to keep. I restored an earlier Clonezilla image to another flash drive and updated some files on it from the files saved from the original flash drive. The NUC is back up and running. Now I am looking at the "bad sectors" flash drive and wondering what I can learn from it.
The flash drive does not support SMART so I can learn nothing by that means. I use SMART to check the health of SSDs and mechanical drives. I guess I could try to format it and see what happens. I am not finding much on the Samsung web site.
Does anyone know of a way to test a flash drive in Linux? In the past when one died it really died and I finished it off with a big hammer to make sure the data was really gone then tossed it in the trash. I never had one which was bad and yet the file system on it was fine.
TIA,
Ken
Last edited by taylorkh; 07-31-2020 at 01:03 PM.
|
|
|
07-31-2020, 09:49 AM
|
#2
|
Senior Member
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 22 MATE, Peppermint OS-Devuan, EndeavourOS
Posts: 4,293
|
Ken,
Try installing dcfldd and then test if the drive is faulty.
See post #6:
https://www.linuxquestions.org/quest...dd-4175666671/
|
|
|
07-31-2020, 09:53 AM
|
#3
|
Member
Registered: Oct 2018
Location: texas
Distribution: bodhi 5.1.0
Posts: 797
Rep: 
|
Quote:
Originally Posted by taylorkh
The flash drive does not support SMART
|
i have a couple of external drives (not usb) that initially read as as unsupported and learned that i needed to add the -d sat parameter to help bypass the (usb to sata i think) interface. this page doesn't list samsung specifically, but does mention other type (-d) parameters that might work with usb drives.
from the man page:
Quote:
sat[,auto][,N] - the device type is SCSI to ATA Translation (SAT). This is for ATA disks that have a SCSI to ATA Translation (SAT) Layer (SATL) between the disk and the operating system. SAT defines two ATA PASS THROUGH SCSI commands, one 12 bytes long and the other 16 bytes long. The default is the 16 byte variant which can be overridden with either ´-d sat,12´ or ´-d sat,16´.
|
|
|
|
07-31-2020, 12:12 PM
|
#4
|
Senior Member
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,127
Original Poster
Rep: 
|
Thanks beachboy2,
I will give that a try.
Thanks cordx,
I will look into that also. I have never used smartmontools on a USB drive of any sort that I can remember.
As to the offending flash drive...
I formatted it - no complaints
I created an ext file system on it and copied 20+ GB to it - no complaints
I formatted it again and left it as empty space
I used Clonezilla top burn the image from my new flash drive to it - no complaints
I used Clonezilla to create an image from the previous step - no complaints
It seems that it is now OK. Very strange.
Ken
|
|
1 members found this post helpful.
|
08-01-2020, 08:07 AM
|
#5
|
Senior Member
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,127
Original Poster
Rep: 
|
Update...
I think dcfldd might have been of some use BEFORE I reformatted the flash drive. And I was not able to get any SMART info from the thing. That said...
I noticed that the Clonezilla image which I restored to the suspect flash drive was 16GB in size. It had been taken from a Sandisk 16 GB flash drive which later died. Before I reformatted the drive it had a small boot partition and another partition using up the rest of the 32 GB disk. Apparently I used Gparted to expand the 16 GB image to take up the rest of the 32 GB drive. Thinking that this might have caused an issue (never has before) I expanded the partition on the suspect drive. I ran e2fsck and took a Clonezilla image of the result. No problems.
Bottom line it looks like the flash drive is OK. I guess I will put it back in service.
Ken
p.s. I suppose I should set this thread to resolved as I cannot fix a problem which no longer exists.
|
|
1 members found this post helpful.
|
All times are GMT -5. The time now is 07:26 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|