Project

General

Profile

Actions

Bug #722

closed

1.9.x slices, newfs, and vinum problem?

Added by c.turner almost 17 years ago. Updated about 15 years ago.

Status:
Closed
Priority:
Urgent
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Hello,

My apologies for not testing earlier .. I'm trying to get my 'test lab'
up to speed in general, so unfortunately I haven't been following the
bleeding edge for all the features I'm using..

Am working on setting up a (physical) test machine running -HEAD as of
about a week ago. Don't think this is an issue as the relavent files
don't appear to have changed since my build.

I am able to create a simple vinum volume as follows:

drive d1 device /dev/ad1s1a
volume vk
plex org concat
sd length 6g drive d1

which passes the 'dd' i/o test
(as well as a more complicated striped volume on ad1s1a and ad3s1a)

but 'newfs -v /dev/vinum/vk' fails

without -v : newfs: /dev/vinum/vk: unable to retrieve geometry
information
with -v : newfs: /dev/vinum/vk: is unavailable

dmesg snippet as follows:

vinum: loaded
vinum: CONFIGURATION OBLITERATED
ad1s1: type 0xa5, start 63, end = 78156287, size 78156225 : OK
vinum: drive d1 is up
ad3s1: type 0xa5, start 63, end = 78156287, size 78156225 : OK
vinum: drive d2 is up
vinum: vk.p0.s0 is up
vinum: vk.p0.s1 is up
vinum: vk.p0 is up
vinum: vk is up
vinumioctl: invalid ioctl from process 759 (newfs): 40886468

So it looks like the disklabel rework broke some assumptions somehow..

on a quick inspection :

sbin/newfs/newfs.c was changed to use the DIOCGPART ioctl to determine
the partition info, rather than an internal? getdisklabel() call
but DIOCGPART is not implemented for vinum,  hitting the 'error' case
in newfs (and explaining the dmesg), which then checks for -v. if no
-v, newfs gives 'unable to recieve..', if -v, nfs uses the stat()
information , assuming the target is a raw file (as newfs was updated
to work with raw files, which is overall useful)
essentially, my guess is that it looks like vinum needs to be
reworked to support the or similar new DIOCGPART ioctl..

So.. I know vinum isn't used by everyone.. if this sounds like the
problem, I can try to take a crack at fixing it, but I doubt I can make
the release branch .. e.g ~1 week at the earliest, owing to my n00b-ness..

Thanks,
- Chris

Actions #1

Updated by corecode almost 17 years ago

[..]

So.. I know vinum isn't used by everyone.. if this sounds like the
problem, I can try to take a crack at fixing it, but I doubt I can make
the release branch .. e.g ~1 week at the earliest, owing to my n00b-ness..

sorry, that slipped through :/

I tried to adapt vinum to the new disk layer, but something fishy is going on and I couldn't track it down. I'll try to have a look.

cheers
simon

Actions #2

Updated by c.turner almost 17 years ago

no worries - glad someones looking at it.. :)

good luck.

- Chris

Actions #3

Updated by dillon almost 17 years ago

:sorry, that slipped through :/
:
:I tried to adapt vinum to the new disk layer, but something fishy is goin=
:g on and I couldn't track it down. I'll try to have a look.
:
:cheers
: simon

We'll need this working for the release.  I'd be happy to take a shot at
it if you don't have time. I don't know if you intended that device
to access via the disk layer or to access the vinum driver directly.
Normally the disk layer takes care of DIOCGPART.
-Matt
Actions #4

Updated by dillon almost 17 years ago

Ok, newfs should now work on volumess. Please test vinum some more.

-Matt
Matthew Dillon
<>
Actions #5

Updated by c.turner almost 17 years ago

Thanks for checking this out.. reviewing the patch, there's no way I
would have figured all that out in that amount of time..

unfortunately, more strangeness -

good bits of disklabel -r /dev/ad1s1:

a:   78156225          0     vinum    #   38162.219M
c: 78156225 0 unused # 38162.219M

- vinum create for the drives as follows:

drive d1 device /dev/ad1s1a
drive d2 device /dev/ad3s1a
fails with the drives being in 'down' state, dmesg reports:
vinum: Can't write config to /dev/ad1s1a, error 30
vinum: Can't write config to /dev/ad3s1a, error 30
(errno.h: #define EROFS 30 /* Read-only file system */)

- newfs /dev/ad1s1a with either vinum or 4.2BSD 'fstype' OK
- mount /dev/ad1s1a with 4.2BSD fstype OK
- ccd as "ccd0 128 none /dev/ad1s1a /dev/ad3s1a"
labels, formats, mounts OK
- dd if=/dev/zero of=/dev/ad1s1a reports
dd: /dev/ad1s1a: Read-only file system
- dd if=/dev/zero of=/dev/ad1s1 is fine
(but blows out the label, as expeced)

when this machine was upgraded to 1.9 a few weeks back,
I made sure to clean out /dev & rebuild, and just did so again
for the ad1 and ad3 devices..

Perhaps I'm misunderstanding the how the new partitions work?

thanks again for investigating

- Chris

Actions #6

Updated by dillon almost 17 years ago

:unfortunately, more strangeness
:
:good bits of disklabel -r /dev/ad1s1:
:
: a: 78156225 0 vinum # 38162.219M
: c: 78156225 0 unused # 38162.219M
:
:
vinum create for the drives as follows:
:
: drive d1 device /dev/ad1s1a
: drive d2 device /dev/ad3s1a
:
: fails with the drives being in 'down' state, dmesg reports:
:
: vinum: Can't write config to /dev/ad1s1a, error 30
: vinum: Can't write config to /dev/ad3s1a, error 30
:
: (errno.h: #define EROFS 30 /* Read-only file system */)
:
:- newfs /dev/ad1s1a with either vinum or 4.2BSD 'fstype' OK
:- mount /dev/ad1s1a with 4.2BSD fstype OK
:- ccd as "ccd0 128 none /dev/ad1s1a /dev/ad3s1a"
: labels, formats, mounts OK
:- dd if=/dev/zero of=/dev/ad1s1a reports
: dd: /dev/ad1s1a: Read-only file system
:- dd if=/dev/zero of=/dev/ad1s1 is fine
: (but blows out the label, as expeced)
:
:when this machine was upgraded to 1.9 a few weeks back,
:I made sure to clean out /dev & rebuild, and just did so again
:for the ad1 and ad3 devices..
:
:Perhaps I'm misunderstanding the how the new partitions work?
:
:thanks again for investigating
:
:- Chris

This is because vinum is trying to write into the label area
for the drive, because you have partition 'a' starting at block #0.
I saw in the code that vinum was write-enabling the label area,
but it really shouldn't. I don't see how it can make such assumptions.
vinum is eating into the boot2 area of the disklabel (offset 4096 of
the 8192 byte label area). Theoretically I could allow this, but it's
really badly polluting assumptions in the label space.
The question is whether we can simply require that vinum partitions
skip the label area (i.e. the starting block has to be at least 16
for a partition created with a normal disklabel) or whether there
are backwards compatibility issues that require us to support vinum
writing into the disk's label area.
-Matt
Matthew Dillon
<>
Actions #7

Updated by corecode almost 17 years ago

The problem is rather that you can place a partition into the label area. This should be off limits.

cheers
simon

Actions #8

Updated by c.turner almost 17 years ago

confirming bumping start up to 16 (per your 8192 number) clears this up,
as well as bumping up to 10 (per sizeof(struct dfly_disklabel)) .

Seeing as it seems like I'm the only one using this,
I'm okay to break backwords compat. :)

just kidding.. sort-of.

- Chris

Actions #9

Updated by dillon almost 17 years ago

:The problem is rather that you can place a partition into the label area. This should be off limits.
:
:cheers
: simon

It's a non-issue with GPT partitions or DragonFly 64 bit disklabels,
since those won't let you create a partition which overlaps the GPT
or disklabel headers.
We don't have boot support for dragonfly 64 bit disklabels yet.  That's
on my list to take a look at after the release.
-Matt
Matthew Dillon
<>
Actions #10

Updated by c.turner almost 17 years ago

Matthew Dillon wrote:

More seriously, I'm not sure if an existing configuration would be
forwards-compatible anyway due to the new label changes if someone had
used 'raw' slices, etc.

Although having to shift the on-disk filesystem layout for upgrade is a
different kind of animal compared to a 'dumpconfig', 'edit slice cfg in
file' 'recreate vinum setup' kind of a change, especially if you have
lots of data on the drives and have to copy it elsewhere to do the shift

I don't have anything setup with a vinum root disk, so not sure if that
is working / related to this portion of the code or not. Hopefully I'll
get around to testing vinum boot one day, but it hasn't arrived yet ..
Without knowing what the in-boot2-location code does thats probably all
I can say without spewing (more :) hot air onto the topic..

I suppose that's a brainstorm for possible impact..

- Chris

Actions #11

Updated by c.turner almost 17 years ago

alright.. scratch all the last message.. whatever is kept there looks to
be related to saving the cfg across boots.. investigating.

Actions

Also available in: Atom PDF