Skip to contentSkip to conversation

BLKBSZSET still not working on 2.4.18 ?

DISCUSSION Ludovic Drolez 4 participants 8 messages Jan 10, 2003 – Jan 13, 2003

lore
Share & tools
lore
#0 lore raw

Hi !

I'm trying to backup a partition on an IDE drive which has an odd number of sectors (204939). With a stock open/read you cannot access the last sector, and that why I tried the BLKBSZSET ioctl to set the basic read block size to 512 bytes. I verified the writen value with BLKBSZGET ioctl, but I still cannot read this last sector !

I've tried also this:
- FreeBSD : works but it don't want to port all my software to it
- raw devices: can't read the last sector:

# raw  /dev/raw1 /dev/hda2
# dd if=/dev/raw1 of=C bs=512
dd: reading `/dev/raw1': No such device or address
204938+0 records in
204938+0 records out

What can it do ? Wait for a patch in 2.5.xxx ?

TIA,

Ludovic Drolez.

#1 lore raw
Quoted 5 lines · Ludovic Drolez

I'm trying to backup a partition on an IDE drive which has an odd number of sectors (204939). With a stock open/read you cannot access the last sector

What can I do ? Wait for a patch in 2.5.xxx ?

Hmm - I recall fixing this both for 2.4 and 2.5.

If that patch is not part of current 2.4, then probably this should be regarded as a known deficiency of 2.4. If I were to maintain a stable 2.4 I would not accept such changes.

You can test 2.5. If it is wrong there I must submit a patch.

Andries

#4 lore raw
In reply to Ludovic Drolez
Quoted 5 lines · Ludovic Drolez

I'm trying to backup a partition on an IDE drive which has an odd number of sectors (204939). With a stock open/read you cannot access the last sector, and that why I tried the BLKBSZSET ioctl to set the basic read block size to 512 bytes. I verified the writen value with BLKBSZGET ioctl, but I still cannot read this last sector !

Its a known 2.4 limitation. The last odd sector isnt normally used by anything so it has never been a big issue (except with EFI partition data). There is a patch to allow the last sector to be recovered but its quite ugly so never went mainstream.

#5 lore raw
Quoted 9 lines
Quoted 5 lines

I'm trying to backup a partition on an IDE drive which has an odd number of sectors (204939). With a stock open/read you cannot access the last sector, and that why I tried the BLKBSZSET ioctl to set the basic read block size to 512 bytes. I verified the writen value with BLKBSZGET ioctl, but I still cannot read this last sector !

Its a known 2.4 limitation. The last odd sector isnt normally used by anything so it has never been a big issue (except with EFI partition data).

Didn't some really obscure IBM drives use it for something internally, and shortly after everybody else had to stop using it incase they overwrote the custom data at the end of an IBM disk, or am I thinking of something else?

John.

#6 lore raw
Quoted 4 lines · John Bradford

Didn't some really obscure IBM drives use it for something internally, and shortly after everybody else had to stop using it incase they overwrote the custom data at the end of an IBM disk, or am I thinking of something else?

Something else - EFI uses the last sector for partitioning as one example. Drives do have protected private areas but they are shielded from normal use for obvious reasons

#7 lore raw
Quoted 9 lines · Alan Cox
Quoted 4 lines · John Bradford

Didn't some really obscure IBM drives use it for something internally, and shortly after everybody else had to stop using it incase they overwrote the custom data at the end of an IBM disk, or am I thinking of something else?

Something else - EFI uses the last sector for partitioning as one example. Drives do have protected private areas but they are shielded from normal use for obvious reasons

There is also a much older matter. In the distant past IBM used the last cylinder for testing. That means that many FDISK versions and many BIOSes subtract one from the number of available cylinders. There are several ways to ask the BIOS for the size of a disk, and some of these calls may invoke others, and then subtract one. I have seen disks that had lost three cylinders that way.

Andries

#2 lore raw
In reply to Andries Brouwer
Quoted 2 lines · Andries Brouwer

You can test 2.5. If it is wrong there I must submit a patch. Andries

It seems to work perfectly with 2.5.56 even without using the BLKBSZSET ioctl.
But, I'm still reluctant to use an unstable kernel for backuping a partition. But maybe the 2.5 is stable enough to read blocks from IDE/SCSI drives, and send them over NFSv2 / IPv4 ?

Cheers,

Signature · 3 lines
Ludovic DROLEZ                                       Free&ALter Soft
152, rue de Grigy - Technopole Metz 2000                  57070 METZ
tel : 03 87 75 55 21                            fax : 03 87 75 19 26
#3 lore raw
Quoted 3 lines · Ludovic Drolez
Quoted 1 line

You can test 2.5. If it is wrong there I must submit a patch.

It seems to work perfectly with 2.5.56

Excellent.

Quoted 3 lines

But, I'm still reluctant to use an unstable kernel for backuping a partition. But maybe the 2.5 is stable enough to read blocks from IDE/SCSI drives, and send them over NFSv2 / IPv4 ?

Stable / unstable is not a binary decision. Some things are broken in 2.4. Many things are broken in 2.5. Still I use 2.5.recent on a daily basis without meeting bad problems (if I refrain from inserting and removing USB devices).
Try, and if it works for you, fine. But no guarantees given.

Andries