All of lore.kernel.org
 help / color / mirror / Atom feed
* bad sector and unused area.
@ 2021-07-08 21:48 Wakko Warner
  2021-07-08 22:43 ` Reindl Harald
  0 siblings, 1 reply; 5+ messages in thread
From: Wakko Warner @ 2021-07-08 21:48 UTC (permalink / raw)
  To: linux-raid

I have a raid5 of 3 disks.

2 of them have bad sectors.  Sector 1110 and 1118.

I'm curious to know if these sectors actually contain any data or if they
can just be overwritten.

All 3 disks are partitioned with partition starting at sector 128.

The raid was created some time ago.  I have never replaced any of the disks.

mdadm -E of one of the disks shows the following information (just relevent
to the question)
        Version : 1.1
    Data Offset : 262144 sectors
   Super Offset : 0 sectors
   Unused Space : before=262072 sectors, after=290 sectors

Doing the math, from offset 0 to 71 I would assume is the superblock.  Given
the bad sectors as shown by the kernel logs, 1110 and 1118 would fall in the
unused space.

So if I were to dd if=/dev/zero of=/dev/sda count=262072 seek=200, would
this break my array?  This command would be against the whole disk, not
partition.

I do have multiple backups of this system.

FYI, I did initiate a check to verify the data area, and there's no bad
sectors there.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: bad sector and unused area.
  2021-07-08 21:48 bad sector and unused area Wakko Warner
@ 2021-07-08 22:43 ` Reindl Harald
  2021-07-08 23:30   ` Wakko Warner
  0 siblings, 1 reply; 5+ messages in thread
From: Reindl Harald @ 2021-07-08 22:43 UTC (permalink / raw)
  To: Wakko Warner, linux-raid



Am 08.07.21 um 23:48 schrieb Wakko Warner:
> I have a raid5 of 3 disks.
> 
> 2 of them have bad sectors.  Sector 1110 and 1118.
> 
> I'm curious to know if these sectors actually contain any data or if they
> can just be overwritten.

the RAID layer don't know anything about data by definition, it even 
don't care what filesystem is running on top

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: bad sector and unused area.
  2021-07-08 22:43 ` Reindl Harald
@ 2021-07-08 23:30   ` Wakko Warner
  2021-07-09  0:21     ` NeilBrown
  0 siblings, 1 reply; 5+ messages in thread
From: Wakko Warner @ 2021-07-08 23:30 UTC (permalink / raw)
  To: Reindl Harald; +Cc: linux-raid

Reindl Harald wrote:
> 
> 
> Am 08.07.21 um 23:48 schrieb Wakko Warner:
> > I have a raid5 of 3 disks.
> > 
> > 2 of them have bad sectors.  Sector 1110 and 1118.
> > 
> > I'm curious to know if these sectors actually contain any data or if they
> > can just be overwritten.
> 
> the RAID layer don't know anything about data by definition, it even don't
> care what filesystem is running on top

So did you actually read what I said?

    Data Offset : 262144 sectors
   Super Offset : 0 sectors

This is /dev/sda1 which starts at sector 128 of /dev/sda.  Sector 1110 on
/dev/sda is bad.  That would place it between super offset and data offset. 
Thus, there wouldn't be a filesystem there.  I'm asking if it contains any
"data" that might be "used" by "something".  My /dev/md0 data starts at
offset 262144 of /dev/sda1 which is well beyond sector 1110 of /dev/sda.

-- 
 Microsoft has beaten Volkswagen's world record.  Volkswagen only created 22
 million bugs.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: bad sector and unused area.
  2021-07-08 23:30   ` Wakko Warner
@ 2021-07-09  0:21     ` NeilBrown
  2021-07-09  1:56       ` Wakko Warner
  0 siblings, 1 reply; 5+ messages in thread
From: NeilBrown @ 2021-07-09  0:21 UTC (permalink / raw)
  To: Wakko Warner; +Cc: Reindl Harald, linux-raid

On Fri, 09 Jul 2021, Wakko Warner wrote:
> Reindl Harald wrote:
> > 
> > 
> > Am 08.07.21 um 23:48 schrieb Wakko Warner:
> > > I have a raid5 of 3 disks.
> > > 
> > > 2 of them have bad sectors.  Sector 1110 and 1118.
> > > 
> > > I'm curious to know if these sectors actually contain any data or if they
> > > can just be overwritten.
> > 
> > the RAID layer don't know anything about data by definition, it even don't
> > care what filesystem is running on top
> 
> So did you actually read what I said?
> 
>     Data Offset : 262144 sectors
>    Super Offset : 0 sectors
> 
> This is /dev/sda1 which starts at sector 128 of /dev/sda.  Sector 1110 on
> /dev/sda is bad.  That would place it between super offset and data offset. 
> Thus, there wouldn't be a filesystem there.  I'm asking if it contains any
> "data" that might be "used" by "something".  My /dev/md0 data starts at
> offset 262144 of /dev/sda1 which is well beyond sector 1110 of /dev/sda.

If you had an unusually large bitmap, it might use those bad sectors,
but unlikely.
If you reshaped the array to more devices, it would reduce the Data
Offset, so might start writing in that space.

Otherwise you should be safe.

NeilBrown


> 
> -- 
>  Microsoft has beaten Volkswagen's world record.  Volkswagen only created 22
>  million bugs.
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: bad sector and unused area.
  2021-07-09  0:21     ` NeilBrown
@ 2021-07-09  1:56       ` Wakko Warner
  0 siblings, 0 replies; 5+ messages in thread
From: Wakko Warner @ 2021-07-09  1:56 UTC (permalink / raw)
  To: NeilBrown; +Cc: linux-raid

NeilBrown wrote:
> On Fri, 09 Jul 2021, Wakko Warner wrote:
> > Reindl Harald wrote:
> > > 
> > > 
> > > Am 08.07.21 um 23:48 schrieb Wakko Warner:
> > > > I have a raid5 of 3 disks.
> > > > 
> > > > 2 of them have bad sectors.  Sector 1110 and 1118.
> > > > 
> > > > I'm curious to know if these sectors actually contain any data or if they
> > > > can just be overwritten.
> > > 
> > > the RAID layer don't know anything about data by definition, it even don't
> > > care what filesystem is running on top
> > 
> > So did you actually read what I said?
> > 
> >     Data Offset : 262144 sectors
> >    Super Offset : 0 sectors
> > 
> > This is /dev/sda1 which starts at sector 128 of /dev/sda.  Sector 1110 on
> > /dev/sda is bad.  That would place it between super offset and data offset. 
> > Thus, there wouldn't be a filesystem there.  I'm asking if it contains any
> > "data" that might be "used" by "something".  My /dev/md0 data starts at
> > offset 262144 of /dev/sda1 which is well beyond sector 1110 of /dev/sda.
> 
> If you had an unusually large bitmap, it might use those bad sectors,
> but unlikely.
> If you reshaped the array to more devices, it would reduce the Data
> Offset, so might start writing in that space.
> 
> Otherwise you should be safe.

Ok thanks.  I did do a superblock backup on my 3 drives a few months ago.  I
checked offset 72 to offset 262143, it was all 0s.  I assume whatever is
there was on the disk and not wiped when I created the array.

I also dumped the same sectors from each of the disks.  interestingly, what
is stored there is the same on all 3 drives except for the areas that were
bad.

This array has never been reshaped.  It also has never had a disk replaced.

I already DD'd zero to the drive, but only the sectors that were not
readable.  Didn't see any reason not to.  I found it interesting that the
reallocated sectors didn't go up.  The drives have 13 years of power on
time.

This is mdstat:
md0 : active raid5 sda1[0] sdb1[1] sdc1[3]
      488018688 blocks super 1.1 level 5, 64k chunk, algorithm 2 [3/3] [UUU]
      bitmap: 1/2 pages [4KB], 65536KB chunk

And that is the only array on this machine.

-- 
 Microsoft has beaten Volkswagen's world record.  Volkswagen only created 22
 million bugs.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-07-09  1:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-08 21:48 bad sector and unused area Wakko Warner
2021-07-08 22:43 ` Reindl Harald
2021-07-08 23:30   ` Wakko Warner
2021-07-09  0:21     ` NeilBrown
2021-07-09  1:56       ` Wakko Warner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.