Index: head/sys/cam/ata/ata_da.c =================================================================== --- head/sys/cam/ata/ata_da.c +++ head/sys/cam/ata/ata_da.c @@ -3420,6 +3420,8 @@ softc->disk->d_fwheads = softc->params.heads; ata_disk_firmware_geom_adjust(softc->disk); softc->disk->d_rotation_rate = cgd->ident_data.media_rotation_rate; + snprintf(softc->disk->d_attachment, sizeof(softc->disk->d_attachment), + "%s%d", softc->cpi.dev_name, softc->cpi.unit_number); } static void Index: head/sys/cam/mmc/mmc_da.c =================================================================== --- head/sys/cam/mmc/mmc_da.c +++ head/sys/cam/mmc/mmc_da.c @@ -1532,6 +1532,8 @@ part->disk->d_hba_device = cpi.hba_device; part->disk->d_hba_subvendor = cpi.hba_subvendor; part->disk->d_hba_subdevice = cpi.hba_subdevice; + snprintf(part->disk->d_attachment, sizeof(part->disk->d_attachment), + "%s%d", cpi.dev_name, cpi.unit_number); part->disk->d_sectorsize = mmc_get_sector_size(periph); part->disk->d_mediasize = media_size; Index: head/sys/cam/nvme/nvme_da.c =================================================================== --- head/sys/cam/nvme/nvme_da.c +++ head/sys/cam/nvme/nvme_da.c @@ -815,6 +815,8 @@ disk->d_hba_device = cpi.hba_device; disk->d_hba_subvendor = cpi.hba_subvendor; disk->d_hba_subdevice = cpi.hba_subdevice; + snprintf(disk->d_attachment, sizeof(disk->d_attachment), + "%s%d", cpi.dev_name, cpi.unit_number); disk->d_stripesize = disk->d_sectorsize; disk->d_stripeoffset = 0; disk->d_devstat = devstat_new_entry(periph->periph_name, Index: head/sys/cam/scsi/scsi_cd.c =================================================================== --- head/sys/cam/scsi/scsi_cd.c +++ head/sys/cam/scsi/scsi_cd.c @@ -702,6 +702,8 @@ softc->disk->d_hba_device = cpi.hba_device; softc->disk->d_hba_subvendor = cpi.hba_subvendor; softc->disk->d_hba_subdevice = cpi.hba_subdevice; + snprintf(softc->disk->d_attachment, sizeof(softc->disk->d_attachment), + "%s%d", cpi.dev_name, cpi.unit_number); /* * Acquire a reference to the periph before we register with GEOM. Index: head/sys/cam/scsi/scsi_da.c =================================================================== --- head/sys/cam/scsi/scsi_da.c +++ head/sys/cam/scsi/scsi_da.c @@ -2875,6 +2875,8 @@ softc->disk->d_hba_device = cpi.hba_device; softc->disk->d_hba_subvendor = cpi.hba_subvendor; softc->disk->d_hba_subdevice = cpi.hba_subdevice; + snprintf(softc->disk->d_attachment, sizeof(softc->disk->d_attachment), + "%s%d", cpi.dev_name, cpi.unit_number); /* * Acquire a reference to the periph before we register with GEOM. Index: head/sys/geom/geom_disk.h =================================================================== --- head/sys/geom/geom_disk.h +++ head/sys/geom/geom_disk.h @@ -118,6 +118,7 @@ uint16_t d_hba_subvendor; uint16_t d_hba_subdevice; uint16_t d_rotation_rate; + char d_attachment[DISK_IDENT_SIZE]; /* Fields private to the driver */ void *d_drv1; Index: head/sys/geom/geom_disk.c =================================================================== --- head/sys/geom/geom_disk.c +++ head/sys/geom/geom_disk.c @@ -528,7 +528,10 @@ else if (g_handleattr_uint16_t(bp, "GEOM::rotation_rate", dp->d_rotation_rate)) break; - else + else if (g_handleattr_str(bp, "GEOM::attachment", + dp->d_attachment)) + break; + else error = ENOIOCTL; break; case BIO_FLUSH: Index: head/usr.sbin/diskinfo/diskinfo.c =================================================================== --- head/usr.sbin/diskinfo/diskinfo.c +++ head/usr.sbin/diskinfo/diskinfo.c @@ -251,6 +251,10 @@ printf("\t%-12s\t# Disk descr.\n", arg.value.str); if (ioctl(fd, DIOCGIDENT, ident) == 0) printf("\t%-12s\t# Disk ident.\n", ident); + strlcpy(arg.name, "GEOM::attachment", sizeof(arg.name)); + arg.len = sizeof(arg.value.str); + if (ioctl(fd, DIOCGATTR, &arg) == 0) + printf("\t%-12s\t# Attachment\n", arg.value.str); if (ioctl(fd, DIOCGPHYSPATH, physpath) == 0) printf("\t%-12s\t# Physical path\n", physpath); printf("\t%-12s\t# TRIM/UNMAP support\n",