Current-Users archive

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

Re: swap on cgd: disklabel: disklabel write (sector 0) size 8192 failed: Read-only file system



On 04/18/11 21:54, Jean-Yves Migeon wrote:
> On 18.04.2011 21:06, Hugo Silva wrote:
>> On 04/18/11 19:39, Jean-Yves Migeon wrote:
>>> On 18.04.2011 20:13, Hugo Silva wrote:
>>>> Hello,
>>>>
>>>> Trying to setup swap on cgd on a 5.1/amd64 Xen domU (following
>>>> http://www.netbsd.org/docs/misc/#cgd-swap); Here's what I get:
>>>>
>>>> # cat /etc/cgd/xbd1b
>>>> algorithm aes-cbc;
>>>> iv-method encblkno1;
>>>> keylength 128;
>>>> verify_method none;
>>>> keygen randomkey;
>>>>
>>>> # cgdconfig cgd0 /dev/xbd1b /etc/cgd/xbd1b
>>>> # disklabel -eI cgd0
>>>> (change 4.2BSD to swap)
>>>> disklabel: disklabel write (sector 0) size 8192 failed: Read-only file
>>>> system
>>>>
>>>> in dmesg:
>>>> cgd0: error 30 ("read-only filesystem")
>>>>
>>>> What's even stranger is that I can newfs cgd0a..
>>>>
>>>> Thoughts?
>>>
>>> Probably EROFS when trying to write to the sector that contains the
>>> disklabel?
>>>
>>> What happens when you use "disklabel -W" ?
>>
>> # disklabel -W cgd0
>> # disklabel -e cgd0
>> /tmp//EdDk.a04828a: 23 lines, 546 characters.
>> disklabel: ioctl DIOCWDINFO: Read-only file system
>> re-edit the label? [y]: n
> 
> Rather on xbd1. My guess is that cgd0 tries to overwrite the disklabel
> of xbd1, hence the "EROFS" error. Could you give the output of
> "disklabel /dev/xbd1d"?
> 


# disklabel /dev/xbd1d


# /dev/xbd1d:
type: ESDI
disk: Xen Virtual ESDI
label: fictitious
flags:
bytes/sector: 512
sectors/track: 2048
tracks/cylinder: 1
sectors/cylinder: 2048
cylinders: 2048
total sectors: 4194304
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0

4 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
 b:   4194304         0       swap                     # (Cyl.      0 -
  2047)
 d:   4194304         0     unused      0     0        # (Cyl.      0 -
  2047)




The -W on xbd1d did it. Your guess is correct, as cgd0 reports total
sectors: 4194304, same as xbd1.

I fixed the disklabel on xbd1 to start at offset 63 and reduced a's size
accordingly. Rebooted the domU, and now it works (well, almost- it's
unrelated, but feel free to have a look at
http://mail-index.netbsd.org/port-xen/2011/04/18/msg006645.html)

Now I understand what was happening; the "read only filesystem" error is
a bit cryptic though! :)

Thanks for the tip.

Regards,

Hugo


Home | Main Index | Thread Index | Old Index