Someone removes a tty, printer, etc by doing rm /dev/lp3.
Then you cannot recreate the device, as system returns “already defined at that location”.
You can try to recreate the device with mknod, but need the major/minor numbers.
Then do rmdev -l lp1 -d.
To get major, minor numbers you need to query the ODM.
odmget -q "value3=lp1" CuDvDr
Should return something like:
The major number is 15 and minor 2.
Therefore mknod /dev/lp1 c 15 2 creates the device again.
Then rmdev -l /dev/lp1 -d should remove it cleanly.
In extreme cases, where this still does not remove it, you may have to manipulate
the ODM directly. * Proceed with caution *
cp -i CuDv CuDv.$(date +%j)
cp -i CuAt CuAt.$(date +%j)
cp -i CuDvDr CuDvDr.$(date +%j)
Remove ODM entries
odmdelete -q "name=lp1" CuAt
odmdelete -q "name=lp1" CuDv
odmdelete -q "value=lp1" CuDvDr
synclvodm rootvg # resync odm
Reboot if necessary.
[tags]AIX ODM, odmdelete, synclvodm, Unix Coding School[/tags]
[/reference]If you have found my website useful, please consider buying me a coffee below 😉