A site devoted to discussing techniques that promote quality and ethical practices in software development.

Tuesday, December 25, 2012

Using a second disk drive in Ubuntu and auto-mounting it

Recently, I added a second disk (virtual) to my Ubuntu 12.04 and now I want to make that disk auto-mount when I log on.

When you create additional disk drive using the "Disk Utility" tool, it adds that volume name to Nautilus. Depending on how one prepares that disk drive or partition, you may have trouble making it auto-mount; you can open Nautilus and click onto that drive to mount it. But it will not auto-mount.

There are several ways to make that partition auto-mount. However, most of these only works when the drive has a partition.

It turns out that in Linux, when you prepare a disk drive, it is not necessary to have a partition of sort. You can simply have a volume formatted with the right type and you can use it.

If you do not have a partition on that drive like this one:
Program such as Pysdm will not be able to configure it.

You can use udisks to mount the device on per-users basis by defining it in the "Start up Applications", like this:

/usr/bin/udisks --mount /dev/disk/by-uuid/4746946c-1cb1-404a-a74b-4a59cb248df2

This is the technique that I have chosen as I am happy to auto-mount it on per-users basis.

If you have a need to auto-mount a disk drive on a system-wide basis, make sure when you prepare that disk to:
  1. Create a partition
  2. Format that partition and assigned a Volume name to it
  3. When you use Pysdm, it will report that this device has not been configured and proceed to configure it.
  4. The name for this partition is actually the mount point name and make sure you use the Volume name otherwise it will create two entries in the /media directory when this device is mounted. This can be confusing.
Once Pysdm has configured this device, you can choose to auto-mount it and it will be mounted with the start of the system.

No comments:

Blog Archive