LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 09-29-2022, 10:16 AM   #16
TaoMao
Member
 
Registered: Sep 2022
Posts: 45

Original Poster
Rep: Reputation: 0

Quote:
Originally Posted by mrmazda View Post
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.
 
Old 09-29-2022, 10:17 AM   #17
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,596

Rep: Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545

edit: [redundant/retracted]

 
Old 09-29-2022, 11:26 AM   #18
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
Quote:
Originally Posted by TaoMao View Post
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.
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.
 
Old 09-29-2022, 01:33 PM   #19
elgrandeperro
Member
 
Registered: Apr 2021
Posts: 415
Blog Entries: 2

Rep: Reputation: Disabled
Personally, lets see how far it can read. This just reading the whole disk to /dev/null:

dd if=/dev/sda of=/dev/null bs=1024 status=progress

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.
 
Old 09-30-2022, 01:24 PM   #20
TaoMao
Member
 
Registered: Sep 2022
Posts: 45

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by computersavvy View Post
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.
 
Old 09-30-2022, 01:52 PM   #21
TaoMao
Member
 
Registered: Sep 2022
Posts: 45

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by elgrandeperro View Post
Personally, lets see how far it can read. This just reading the whole disk to /dev/null:

dd if=/dev/sdb of=/dev/null bs=1024 status=progress

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
Regarding DD rescue. I used:
Code:
 sudo ddrescue -d -r3 /dev/sdb test.img test.logfile
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
 
Old 09-30-2022, 02:27 PM   #22
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
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.
 
Old 10-01-2022, 06:14 AM   #23
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,499

Rep: Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489
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.
 
Old 10-01-2022, 07:16 AM   #24
TaoMao
Member
 
Registered: Sep 2022
Posts: 45

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by yancek View Post
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.


No idea why this happened to both disks lol
 
Old 10-01-2022, 07:39 AM   #25
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
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.
 
Old 10-01-2022, 12:38 PM   #26
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,499

Rep: Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489
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.

https://www.cgsecurity.org/wiki/TestDisk
 
Old 10-01-2022, 01:27 PM   #27
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
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.
 
Old 10-01-2022, 01:58 PM   #28
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
Quote:
Originally Posted by computersavvy View Post
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.
 
Old 10-02-2022, 10:29 AM   #29
Jan K.
Member
 
Registered: Apr 2019
Location: Esbjerg
Distribution: Windows 7...
Posts: 773

Rep: Reputation: 489Reputation: 489Reputation: 489Reputation: 489Reputation: 489
Post 1 and 9, sda, post 11, sda1, post 12, sdb1 and sdc1, post 15 and 21, sdb
 
Old 10-02-2022, 01:02 PM   #30
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
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.
 
  


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
Installing Linux Mint 19.1 cinnamon to an external hard drive & backing up to another external hard drive. bluelakecompany@yahoo.co Linux - Newbie 1 01-23-2019 06:30 PM
ubuntu installed on external hard drive, can't startup without external hard drive. Vanostaajen Linux - Software 23 01-20-2009 09:59 AM
Ubuntu: Installed to external hard drive; boot to primary hard drive gives error 22 dcorb62 Linux - General 7 09-04-2007 11:28 PM
external enclosure for an internal hard drive vs external USB hard drive powah Linux - Hardware 1 03-10-2006 09:03 AM
Installing grub to external USB hard drive for later use as internal hard drive dhave Linux From Scratch 2 12-10-2005 08:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:14 AM.

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