quick linux question: drive allocation

Discussion in 'Tech Support' started by cyrilthefish, 6 Oct 2007.

  1. cyrilthefish

    cyrilthefish What's a Dremel?

    Joined:
    15 Apr 2004
    Posts:
    1,363
    Likes Received:
    99
    currently backing up my server pc to swap a few drives around (my mum is complaining sims2 takes too long to load, so i'm going to swap her old 40GB HD in her PC for a raid0 array :lol:)

    anyway, current server pc config:

    xubuntu linux
    40GB drive, hda = / mount
    2x80GB LVM, hdb+hdc = /home mount

    what i want to do is take out the two 80GB drives and replace with a single 160GB drive i have spare
    the 160GB drive is currently connected via a USB-IDE adapter (sda) and i'm rsync'ing the contents of /home to it as we speak.

    now when i take the two 80GB drives out and swap in the 160GB as secondary IDE master (the 40Gb is primary IDE master), will it:

    -set itself to hdb
    -set itself to hdc

    i can't remember if linux allocates drive name by location or order... :confused:

    i want to se the FSTAB file to be correct the first time i boot with the new setup to hopefully stop it breaking itself when it sees no /home mount available :p
     
  2. IanW

    IanW Grumpy Old Git

    Joined:
    2 Aug 2003
    Posts:
    7,701
    Likes Received:
    1,173
    Currently, the various flavours of Ubuntu prefer to allocate drives by UUID (Universally Unique IDentifier), although the older hda1/hdb1 method still works.
    As the name suggests, this is a unique ID number for each drive, so it will mount in the correct place no matter which port it's connected to.

    To generate one for your new drive:-

    Code:
    $ sudo vol_id -u /media/sda1
    (This assumes the drive is currently mounted as /media/sda1 of course)

    and paste the resulting UUID number into the /etc/fstab entry for your home directory ( / ) when you are about to shut the system down to install the drive.

    As always, TAKE A BACKUP FIRST! Just in case what I wrote above is totally wrong! :nono:
     
    Last edited: 8 Oct 2007
  3. Fophillips

    Fophillips What's a Dremel?

    Joined:
    9 Oct 2006
    Posts:
    948
    Likes Received:
    1
    Primary master: /dev/[h|s]da
    Primary slave: /dev/[h|s]db
    Secondary master: /dev/[h|s]dc
    Secondary slave: /dev/[h|s]dd
     
    Last edited: 7 Oct 2007
Tags:

Share This Page