Persistent naming of devices is important for instances such as booting where a particular hardware device needs to get mapped to the same name each time. To get the UUID of a block device, use scsi_id. To get the UUID of a file system for something like grub.conf, try blkid.
Win32 namespaces for accessing devices instead of file systems and for disabling string parsing can be helpful but not all APIs support their use.
Udev creates and removes device nodes in /dev, based on events the kernel sends out on device discovery or removal. In other words, Udev is the system that maps hardware devices to files you can interact with in the /dev directory. Udev runs in user space and creates points in /dev when the kernel detects and recognizes new hardware as it’s attached. It’s only been around since 2003/2004. All modern distributions use udev instead of the now depreciated hotplug.
You’re not going to write out all zeros, but the end case will be the disk is full of nothing but zeros. (or partition, like /dev/sdb3, which is what I used this for). The basic idea here is you read a disk, one arbitrary chunk at a time, compute the checksum for each chunk and only write out zeros to the chunks that are not all zeros already. But it all comes down to how expensive is it to write vs read.
Look in the directory /dev/disk/by-id to see how your attached storage devices are mapped in dev. If they are not already identified by UUID or Label, they will just get the next available letter in the alphabet. sda, sdb, then sdc, etc. The reason why you want to see them “by-id” is because if you plug in multiple devices in a different order one day, you may find what was “sdb3″ yesterday is “sdc3″ today. Look up the Universally Unique Identifier using the blkid command (part of e2fsprogs) The identifiers are generated when partitions are created. Non partitioned devices will not have these identifiers. Use of UUIDs are preferred over Labels since Labels are not unique.
Use cryptsetup to setup dm-crypt managed device-mapper mappings. This method will allow you to use an encrypted mapping to transparently read and write encrypted data so that you and your applications don’t even need to worry about handling any encryption at all; it will just work, trust me. If you need to save data that’s already on the device, then copy it somewhere else, encrypt the drive, and copy it all back after encrypting.