Skip to contentSkip to conversation

How can i read really 512 byte?

DISCUSSION Janos Haar 3 participants 6 messages Sep 30, 2008 – Oct 1, 2008

lore
Share & tools
lore

Janos Haar

author
#0 lore raw

Hello list,

Now i am working on recover some data from one defective drive.
I am using dd_rescue, and dd, but both ready only 4K, i think, because the kernel's block size is 4K.

I have tried to google for the solution, but only found this trick:

losetup /dev/loop0 /dev/hdc
blockdev --setbsz 512 /dev/hdc

and after this set, trying to read the hdc...

It looks like working on the first look, but not really. :-(
The 512 size bad sectors still have 4K sizes, but the reading attempt takes more (8x ?) longer.

Somebody can help me to set the reading block size to 512 byte?

Thanks a lot,
Janos Haar

#1 lore raw
Quoted 9 lines · Janos Haar

Now i am working on recover some data from one defective drive. I am using dd_rescue, and dd, but both ready only 4K, i think, because the kernel's block size is 4K.

I have tried to google for the solution, but only found this trick:

losetup /dev/loop0 /dev/hdc
blockdev --setbsz 512 /dev/hdc

Quoted 7 lines

and after this set, trying to read the hdc...

It looks like working on the first look, but not really. :-( The 512 size bad sectors still have 4K sizes, but the reading attempt takes more (8x ?) longer.

Somebody can help me to set the reading block size to 512 byte?

You need to add O_DIRECT to the open call in the flags parameter
(the second argument). (My brother tested this a year or so ago,
and it worked for him).

milton

author
#2 lore raw

----- Original Message ----- From: "Milton Miller" <[email protected]>
To: "Janos Haar" <[email protected]>
Cc: <[email protected]>
Sent: Tuesday, September 30, 2008 4:50 PM
Subject: How can i read really 512 byte?

Quoted 16 lines · Janos Haar
Quoted 15 lines

Now i am working on recover some data from one defective drive. I am using dd_rescue, and dd, but both ready only 4K, i think, because the kernel's block size is 4K.

I have tried to google for the solution, but only found this trick:

losetup /dev/loop0 /dev/hdc
blockdev --setbsz 512 /dev/hdc

and after this set, trying to read the hdc...

It looks like working on the first look, but not really. :-( The 512 size bad sectors still have 4K sizes, but the reading attempt takes more (8x ?) longer.

Quoted 7 lines
Quoted 1 line

Somebody can help me to set the reading block size to 512 byte?

You need to add O_DIRECT to the open call in the flags parameter
(the second argument). (My brother tested this a year or so ago,
and it worked for him).

milton

Hello,

Thank you for the information.
Can you help me a little bit more?
Where need to add this parameter?
In the kernel, in the blocked's source, or in the dd_rescue's source?

Thanks,
Janos Haar

#3 lore raw
Quoted 17 lines · Janos Haar
Quoted 12 lines · Janos Haar
Quoted 11 lines

Now i am working on recover some data from one defective drive. I am using dd_rescue, and dd, but both ready only 4K, i think, because the kernel's block size is 4K.
I have tried to google for the solution, but only found this trick:
losetup /dev/loop0 /dev/hdc
blockdev --setbsz 512 /dev/hdc
and after this set, trying to read the hdc...
It looks like working on the first look, but not really. :-( The 512 size bad sectors still have 4K sizes, but the reading attempt takes more (8x ?) longer.
Somebody can help me to set the reading block size to 512 byte?

Quoted 4 lines

You need to add O_DIRECT to the open call in the flags parameter
(the second argument). (My brother tested this a year or so ago,
and it worked for him).
milton

Quoted 6 lines

Hello,

Thank you for the information.
Can you help me a little bit more?
Where need to add this parameter?
In the kernel, in the blocked's source, or in the dd_rescue's source?

dd_rescue ... there is a call to open, add O_DIRECT to the second argument and recompile. If it says unknown identifier, just copy the #define from the kernel header into the dd_rescue source.

milton

#4 lore raw
Quoted 22 lines · Milton Miller
Quoted 19 lines · Janos Haar
Quoted 12 lines · Janos Haar
Quoted 11 lines

Now i am working on recover some data from one defective drive. I am using dd_rescue, and dd, but both ready only 4K, i think, because the kernel's block size is 4K.
I have tried to google for the solution, but only found this trick:
losetup /dev/loop0 /dev/hdc
blockdev --setbsz 512 /dev/hdc
and after this set, trying to read the hdc...
It looks like working on the first look, but not really. :-( The 512 size bad sectors still have 4K sizes, but the reading attempt takes more (8x ?) longer.
Somebody can help me to set the reading block size to 512 byte?

Quoted 4 lines

You need to add O_DIRECT to the open call in the flags parameter
(the second argument). (My brother tested this a year or so ago,
and it worked for him).
milton

Hello,

Quoted 9 lines
Quoted 4 lines

Thank you for the information.
Can you help me a little bit more?
Where need to add this parameter?
In the kernel, in the blocked's source, or in the dd_rescue's source?

dd_rescue ... there is a call to open, add O_DIRECT to the second argument and recompile. If it says unknown identifier, just copy the #define from the kernel header into the dd_rescue source.

C'mon, really.

{pts/0}% dd_rescue -h

dd_rescue Version 1.14, [email protected], GNU GPL
[...]
-b softbs block size for copy operation (def=65536), -B hardbs fallback block size in case of errs (def=512),
[...]
-d/D use O_DIRECT for input/output (def=no),

author
#5 lore raw

----- Original Message ----- From: "Andrey Borzenkov" <[email protected]>
To: "Milton Miller" <[email protected]>; <[email protected]>; "Linux Kernel Mailing List" <[email protected]>
Sent: Wednesday, October 01, 2008 2:36 PM
Subject: Re: How can i read really 512 byte?

Quoted 36 lines
Quoted 22 lines · Milton Miller
Quoted 19 lines · Janos Haar
Quoted 12 lines · Janos Haar
Quoted 11 lines

Now i am working on recover some data from one defective drive. I am using dd_rescue, and dd, but both ready only 4K, i think, because the kernel's block size is 4K.
I have tried to google for the solution, but only found this trick:
losetup /dev/loop0 /dev/hdc
blockdev --setbsz 512 /dev/hdc
and after this set, trying to read the hdc...
It looks like working on the first look, but not really. :-( The 512 size bad sectors still have 4K sizes, but the reading attempt takes more (8x ?) longer.
Somebody can help me to set the reading block size to 512 byte?

Quoted 4 lines

You need to add O_DIRECT to the open call in the flags parameter
(the second argument). (My brother tested this a year or so ago,
and it worked for him).
milton

Hello,

Quoted 9 lines
Quoted 4 lines

Thank you for the information.
Can you help me a little bit more?
Where need to add this parameter?
In the kernel, in the blocked's source, or in the dd_rescue's source?

dd_rescue ... there is a call to open, add O_DIRECT to the second argument and recompile. If it says unknown identifier, just copy the #define from the kernel header into the dd_rescue source.

C'mon, really.

Quoted 8 lines

{pts/0}% dd_rescue -h

dd_rescue Version 1.14, [email protected], GNU GPL
[...]
-b softbs block size for copy operation (def=65536), -B hardbs fallback block size in case of errs (def=512),
[...]
-d/D use O_DIRECT for input/output (def=no),

YES! 8-)
It works! :-)

Thank you wery much for you, and Milton!

Thanks
Janos Haar

Quoted 7 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/