In virtualization or when installing Slackware on a device for which you don't know the root device (i.e., /dev/sda, /dev/hda) beforehand, it is safer to use disk UUIDs to refer to disks and partitions.
Determining a disk's UUID requires the disk to be available as a block device (i.e., for a disk image it is first necessary to create a block device from it). For example, the following command outputs the UUID of the block device "/dev/sda1" or, in other words, the first partition of disk "/dev/sda"
$ blkid /dev/sda1
Afterwards, it is necessary to update the bootloader configuration. This depends of course on the bootloader you are using and there are tons of tutorials available out there, for example, Extlinux with UUID device and Lilo with UUID device.
Finally, and most important, the standard Slackware installation, which uses the version huge of the kernel and no initrd, is not capable of booting from a root device through its UUID. Instead, it is necessary to create an initrd and, while you are it, might as well switch to the generic kernel. With the generic kernel and the initrd, your system should be able to boot from a root device using the device's UUID. I don't know if the generic kernel is strictly necessary, I haven't tried with the huge kernel and the initrd, maybe it works too.
Tags: slackware