Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
Please keep the command used with its output when you paste here, so what actually happened is perfectly clear, free of contained commentary, and please also use Code tags ( # ) rather than PHP tags around what you paste.
No partitioning on the external drive may be indirectly the reason why all this trouble started. It's highly recommended for less experienced users to stick to conventional methods as much as possible, which includes partitioning of large storage media, as was done with your sdb and sdc. Before committing new data to your unionsine drive, I recommend you partition and format it.
Thanks for the formatting tips.
I did format the drive before using. Had read you don't need to partition external drives that the OS isn't on and so didn't unfortunately.
I did format the drive before using. Had read you don't need to partition external drives that the OS isn't on and so didn't unfortunately.
Unfortunately some say partitioning is not required, and sometimes that is correct. However, it is always a good idea to create at least one partition on every device then format that file system before use. Some systems and hardware do not function well when the file system is formatted onto the bare device with no partition since in most cases a partition table is expected. This is particularly true when working with ntfs or any other non-native file system on linux. Windows will always force a partition to be defined before it can use a drive.
I know you tried ddrescue, but did not post the failed output. You would think fdisk would read the first blocks for the type and partition, but lets see if see how far it gets.
Unfortunately some say partitioning is not required, and sometimes that is correct. However, it is always a good idea to create at least one partition on every device then format that file system before use. Some systems and hardware do not function well when the file system is formatted onto the bare device with no partition since in most cases a partition table is expected. This is particularly true when working with ntfs or any other non-native file system on linux. Windows will always force a partition to be defined before it can use a drive.
I think you might be right about this as my other external HD that is 2 months old now doesn't seem to want to mount lol
I'll keep going with trying to fix the other first as don't wanna mangle people's heads.
I know you tried ddrescue, but did not post the failed output. You would think fdisk would read the first blocks for the type and partition, but lets see if see how far it gets.
Here is the output of /dev/null
Code:
dd: error reading '/dev/sdb': Input/output error
16+0 records in
16+0 records out
16384 bytes (16 kB, 16 KiB) copied, 0.233957 s, 70.0 kB/s
As last time no % was being rescued, last time it got to 16GB with 0%. I got scared it was damaging the disk. However the drive is 10TB and I only had used 800GB....so maybe that's why?
Code:
ipos: 270336 kB, non-trimmed: 277938 kB, current rate: 0 B/s
opos: 270336 kB, non-scraped: 0 B, average rate: 3276 B/s
non-tried: 11999 GB, bad-sector: 0 B, error rate: 1048 kB/s
rescued: 65536 B, bad areas: 0, run time: 19s
pct rescued: 0.00%, read errors: 4339, remaining time: n/a
time since last successful read: 18s
Copying non-tried blocks... Pass 5 (forwards)^C
I'll describe what I did with my drive when it developed bad sectors. Maybe you will get some ideas from this.
My storage box emailed me about a drive dropped from zpool. I ran 'smartctl -t long' on it and sure enough, test aborted. I took a note of failed block location. Generally, the drive should reallocate bad sectors by itself. Did not happen. Next I tried to force bad block realloction by forcing reading it, didn't help. Then I tried to write to this sector [with dd]. Miraculously the bad sector disappeared. Now smartctl test passed, while the drive was still reporting reallocation count zero. This remains mystery for me. Did my write attempt fix it or there is some truth in rumors manufacturers hide first (10?) reallocations from user? It is RAIDZ-2, thus I have some freedom to mess with drives without physically removing them. (Indeed, there is a backup of this server.) After I "fixed" this sector I included this drive in zpool again, since I messed up only three sectors with dd it was quickly resilvered. Anyway, this drive has been in service for another 10 thousand hours now without further problems. Go figure.
Note: Your drive is external, its USB/SATA interface may be braindead type which puts the drive to sleep in its own, causing smartctl test to abort. If this is the case maybe it has eSATA port, using this will give you full control over drive.
How many drives do you have? An earlier post showed sdd as a 223GB drive and you also show an SSD as 238GB with an EFI and Linux partition and the last post shows sda and sdb with no partition or filesystems. If one of the last 2 drives was partitioned and a filesystem was created (ntfs) it didn't appear to work. If you want an ntfs filesystem, I would suggest you use windows to create the partition and filesystem.
How many drives do you have? An earlier post showed sdd as a 223GB drive and you also show an SSD as 238GB with an EFI and Linux partition and the last post shows sda and sdb with no partition or filesystems. If one of the last 2 drives was partitioned and a filesystem was created (ntfs) it didn't appear to work. If you want an ntfs filesystem, I would suggest you use windows to create the partition and filesystem.
I have an internal SSD that is EFI and Linux file systems.
When I first began this I had a second external drive, 8TB, that was NTFS and working fine. But now it's saying it has no file system or disk label also. However I was able to run GSMART on that drive and the quick test said there were no errors.
Gsmart is frontend for smartctl. Not sure what this "quick test" is, but if it is just reading SMART data from drive then it is meaningless, there must be a real test run before reading.
If you have a drive with an ntfs filesystem it would be best to try to repair it with windows tools. If you have data on it, try using testdisk to recover if you cannot access it then create another partition with a filesystem on the drive.
I am wondering how you did the write with dd mentioned in post #22.
There you say you wrote to the "bad sector" but nothing else about what was done. We would need to know precisely the structure of the command using dd to be able to evaluate if it was used properly.
It seems likely that writing with dd to that drive without carefully ensuring that dd only wrote to the specified sector may have wiped out the beginning of the drive and as such you now have a bare, unpartitioned and unformatted drive that nothing except a low level tool like dd (or fdisk/gdisk) can access. If so then it will not be accessible until new filesystem/partitioning is done.
I know of no way to tell dd precisely what sector to write to, particularly since the sectors are file system level and are dependent upon whether you do or do not have a partition table involved
I hope you used something like this to select that sector; and that you were careful to write to the exact location and not at the beginning of the drive.
I am wondering how you did the write with dd mentioned in post #22.
There you say you wrote to the "bad sector" but nothing else about what was done. We would need to know precisely the structure of the command using dd to be able to evaluate if it was used properly.
It seems likely that writing with dd to that drive without carefully ensuring that dd only wrote to the specified sector may have wiped out the beginning of the drive and as such you now have a bare, unpartitioned and unformatted drive that nothing except a low level tool like dd (or fdisk/gdisk) can access. If so then it will not be accessible until new filesystem/partitioning is done.
I know of no way to tell dd precisely what sector to write to, particularly since the sectors are file system level and are dependent upon whether you do or do not have a partition table involved
I hope you used something like this to select that sector; and that you were careful to write to the exact location and not at the beginning of the drive.
I don't think you understood what I did and why. I merely described how I got rid of a bad sector, hoping our OP can get ideas what tools and how can be used. I think I missed the target completely. I was not requesting help from forum members. My disk is still functioning as part of a zpool, thank you.
Yes you can use seek and count to specify the location to write and how many sectors to write. It is all in man dd.
This is a new external drive. Must be under warranty. Have it replaced and end of story. In future keep in mind any drive can fail any time, data what you care about must be backed up. For instance, I have RAIDZ-2 for storage, it can tolerate failure of two drives. In addition I have a backup of this RAIDZ-2 storage in another box which has RAIDZ.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.