Re: [DNG] Can this drive be saved?

2020-08-29 Thread Gregory Nowak
On Sat, Aug 29, 2020 at 10:36:26PM -0500, goli...@devuan.org wrote:
> On 2020-08-29 22:15, Gregory Nowak wrote:
> >On Sat, Aug 29, 2020 at 09:15:13PM -0500, goli...@devuan.org wrote:
> >>dd if=/dev/zero bs=1M of=/dev/sdx
> >
> >That will just erase the first megabyte of the drive, leaving
> >utilities like cfdisk to think the drive is new and unformatted. It
> >won't attempt to over write the bad sector(s) though. See the other
> >message I posted on how you can try to over write just the bad
> >sector(s) faster.
> >
> >Greg
> 
> Gregory . . .  the detailed instructions in this and your previous email are
> very helpful. Thanks for catching the error.  If needed, I will use this
> command as you suggested:

I just looked at what you posted earlier, and realized that it didn't
give a count= parameter. So, the command you gave earlier would
actually erase the entire drive one megabyte at a time instead of 512
kilobytes at a time, which I believe is the default block size dd
uses.

So, to clarify, 
dd if=/dev/zero bs=1M of=/dev/sdx
would in fact erase the entire drive. Apologies for the confusion.

Greg


-- 
web site: http://www.gregn.net
gpg public key: http://www.gregn.net/pubkey.asc
skype: gregn1
(authorization required, add me to your contacts list first)
If we haven't been in touch before, e-mail me before adding me to your contacts.

--
Free domains: http://www.eu.org/ or mail dns-mana...@eu.org
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Can this drive be saved?

2020-08-29 Thread golinux

On 2020-08-29 22:15, Gregory Nowak wrote:

On Sat, Aug 29, 2020 at 09:15:13PM -0500, goli...@devuan.org wrote:

dd if=/dev/zero bs=1M of=/dev/sdx


That will just erase the first megabyte of the drive, leaving
utilities like cfdisk to think the drive is new and unformatted. It
won't attempt to over write the bad sector(s) though. See the other
message I posted on how you can try to over write just the bad
sector(s) faster.

Greg


Gregory . . .  the detailed instructions in this and your previous email 
are very helpful. Thanks for catching the error.  If needed, I will use 
this command as you suggested:


dd if=/dev/zero of=/dev/sdx

I think this can be marked as "solved" for now.  Will post an update in 
a week or so.


golinux








___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Can this drive be saved?

2020-08-29 Thread Gregory Nowak
On Sat, Aug 29, 2020 at 09:15:13PM -0500, goli...@devuan.org wrote:
> dd if=/dev/zero bs=1M of=/dev/sda

That will just erase the first megabyte of the drive, leaving
utilities like cfdisk to think the drive is new and unformatted. It
won't attempt to over write the bad sector(s) though. See the other
message I posted on how you can try to over write just the bad
sector(s) faster.

Greg


-- 
web site: http://www.gregn.net
gpg public key: http://www.gregn.net/pubkey.asc
skype: gregn1
(authorization required, add me to your contacts list first)
If we haven't been in touch before, e-mail me before adding me to your contacts.

--
Free domains: http://www.eu.org/ or mail dns-mana...@eu.org
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Can this drive be saved?

2020-08-29 Thread golinux
I was wondering if a reformat might be possible but if it requires the 
nuclear option so be it. LOL!  I've only had to dd a handful of times so 
searched and found this command to zero a drive.  Will that get the job 
done?  Any idea how long that might take on a 1 TB drive? There is 
cost|benefit|aggravation to consider . . .


dd if=/dev/zero bs=1M of=/dev/sda

In any case, I'll wait till the dock arrives for further testing to make 
that decision.


Thanks again.  Nice to see that you're still hanging around the campfire 
. . .  :)


On 2020-08-29 19:52, Bruce Perens wrote:
If you just want to reuse the physical drive, without the data, there 
is a
way to do that. Write zeros the entire length of the block device. If 
there
are enough spare sectors left on the disk, the bad ones will be 
relocated

as you write them. The various disk tools will then tell you what the
overall health of the drive is.

On Sat, Aug 29, 2020, 4:12 PM  wrote:


On 2020-08-29 17:15, Bruce Perens via Dng wrote:
> Copy the block partition (not the mounted files) to a same size or
> larger
> blank block partition using ddrescue or gddrescue. Try to mount that
> read
> only and copy the files off. If it doesn't work, try to restore the
> superblock using one of the tutorials online.
>

Thanks Bruce . . .

Unfortunately, I don't have spare 1 TB drives laying around.  Since 
that
drive is an exact copy of another still working drive, no critical 
data

has been lost so no need to copy files.

I'm guessing that this failure is beyond fsck . . .

golinux
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Can this drive be saved?

2020-08-29 Thread Gregory Nowak
On Sat, Aug 29, 2020 at 04:35:01PM -0500, goli...@devuan.org wrote:
> What are the chances of fsck repairing the bad sectors? I shamefully admit I
> have not thought about fsck for years.

This looks to be at the media level, so is most likely beyond
fsck. Since you said you can afford to lose this drive's contents, I
would suggest using dd to fill the drive with zeros:

dd if=/dev/zero of=/dev/sdx

where /dev/sdx is the designation for your drive. This might cause the
drive to reallocate the bad sector, or to mark the bad sector as good
again. Then, run a SMART test on the drive again. If it still fails,
then that drive probably can't be fixed. If the SMART test passes this
time, you can restore your backups on to it and keep using it. If you
do that, be very sure to sync that drive with your other backups
frequently, and don't rely on it exclusively.

If you don't want to wait for dd to write the entire drive, you can try
following this tutorial instead:



It seems to be old, but most if not all of it still seems relevant as
well. You will almost certainly want to run

e2fsck -f /dev/sdx1

at the end of this process before mounting the drive. Good luck.

Greg


-- 
web site: http://www.gregn.net
gpg public key: http://www.gregn.net/pubkey.asc
skype: gregn1
(authorization required, add me to your contacts list first)
If we haven't been in touch before, e-mail me before adding me to your contacts.

--
Free domains: http://www.eu.org/ or mail dns-mana...@eu.org
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Can this drive be saved?

2020-08-29 Thread Bruce Perens via Dng
If you just want to reuse the physical drive, without the data, there is a
way to do that. Write zeros the entire length of the block device. If there
are enough spare sectors left on the disk, the bad ones will be relocated
as you write them. The various disk tools will then tell you what the
overall health of the drive is.

On Sat, Aug 29, 2020, 4:12 PM  wrote:

> On 2020-08-29 17:15, Bruce Perens via Dng wrote:
> > Copy the block partition (not the mounted files) to a same size or
> > larger
> > blank block partition using ddrescue or gddrescue. Try to mount that
> > read
> > only and copy the files off. If it doesn't work, try to restore the
> > superblock using one of the tutorials online.
> >
>
> Thanks Bruce . . .
>
> Unfortunately, I don't have spare 1 TB drives laying around.  Since that
> drive is an exact copy of another still working drive, no critical data
> has been lost so no need to copy files.
>
> I'm guessing that this failure is beyond fsck . . .
>
> golinux
> ___
> Dng mailing list
> Dng@lists.dyne.org
> https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng
>
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Can this drive be saved?

2020-08-29 Thread golinux

On 2020-08-29 18:13, terryc wrote:

On Sat, 29 Aug 2020 16:35:01 -0500
goli...@devuan.org wrote:



PS. There is no critical data on this disk because I always keep
multiple backups. But it would be nice to have that drive functioning
in some capacity.


The only other suggestion is  'the put it in the freezer trick' which
may work until it warms up again, if it is an electro-mechanical
derived fault.



LOL!  I've never had occasion to do that but always wanted to try.  I'll 
wait to see how it works in the dock to eliminate any hardware failure 
in the enclosure first though.  Will report back in a week or so - 
shipping is really slow these days . . .


golinux
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Can this drive be saved?

2020-08-29 Thread terryc
On Sat, 29 Aug 2020 16:35:01 -0500
goli...@devuan.org wrote:


> PS. There is no critical data on this disk because I always keep 
> multiple backups. But it would be nice to have that drive functioning
> in some capacity.

The only other suggestion is  'the put it in the freezer trick' which
may work until it warms up again, if it is an electro-mechanical
derived fault.  

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Can this drive be saved?

2020-08-29 Thread golinux

On 2020-08-29 17:15, Bruce Perens via Dng wrote:
Copy the block partition (not the mounted files) to a same size or 
larger
blank block partition using ddrescue or gddrescue. Try to mount that 
read

only and copy the files off. If it doesn't work, try to restore the
superblock using one of the tutorials online.



Thanks Bruce . . .

Unfortunately, I don't have spare 1 TB drives laying around.  Since that 
drive is an exact copy of another still working drive, no critical data 
has been lost so no need to copy files.


I'm guessing that this failure is beyond fsck . . .

golinux
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Can this drive be saved?

2020-08-29 Thread golinux

On 2020-08-29 16:52, Dimitris via Dng wrote:

On 8/30/20 12:35 AM, goli...@devuan.org wrote:

advice is most welcome.




Thanks, Dimitris . . .


maybe a "long shot" , but did you try another cable/adapter/case for
that disk?



Yes. Tested different usb and adapter.  Have ordered a dock which will 
be able to test the bare drive. Hopefully it will arrive in working 
order. You know how that goes . . .




a few badblocks (?) would slow down the whole disk and maybe not open
some folder(s)...
"input/output error" and smart "read failure" could be something else.



It's not showing any file structure, just a blank page in the file 
manager when the message pops up.

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Can this drive be saved?

2020-08-29 Thread Bruce Perens via Dng
Copy the block partition (not the mounted files) to a same size or larger
blank block partition using ddrescue or gddrescue. Try to mount that read
only and copy the files off. If it doesn't work, try to restore the
superblock using one of the tutorials online.

On Sat, Aug 29, 2020, 2:52 PM Dimitris via Dng  wrote:

> On 8/30/20 12:35 AM, goli...@devuan.org wrote:
> > advice is most welcome.
>
> maybe a "long shot" , but did you try another cable/adapter/case for
> that disk?
>
> a few badblocks (?) would slow down the whole disk and maybe not open
> some folder(s)...
> "input/output error" and smart "read failure" could be something else.
>
>
> ___
> Dng mailing list
> Dng@lists.dyne.org
> https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng
>
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Can this drive be saved?

2020-08-29 Thread Dimitris via Dng
On 8/30/20 12:35 AM, goli...@devuan.org wrote:
> advice is most welcome.

maybe a "long shot" , but did you try another cable/adapter/case for
that disk?

a few badblocks (?) would slow down the whole disk and maybe not open
some folder(s)...
"input/output error" and smart "read failure" could be something else.




signature.asc
Description: OpenPGP digital signature
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


[DNG] Can this drive be saved?

2020-08-29 Thread golinux

Dear Dev1ers,

I have an oldish external 1 TB backup drive that is throwing up this 
mount error.  Drive is single ext4 partition about 70% full:


Error when trying to mount:
Failed to open directory "cstwo".
Error when getting information for file '/media/xx/cstwo/600': 
Input/output error.




Here's the GSmartControl Self-test log.  Note that the drive only has 40 
hours on it!


SMART Self-test log structure revision number 1
Num  Test_DescriptionStatus  Remaining  
LifeTime(hours)  LBA_of_first_error
# 1  Short offline   Completed: read failure   90%40 
412352591
# 2  Extended offlineCompleted: read failure   90%40 
412352591


In the Attributes data the Reallocated sector counts are hilighted in 
pink in 3 places.




What are the chances of fsck repairing the bad sectors? I shamefully 
admit I have not thought about fsck for years.  IIRC, it used to run 
automatically at boot (Squeeze?) which made boot times quite 
frustrating. So I would occasionally run it manually at a more 
convenient time with commands like this (from old saved bash history):


# fsck.ext3 /dev/sdd1
# e2fsck.ext3 /dev/sdd1

Now that prior knowledge has vanished - I can't even remember what 
e2fsck is for - and the above commands may or may not even be valid in 
2020. I actually read man fsck - at least most of it - and there is this 
option which seems like it would be a good idea:


-N Don't execute, just show what would be done.

S . . . will something like this give me any useful info? And if it 
doesn't explode, can I just run the command itself?


# fsck.ext4 /dev/sdc -N

Or am I looking in the wrong direction. I am rather hardware-challenged. 
 :D


Thanks for slogging through this.  Your advice is most welcome.

golinux


PS. There is no critical data on this disk because I always keep 
multiple backups. But it would be nice to have that drive functioning in 
some capacity.



___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] terminology

2020-08-29 Thread Didier Kryn
Le 29/08/2020 à 11:24, Didier Kryn a écrit :
> Le 28/08/2020 à 15:39, Adam Borowski a écrit :
>> On Fri, Aug 28, 2020 at 08:37:07AM -0400, Hendrik Boom wrote:
 Is there an establiched word in the Linux/Unix xommunity
 for something which might be a file or a directory?  
 Therefore it looks to me more like an implementation
 detail than a sensible concept.
>>> I do miss the ability to identify a directory independent of its name.  
>>> It can be important if a directory is renamed and you have active data in 
>>> it.
>>>
>>> There's one directory that works for -- the current directory.  If you 
>>> rename that directory you're still in it.  
>>>
>>> In the 80's or 90's (I forget) there was a proposal to the ISO from 
>>> Japan to establish a standard OS-independent OS interface for 
>>> programmers to use.  I lost against POSIX.
>>>
>>> But it had a machanism whereby opening a file could be done in two 
>>> phases.
>>>
>>> First you get a "lock" on a file.  That gives you a connection to that 
>>> file.  It's not an exclusive kind of lock (unless you ask it to be); 
>>> it's just a way of unambiguously identifying the file as long as it 
>>> exists and you keep the lock.  It hangs on to the file even if someone 
>>> renames it.  (not sure what happens if the file is deleted, though)
>> _Any_ file descriptor does that.  And a deleted file stays there, merely
>> with a 0 link count -- if there's an open descriptor, you can link the file
>> back into the filesystem.  That's even the recommended way to create a new
>> file atomically -- instead of the old write+fsync+rename trick that leaves
>> junk upon a crash.
>     Looks smart. But how do you link the file back? link() and linkat()
> don't take a filedescriptor as input argument for the file. Could you
> please describe the sequence?
>
    OK, got it. the file descriptor can be linked using linkat() with
the flag AT_EMPTYPATH, which tweaks the linkat() API for just that
purpose. I wonder why there isn't a more straightforward API. Good trick
anyway, thanks.

-- 

        Didier


___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng