UFS Cannot set label on UFS disk. The disk is working fine, but without partition table?

A while ago I have created a disk and attached to FreeBSD using ovh.com Block storage.
The disk "is working fine", but I needed to create a label, to make mounting by label, not by device name.

There can be a little mess in mys stem config, advice appreciated!

I have
- zfs pool `zroot` (/dev/da0)
- zfs pool `img1` (/dev/da1)
- UFS /dev/da2 - <<-- this one I have troubles with. I wan tot use it as UFS with label "img2"

The problem is - I can't set a label. `gpart` says that there are no partitions on disk.
Fdisk says /dev/da1 and /dev/da2 has invalid partition tables.

To be honest, I can't remember, how exactly the disk was added and partition, but what I remember - I tried to use it as block storage without additional partitioning. To be easier to extend the disk.
It has been working for me on Ubuntu/Centos systems, but I am a beginner for FreeBSD.

Code:
# zpool list
NAME    SIZE  ALLOC   FREE  EXPANDSZ   FRAG    CAP  DEDUP  HEALTH  ALTROOT
img1    429G   416G  13.4G         -    92%    96%  1.00x  ONLINE  -
zroot   100G  86.7G  13.3G         -    83%    86%  1.00x  ONLINE  -

# mount
zroot/ROOT/default on / (zfs, local, noatime, nfsv4acls)
devfs on /dev (devfs, local, multilabel)
img1 on /img1 (zfs, local, nfsv4acls)
zroot on /zroot (zfs, local, noatime, nfsv4acls)
/img1/images on /www/public/images (nullfs, local)
/dev/da2 on /img2 (ufs, local, soft-updates)

When I try to set a label for `/dev/da2`:

Code:
# tunefs -L img2 /dev/da2
tunefs: /dev/da2: failed to write superblock
# fdisk /dev/da1 <<-- this is ZPOOL disk, but still - invalid partition?
fdisk /dev/da1
******* Working on device /dev/da1 *******
parameters extracted from in-core disklabel are:
cylinders=56132 heads=255 sectors/track=63 (16065 blks/cyl)

Figures below won't work with BIOS for partitions not in cyl 1
parameters to be used for BIOS calculations are:
cylinders=56132 heads=255 sectors/track=63 (16065 blks/cyl)

fdisk: invalid fdisk partition table found
Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
    start 63, size 901760517 (440312 Meg), flag 80 (active)
        beg: cyl 0/ head 1/ sector 1;
        end: cyl 835/ head 254/ sector 63
The data for partition 2 is:
<UNUSED>
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
<UNUSED>


# fdisk /dev/da2
******* Working on device /dev/da2 *******
parameters extracted from in-core disklabel are:
cylinders=39162 heads=255 sectors/track=63 (16065 blks/cyl)

Figures below won't work with BIOS for partitions not in cyl 1
parameters to be used for BIOS calculations are:
cylinders=39162 heads=255 sectors/track=63 (16065 blks/cyl)

fdisk: invalid fdisk partition table found <<-- "INVALID fdisk partition?"
Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
    start 63, size 629137467 (307196 Meg), flag 80 (active)
        beg: cyl 0/ head 1/ sector 1;
        end: cyl 249/ head 254/ sector 63
The data for partition 2 is:
<UNUSED>
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
<UNUSED>

Here is my system information. What I have done wrong and how to fix it?

# uname -a
FreeBSD example.com 11.1-RELEASE-p15 FreeBSD 11.1-RELEASE-p15


Code:
# geom disk list

Geom name: da0
Providers:
1. Name: da0 <<-- this is boot disk
   Mediasize: 107374182400 (100G)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r1w1e2
   descr: QEMU QEMU HARDDISK
   ident: (null)
   rotationrate: unknown
   fwsectors: 63
   fwheads: 255

Geom name: da1 <<-- this ir zfs pool disk
Providers:
1. Name: da1
   Mediasize: 461708984320 (430G)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r1w1e1
   descr: QEMU QEMU HARDDISK
   ident: d0762f61-2738-4138-8
   rotationrate: unknown
   fwsectors: 63
   fwheads: 255

Geom name: da2 <<-- this is "the problem"
Providers:
1. Name: da2
   Mediasize: 322122547200 (300G)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r1w1e1
   descr: QEMU QEMU HARDDISK
   ident: 27b32eed-560a-4dad-a
   rotationrate: unknown
   fwsectors: 63
   fwheads: 255
 
Last edited by a moderator:
FreeBSD example.com 11.1-RELEASE-p15 FreeBSD 11.1-RELEASE-p15
Not related to your issue but you should update, 11.1-RELEASE has been end-of-life since September 2018. Even 11.2-RELEASE will be EoL soon.
 
The whole disk has been used:
Code:
/dev/da2 on /img2 (ufs, local, soft-updates)
So, no partition table and this is what's known as a "dangerously dedicated" disk.
 
Back
Top