NetBSD-Users archive

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

Re: Access FFS partition on GPT on ZVOL



Hello Michael,

Am 03.09.2022 um 17:59 schrieb Michael van Elst:
mp%petermann-it.de@localhost (Matthias Petermann) writes:

saturn$ doas dkctl /dev/zvol/rdsk/tank/backup/vhost/vol/net-export=20
addwedge myexport 34 2147483581 ffs
dkctl: /dev/zvol/rdsk/tank/backup/vhost/vol/net-export: addwedge:=20
Inappropriate ioctl for device

A zvol is no disk and doesn't support partitions or wedges.


/dev/zvol/rdsk/tank/backup/vhost/vol/net-export
ccdconfig: ioctl (CCDIOCSET): /dev/rccd0d: Block device required
saturn$ doas ccdconfig -cv ccd0 0=20
/dev/zvol/dsk/tank/backup/vhost/vol/net-export
ccdconfig: ioctl (CCDIOCSET): /dev/rccd0d: Inappropriate ioctl for device=

ccd learned about wedges in 9.99.74, it wasn't pulled up to netbsd-9.


Maybe the diskmapper (LVM driver) can help, without LVM metadata you
need to manually create a mapping table and install it with 'dmsetup create'.


Thanks for the tip. I didn't know that the device mapper exists in such an accessible form in NetBSD (at least I saw it only as a necessary accessory for LVM and not as a standalone feature). However, I am not getting anywhere here either.... what is wrong with my attempts yet? Does anyone have any ideas?

Here is what I do:


- using NetBSD 9.3

```
saturn$ uname -a
NetBSD saturn.local 9.3_STABLE NetBSD 9.3_STABLE (GENERIC) #0: Tue Aug 9 04:04:53 UTC 2022 root@jupiter.local:/build/netbsd-9/obj/sys/arch/amd64/compile/GENERIC amd64
```

- list GPT of ZVOL

```
saturn$ doas gpt show /dev/zvol/rdsk/tank/backup/vhost/vol/net-export
       start        size  index  contents
           0           1         PMBR
           1           1         Pri GPT header
           2          32         Pri GPT table
          34  2147483581      1  GPT part - NetBSD FFSv1/FFSv2
  2147483615          32         Sec GPT table
  2147483647           1         Sec GPT header
```

- create a device

```
saturn$ doas dmsetup create net-export --table "34 2147483581 linear /dev/zvol/rdsk/tank/backup/vhost/vol/net-export 0"
create and load called

```

- check if it is there

```
saturn$ ls -la /dev/mapper/
total 92
drwxr-xr-x   2 root  wheel        512 Sep  7 09:22 .
drwxr-xr-x  11 root  wheel      43520 Sep  7 09:22 ..
crw-rw----   1 root  operator  194, 0 Sep  7 09:22 control
brw-r-----   1 root  operator  169, 1 Sep  7 09:22 net-export
crw-r-----   1 root  operator  194, 1 Sep  7 09:22 rnet-export
```

- retrieve further information from DM

```
saturn$ doas dmsetup info
Name:              net-export
State:             ACTIVE
Read Ahead:        0
Tables present:    None
Open count:        0
Event number:      0
Major, minor:      169, 1
Number of targets: 0

saturn$ doas dmsetup status
net-export:

saturn$ doas dmsetup ls
net-export      (169, 1)
```

- try to mount

```
saturn$ doas mount -t ffs -o ro /dev/mapper/net-export /mnt/
mount_ffs: /dev/mapper/net-export on /mnt: incorrect super block
```

- try to dump first bytes of device

```
saturn$ doas hexdump -C -n 32768 /dev/mapper/rnet-export
saturn$
```

Since the hexdump does not spit out any data, I suspect that the DM-Device is not set up correctly. The message during the mount attempt appears to me only as a subsequent error.

Kind regards
Matthias


Home | Main Index | Thread Index | Old Index