NAS #3 :: Reboots and forcing the disks to the correct shares

October 7th, 2009 by desktophero Leave a reply »

One area of concern when dealing with USB disk drives is the association and assignment of the disk to a device name.If not properly aligned, this can cause havoc on your shares, permissions, and data.

When you expect /dev/sdb1 to be your 1 TB Western Digital drive but the mapping of the devices causes the /dev/sdb1 to be your 320 GB Seagate, what you end up with is data from disk A being presented to other disk shares. This can result in your BACKUP share showing up as an expected media or apps share.

In order to align this within my NAS and have some expected results, I need to move away from DEVICE IDs and use something more unique. Like the UUID for the disk itself

Within Ubuntu, the command blkid shows information about the disk devices. This includes the UUID, the label, and the type.Here’s some output:

@nasserver:~$ blkid
/dev/sda1: UUID="7524d180-a105-4428-a56c-3128c73684a1"
/dev/sda2: UUID="15a4483b-373e-45c0-80ff-b1588c71bff5"
/dev/sda3: UUID="186C12564DB71A6D"
/dev/sdb1: UUID="BA1A9D7A1A9D347B" LABEL="1TB_DRIVE"
/dev/sdc1: UUID="0C229D2C229D1C30" LABEL="400GB_Testing" TYPE="ntfs"
/dev/sdd1: UUID="88e94acd-5645-4f36-b291-5b74890f2c35" SEC_TYPE="ext2" TYPE="ext3"
/dev/sde1: UUID="BC5A275D5A271424" LABEL="500GB"

The changes that are necessary in the /etc/fstab file looks like this:

UUID=186C12564DB71A6D /media/virts  ntfs  suid,dev,defaults,umask=007,gid=46,exec,nls=utf8  0  0
UUID=BA1A9D7A1A9D347B /media/1tbroot ntfs  suid,dev,defaults,umask=007,gid=46,exec,nls=utf8  0  0
UUID=BC5A275D5A271424 /media/500GB ntfs  suid,dev,defaults,umask=007,gid=46,exec,nls=utf8  0  0
UUID=88e94acd-5645-4f36-b291-5b74890f2c35 /media/Music          ext3  relatime

What this leaves us with is the ability to reliably mount the correct UUID to the mount point each time. The Samba configuration can then make use of the mount point and the Windows share can be named whatever through the Samba configuration.

Advertisement

Leave a Reply

You must be logged in to post a comment.