LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 11-08-2010, 12:27 PM   #1
Subject16
Member
 
Registered: Nov 2009
Posts: 46

Rep: Reputation: 1
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:
Code:
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:
Code:
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
Code:
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?

Thanks!
 
Old 11-08-2010, 01:02 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
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.
 
Old 11-08-2010, 01:06 PM   #3
Subject16
Member
 
Registered: Nov 2009
Posts: 46

Original Poster
Rep: Reputation: 1
So just changing the UUID in fstab to match the entries in /dev/disk/by-uuid should do the trick?
 
Old 11-08-2010, 01:17 PM   #4
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Correct.
 
Old 11-17-2010, 09:36 AM   #5
Subject16
Member
 
Registered: Nov 2009
Posts: 46

Original Poster
Rep: Reputation: 1
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 grub.txt. 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.

Thanks.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bare metal restore for RHEL 5.1 thespaceman Red Hat 4 10-21-2011 01:42 PM
ALERT! /dev/disk/by-uuid/ #### does not exist ubuntu 1:1.10.2 -1ubuntu7 please help pinged Linux - Laptop and Netbook 25 04-13-2009 06:57 PM
Bare metal restore suggestions supremedalek Linux - Server 4 07-06-2007 05:37 PM
Computer Will Not Boot After Bare Metal Restore rrrssssss Linux - General 7 04-26-2007 07:24 AM
Can I do a Bare Metal Restore? bob151 Linux - Software 1 04-14-2005 06:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 08:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration