Post thumbnail of Persistent Naming of a Block Device in Linux
18 April 2011
Continue reading Persistent Naming of a Block Device in Linux

Persistent Naming of a Block Device in Linux

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.

Post thumbnail of Tips for using Win32 Device Namespaces in APIs
13 September 2010
Continue reading Tips for using Win32 Device Namespaces in APIs

Tips for using Win32 Device Namespaces in APIs

Win32 namespaces for accessing devices instead of file systems and for disabling string parsing can be helpful but not all APIs support their use.

Post thumbnail of Hardware Device Management in Linux using udev
28 December 2009
Continue reading Hardware Device Management in Linux using udev

Hardware Device Management in Linux using udev

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.

Post thumbnail of A faster way to write out all zeros to a disk using checksums
10 August 2009
Continue reading A faster way to write out all zeros to a disk using checksums

A faster way to write out all zeros to a disk using checksums

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.

Post thumbnail of How to find a device’s UUID and use it in fstab
19 March 2009
Continue reading How to find a device’s UUID and use it in fstab

How to find a device’s UUID and use it in fstab

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.

Post thumbnail of How to Encrypt a device using dm-crypt
23 January 2009
Continue reading How to Encrypt a device using dm-crypt

How to Encrypt a device using dm-crypt

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.

Powered by Wordpress   |   Lunated designed by ZenVerse