tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

rwd0a and label sector marked read-only

Hi list,

A few days back I tried to restore partition images through dd(1).

After setting up the labels, next step was to restore the partitions directly through their rwd* devices.

Everything went fine, except for the "a" label, due to the sector that contains the labels' description. By default, it is marked as read-only, hence returning EROFS when using dd directly:

dd if=/mnt/rwd0a.img of=/dev/rwd0a
dd: /dev/rwd0a: Read-only file system
2+0 records in
1+0 records out
512 bytes transferred in 0.001 secs (512000 bytes/sec)

Of course, playing with skip/seek works around the issue. Marking the labels as writable (through disklabel -W) is another solution.

However, I have a few questions:

- is such behaviour expected when manipulating the char device directly?
- why EROFS and not EPERM?
- why is it possible to override the aforementioned sector when using label d (under x86) directly, and not when using other labels? Should the checks be any different?

Many thanks in advance for your answers!

Jean-Yves Migeon

Home | Main Index | Thread Index | Old Index