-   Linux - Hardware (
-   -   Alert! /dev/disk/by-uuid problem after bare metal restore of Ubuntu (

Subject16 11-08-2010 12:27 PM

Alert! /dev/disk/by-uuid problem after bare metal restore of Ubuntu
Hi all. I believe the problem I am having is similar to the question posted here but there are enough differences that I think it warrants a new thread.

I was testing out doing a bare metal recovery of my Ubuntu server following the related chapter in Curtis Preston's backup book. Essentially I created a Windows share, used dd to backup the MBR, the output of fdisk, and the OS itself, trashed my drive, and booted into Knopix to restore. Everything went fine except I think I got cute during the restore. I used a Knoppix bootable thumb drive instead of a CD, which made the disk assignments different as Knoppix took /dev/sda for its own and I had to mount the server drive as /dev/sdb. I didn't realize that this would be a big deal (noob mistake) until I rebooted and got the following message in my subject line.

I Googled and found guidelines to help me figure out what the problem is. Now I need help figuring out how to fix it (if possible). Going forward I realize I have to use a CD for the recovery, but I would like to use this as a learning opportunity.

This is the output of /etc/fstab:

root@Microknoppix:/media/sdb3# cat etc/fstab
# /etc/fstab: static file system information.
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
# <file system> <mount point>  <type>  <options>      <dump>  <pass>
proc            /proc          proc    nodev,noexec,nosuid 0      0
# / was on /dev/sda3 during installation
UUID=b3b6dfe7-9181-4822-8b21-3006b24ce88c /              ext4    errors=remount-ro 0      1
# /boot was on /dev/sda1 during installation
UUID=3313fec1-d6cb-4e15-9444-cdfe91bfde06 /boot          ext4    defaults        0      2
# swap was on /dev/sda2 during installation
UUID=ce79ad1f-632d-42d3-b5ef-26985de36a86 none            swap    sw              0      0

Thisd is the output ot /dev/disk/by-uuid:

root@Microknoppix:/media/sdb3# ls -l /dev/disk/by-uuid/
total 0
lrwxrwxrwx 1 root root 10 Nov  8 17:55 5466-505A -> ../../sda1
lrwxrwxrwx 1 root root 10 Nov  8 17:55 84d7fb45-b1c1-4113-98a6-ce222e4072f5 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Nov  8 17:55 c12c943e-de86-4477-aef0-00181541f993 -> ../../sdb3
lrwxrwxrwx 1 root root 10 Nov  8 17:55 ce79ad1f-632d-42d3-b5ef-26985de36a86 -> ../../sdb2

And the output of /dev/disk/by-id

root@Microknoppix:/media/sdb3# ls -l /dev/disk/by-id/
total 0
lrwxrwxrwx 1 root root  9 Nov  8 17:55 scsi-3600508e0000000001bb0dee1438f610a -> ../../sdb
lrwxrwxrwx 1 root root 10 Nov  8 17:55 scsi-3600508e0000000001bb0dee1438f610a-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Nov  8 17:55 scsi-3600508e0000000001bb0dee1438f610a-part2 -> ../../sdb2
lrwxrwxrwx 1 root root 10 Nov  8 17:55 scsi-3600508e0000000001bb0dee1438f610a-part3 -> ../../sdb3
lrwxrwxrwx 1 root root  9 Nov  8 17:55 usb-SanDisk_Cruzer_026621167CC2381C-0:0 -> ../../sda
lrwxrwxrwx 1 root root 10 Nov  8 17:55 usb-SanDisk_Cruzer_026621167CC2381C-0:0-part1 -> ../../sda1

So, in order to get my system operational again, it seems like there must be two parts: 1. is to get the UUIDs in fstab to match those in /dev/disk/by-uuid, and 2. to get the device itself back to /dev/sda. I figure I only need to edit fstab to get part 1 going, but how do I get the disk back to sda instead of sdb?


AlucardZero 11-08-2010 01:02 PM

If you're mounting by UUID, there's no need to change the disk names. In fact, UUIDs bypass the entire problem of device naming.

Subject16 11-08-2010 01:06 PM

So just changing the UUID in fstab to match the entries in /dev/disk/by-uuid should do the trick?

AlucardZero 11-08-2010 01:17 PM


Subject16 11-17-2010 09:36 AM

1 Attachment(s)
Thanks for your response. I tried changing the UUID and it's still not booting, with the same error (complaining of the same exact UUID). I checked the following:
  • noted all the entries found in /dev/disk/by-uuid. There are 3, including the one in the error
  • verified that the one in the error is actually symlinked to the appropriate device. In this case it is pointing to /dev/sda3, which is the device that / is being mounted on
  • /etc/fstab also has the UUIDs listed properly and matched to the appropriate device. The 3 UUIDs found in /dev/disk/by-UUID are accounted for in this file and pointing to the respective volumes or partitions (/dev/sda1, /dev/sda3, etc)

Since the UUIDs are all there and accounted for, I tried editing /etc/fstab and replacing the UUIDs with the actual devices as per some suggestions at http://ubuntu-virginia.ubuntuforums....d.php?t=813090. No go.

As a last effort I attempted to edit menu.lst, or at least see if it was doing something funny. There was no such file there, but I did find grub.cfg. I attached it Attachment 5205. Is there something wrong in it that is causing the issue? I'm afraid this has gotten too sloppy and in the end won't prove to be a viable way to image my servers after all, but I want to know if that's due to user error or something fubar'd in the process itself. I mean, for all intents and purposes everything looks as it should. It looks like the system is looking for a device of a specific ID, and that ID exists in fstab and grub.cfg and /dev/disk/by-uid, but it's not being found in the boot process.


All times are GMT -5. The time now is 02:40 AM.