Linux - HardwareThis 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.
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.
Oh gosh. I think I walked right into this. I have a powered 2TB USB HDD which I connect to my Centos6 server for backup purposes. On Saturday morning this died. I took it back to the shop and they swapped it for me (I never thought to ask them what kind of policy they have for security on returned drives!)
I formatted the new drive using gparted and plugged it into the server. The plan is to add this to fstab and identify by UUID which I grabbed by ll /dev/devices/by_uuid. Anyway, I have a lot of disks on this box and entered the wrong UUID (lazy Sunday morning, at this point I start thinking it is worth documenting which UUID corresponds to which mount point). I just wanted to make sure I got the right UUID so I disconnected and reconnected the USB cable to the PC. Whoops, I can't see the device any more. And I can't shutdown while the device is connected.
I plugged the drive into another PC running F20 and these are the messages that greet me:
“error on device” doesn't look too promising. I guess the question is, can the disk be rescued?
I read that fsck may be able to help so I gave that a go:
Quote:
[tim@dual ~]$ sudo fsck /dev/sdc1
[sudo] password for tim:
fsck from util-linux 2.24.2
e2fsck 1.42.8 (20-Jun-2013)
fsck.ext2: No such file or directory while trying to open /dev/sdc1
Possibly non-existent device?
[tim@dual ~]$ sudo fsck /dev/sdc
fsck from util-linux 2.24.2
That started about 70 minutes ago and I can leave it running all night if required. It took gparted a good hour to format the disk so I appreciate this may take a while.
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,490
Rep:
If you just unplug a usb drive without unmounting it, you can cause corruption to the filesystem. Also, when you unplug and then re insert a usb drive it likely will get given a different designation, i.e. if it was sdb it could be sdc this time around. You didn't mention which distro you are using nor what filesystem is on your drive, (these should be part of your request for help). However, it does look as if you may well have a corrupt filesystem, possibly the mbr.
I formatted the disk using gparted on a Mint live CD. The file system is ext2.
I originally plugged the disk into a Centos6 system (that is when I unplugged and plugged the USB cable) and it is currently plugged into a F20 system.
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,490
Rep:
See if it (fsck) is doing anything by running 'top' in another terminal.
I would have expected you to have had at least one partition on that disk.
Unless you have a backup of the mbr, I don't think you can recover any files from it, (at least not without a lot of hassle).
Worst case scenario - use fdisk to create a new mbr, partition it anew, and put a new filesystem on it.
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195
Rep:
I might be mistaken but when I see these messages on a hard drive it simply means it is broken. These kind of errors are not caused by partitioning or file system errors. It could be that the interface logic is broken. Especially when you just swapped the drives and the second drive also appears to be defective.
To be sure, pull the drive from the external case and plug it into any other SATA interface.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.