Matt Mossholder on 18 Dec 2007 15:14:42 -0800


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Adding new drives to fstab


On Tue, 2007-12-18 at 17:59 -0500, Art Alexion wrote:
> I don't really understand the new UUID method of adding drives to fstab.  I 
> just added a bunch of new drives to this computer and I'm not sure how to set 
> them up.
> 
> Grub is on /dev/hda I think, but the root OS drive is /dev/sda2 (I think)
> 
> I added a SATA dvd-rw, two IDE drives and want to mount /dev/hda1
> 
> This is the existing fstab (a the bottom).  I understood the old nomenclature 
> but not this.
> 
> I don't think that /dev/hdb is the cdrom drive anymore.  That's 
> probably /dev/hde or f or g.
> 
> Physically, /dev/hda is the slave on the motherboard IDE controller.  There is 
> another HD which is the master on that controller.  A third IDE HD is on a 
> Promise PCI card slot 1, and an IDE DVD-RW on slot 2 (no slaves on the pci 
> card).  Finally, a SATA DVD-RW on SATA 3.  (sda1 is on SATA 2, and SATA 1 is 
> for an external SATA.)
> 
> I don't remember having trouble with this before.  (pre-SATA, old fstab 
> nomenclature)
> 
> I need help with two things:
> 
> 	1. how to detect which drive is on which /dev device
> 	2. how to edit fstab to mount them.  
> All of the IDE HDs are from a prior system and are formatted with ext3 
> already.  hda is the old boot drive from this system before I got the SATA 
> and reinstalled the OS.
> 
> # /etc/fstab: static file system information.
> #
> # <file system> <mount point>   <type>  <options>       <dump>  <pass>
> proc            /proc           proc    defaults        0       0
> # /dev/mapper/chubby-root
> UUID=405902eb-75eb-4abb-8900-5bede5cfc601 /               ext3    
> defaults,errors=remount-ro 0       1
> # /dev/sda1
> UUID=180a1c81-399f-4d2e-b9b8-894151acf627 /boot           ext3    defaults        
> 0       2
> # /dev/mapper/chubby-swap_1
> UUID=a7f78039-6ce3-4733-af8d-367255be2500 none            swap    sw              
> 0       0
> /dev/hdb        /media/cdrom0   udf,iso9660 user,noauto,exec 0       0


Art,
	It isn't as difficult as it looks. The bonus of using UUIDs is that the
if the disks move, the OS doesn't really care.

	The missing piece of the puzzle, I suspect, is the vol_id utility. This
little bit of code spits out information about partitions, including the
UUID. Just use UUID against the new devices, and it will spit out
something like this:

mattcm@mourneblade:~$ sudo vol_id /dev/hda1
ID_FS_USAGE=filesystem
ID_FS_TYPE=ext3
ID_FS_VERSION=1.0
ID_FS_UUID=46b53233-9f95-42d0-afb4-b35b999ad653
ID_FS_UUID_ENC=46b53233-9f95-42d0-afb4-b35b999ad653
ID_FS_LABEL=
ID_FS_LABEL_ENC=
ID_FS_LABEL_SAFE=


Just stick the contents of ID_FS_UUID into the filesystem part of fstab
for each new partition, and you should be good to go.

Item of note: they don't use UUIDs for removable media, as it is tied to
the filesystem, and would change each time you put in a new
cd/floppy/etc. You should be able to find your cd/dvd by looking
at /dev/disk/by-label with a CD/DVD in the drive. The files in that
directory are symlinks out to the real /dev devices, and contain useful
information like disk titles in their names.



		--Matt






___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug