Hi,
I'm using mdconfig to mount UFS snapshots.
The following code is used to create a device for a given snapshot:
and the following code is used to delete the device:
It works fine, but the device number (md0, md1, md...) is always increasing, i mean, if /dev/md0 doesn't exists, it is not reused, instead, a new device is created with the highest number available, until i destroy and recreate all devices.
Note: i know the -u flag can be used to pass in a device number, but i don't want to use it because of possible race conditions (i hope mdconfig take care of this when allocating a device number)
Questions:
- It is a bug or a feature of mdconfig?
- Is there a limit on the device numbers?
Thanks,
Tobé
I'm using mdconfig to mount UFS snapshots.
The following code is used to create a device for a given snapshot:
Code:
device=$(mdconfig -a -t vnode -o readonly -f "${1}")
Code:
mdconfig -d -u "${device}"
It works fine, but the device number (md0, md1, md...) is always increasing, i mean, if /dev/md0 doesn't exists, it is not reused, instead, a new device is created with the highest number available, until i destroy and recreate all devices.
Note: i know the -u flag can be used to pass in a device number, but i don't want to use it because of possible race conditions (i hope mdconfig take care of this when allocating a device number)
Questions:
- It is a bug or a feature of mdconfig?
- Is there a limit on the device numbers?
Thanks,
Tobé