LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-03-2013, 09:10 PM   #1
dogphlap
LQ Newbie
 
Registered: Aug 2013
Posts: 14

Rep: Reputation: Disabled
Grub, post clone, problem (but it still boots and works OK).


For backup I alternate two 1TB drives (I plan on adding an additional backup disk some day).
Every few weeks I clone my working drive to the other one.
I then use the newly written drive as the working drive and keep the other on a shelf.

This worked OK until the 2nd of August 2013 when an update to the OS (Mythbuntu 12.04) could not find grub.
It expected to find grub on the drive that was the source for the last clone (I assume).
Help screens got me through this, so everything works just fine now.

My question: How do I avoid a repeat of this ?
Post clone is there a file I can edit (or restore) so that updates do not go looking for grub where it can't be found ?
Any suggestion ?

I have a screen grab "Configuring grub-pc" but as this is my first post under this user name attachments are not permitted.
Running: sudo find / -name '*grub-pc*' brings up several candidates. Where is the grub-pc referred to located ?

I'm trying this forum before an "Ask Ubuntu" forum as the answer may be non distribution specific.

Thanks in advance for any suggestions.

Best regards dogphlap.
 
Old 08-03-2013, 09:24 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
"Help screens got me through this, so everything works just fine now."

What did you do to correct the problem?

-----------------------
Steve Stites
 
Old 08-03-2013, 09:37 PM   #3
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,504

Rep: Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489
Did you have a kernel upgrade? Did you run sudo update-grub after? I don't regularly use Ubuntu but I would think with a kernel upgrade it should run update-grub??

I'm not really sure how you are doing this. When you switch to the cloned drive from the first, do you change the boot drive in the BIOS each time?
 
Old 08-03-2013, 10:36 PM   #4
dogphlap
LQ Newbie
 
Registered: Aug 2013
Posts: 14

Original Poster
Rep: Reputation: Disabled
Hi guys, thanks for the interest.

@yancek
I did not scroll down to see all the updates I was loading but I'm fairly sure the kernel was not updated (last kernel update was about a week previous). I did not run sudo update-grub (but it could have been run by the auto updater). Some of the updates can be seen in the attached screen shot. I make no bios changes. Both drives are identical (well nearly identical, they have slightly different model numbers and of course different serial numbers). This computer has two sata trays that makes things easy (no need to take off any covers to change hard drives). I put the target drive in the unused sata tray and use clonezilla to clone the current drive to it. I just pull the source drive out and leave the other drive in (with the power off of course). I power up on the newly cloned drive (which will be sda as that is the only drive in the computer then). I've been doing this for a few months and this is my first problem. Note: the computer has never refused to boot, the only problem showed up while doing one of the regular updates that Cannonical provides.

@jailbait.
I can post attachments now so I'll post my screen grab (not the first error screen, unfortunately I did not have the presence of mind to grab that one, this was a subsequent (maybe the subsequent) screen that came up after I clicked on "Help".
Anyway the help advice I adopted was "If you are unsure which drive ... install grub on all of them" so I ticked both /dev/sda and /dev/sda1 (see attachment). That screen shows that the model number was given for the disk sda. That is the disk that was plugged in and working. The source disk that this disk was cloned from has a different model number (it was not plugged in). I wonder if the update was looking for the model number of the disk that this disk was cloned from (which of course was not available since it was waiting on a shelf for the next clone cycle).

Best regards dogphlap.
Attached Thumbnails
Click image for larger version

Name:	GrubFailScreenshot-020813-193928.jpg
Views:	17
Size:	241.6 KB
ID:	13135  

Last edited by dogphlap; 08-03-2013 at 10:53 PM. Reason: removed duplicated line.
 
Old 08-03-2013, 11:14 PM   #5
dogphlap
LQ Newbie
 
Registered: Aug 2013
Posts: 14

Original Poster
Rep: Reputation: Disabled
Hi,
FYI this computer does not dual boot.
It just runs Mythbuntu 12.04 64bit.
Best regards dogphlap.
 
Old 08-03-2013, 11:54 PM   #6
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
post /etc/fstab
 
1 members found this post helpful.
Old 08-04-2013, 01:57 AM   #7
dogphlap
LQ Newbie
 
Registered: Aug 2013
Posts: 14

Original Poster
Rep: Reputation: Disabled
@EDDY1

Hi,

Are you suggesting:
Prior to cloning a drive:-
Copy the file /etc/fstab from the target drive to a thumb drive.
Clone the working drive to the target drive.
mv /etc/fstab on the freshly written drive to /etc/fstab.old
copy the saved fstab from the thumb drive to the freshly written drive as /etc/fstab
sudo chmod 644 /etc/fstab
sudo chown root:root /etc/fstab

If you meant something else could you expand on your comment please.
I left out the question mark in the first paragraph because I wasn't sure where to put it.

Best regards dogphlap
 
Old 08-04-2013, 02:22 AM   #8
dogphlap
LQ Newbie
 
Registered: Aug 2013
Posts: 14

Original Poster
Rep: Reputation: Disabled
@EDDY1

Hi,

Sorry I'm dumb.
I now think you meant you wanted to see the result of cat /etc/fstab.
Here it is:

dogphlap@dogphlap-P5Q-PRO:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' 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/sda1 during installation
UUID=981eaf24-6300-4b45-8b83-2defe6562175 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=cc51ebe4-b786-40a4-b1e6-417c23c8edb8 none swap sw 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0
dogphlap@dogphlap-P5Q-PRO:~$


If you would like to see the same only from the current back up disk I can post that also (just let me know).

Best regards dogphlap

Last edited by dogphlap; 08-04-2013 at 02:31 AM.
 
Old 08-04-2013, 03:03 AM   #9
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
grub is using uuid in /etc/fstab it may bw just copying the uuid from other drive.
You can run either
Quote:
blkid
or
Quote:
sudo blkid
To get the UUId of current drive.
 
1 members found this post helpful.
Old 08-04-2013, 03:10 AM   #10
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Don't forget to update-grub.
 
1 members found this post helpful.
Old 08-04-2013, 06:42 AM   #11
dogphlap
LQ Newbie
 
Registered: Aug 2013
Posts: 14

Original Poster
Rep: Reputation: Disabled
@EDDY1

OK, so I need to ensure fstab is reflecting reality as to the UUID of the hard disk.

man update-grub tells me that update-grub generates a grub2 config file by using grub-mkconfig.
Does that use the UUID info in fstab (i.e. fstab should be correct before running update-grub) or does it get the information it needs by directly interrogating the hard drive(s) or some other file ?

I think you have solved my problem. I'm just trying to clarify some details. I've always been a bit scared of grub, even more so of grub2 which seems so convoluted.

Best regards dogphlap
 
Old 08-04-2013, 07:01 AM   #12
dogphlap
LQ Newbie
 
Registered: Aug 2013
Posts: 14

Original Poster
Rep: Reputation: Disabled
@EDDY1

I have just re-read your last but one post and I see you have already answered my question as to where grub gets the boot disk UUID from, it get it from fstab when update-grub is run to create a grub config file.

I think I can mark this thread as solved. I'll just wait a few hours to see if you or others add anything further. If you think I have this wrong please correct me.

Best regards to all who have contributed and everyone else.

Last edited by dogphlap; 08-04-2013 at 07:03 AM.
 
Old 08-04-2013, 11:59 AM   #13
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Quote:
Originally Posted by dogphlap View Post
@EDDY1

I have just re-read your last but one post and I see you have already answered my question as to where grub gets the boot disk UUID from, it get it from fstab when update-grub is run to create a grub config file.

I think I can mark this thread as solved. I'll just wait a few hours to see if you or others add anything further. If you think I have this wrong please correct me.

Best regards to all who have contributed and everyone else.
I would just run
Code:
blkid
then open another terminal
Code:
nano /etc/fstab
& change the UUID to reflect the present drive by erasing only the UUid & copying & pasting the 1 from blkid.
Then update-grub

Have you checked that they are different?

Can you post output of
Quote:
blkid

Last edited by EDDY1; 08-04-2013 at 12:02 PM.
 
Old 08-04-2013, 03:10 PM   #14
dogphlap
LQ Newbie
 
Registered: Aug 2013
Posts: 14

Original Poster
Rep: Reputation: Disabled
@EDDY1

dogphlap@dogphlap-P5Q-PRO:~$ sudo blkid
/dev/sda1: UUID="981eaf24-6300-4b45-8b83-2defe6562175" TYPE="ext4"
/dev/sda5: UUID="cc51ebe4-b786-40a4-b1e6-417c23c8edb8" TYPE="swap"
dogphlap@dogphlap-P5Q-PRO:~$


dogphlap@dogphlap-P5Q-PRO:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' 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/sda1 during installation
UUID=981eaf24-6300-4b45-8b83-2defe6562175 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=cc51ebe4-b786-40a4-b1e6-417c23c8edb8 none swap sw 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0
dogphlap@dogphlap-P5Q-PRO:~$



I repeated cat /etc/fstab after the sudo blkid for ease of comparison.
The UUIDs are the same (I did not mention it but I actually checked this earlier, prompted by the output of cat fstab).

I'm 17 hours ahead of you (it is 1:00pm in Oakland and 6:00am the next day in Eastern Australia) so if it seems I have been tardy in replying it might just be I was asleep.


Thank you EDDY1 I really appreciate you patience.

Last edited by dogphlap; 08-04-2013 at 03:13 PM.
 
Old 08-04-2013, 03:32 PM   #15
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Looks like you're ok there
try reinstalling grub
Quote:
grub-install /dev/sda
 
1 members found this post helpful.
  


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
Problem to boot with grub into windows7 after ntfs partition clone froff Linux - General 3 10-12-2012 05:43 AM
Unable to boot into GRUB loader: GRUB command shell boots up: urgent issue wombat53 Linux - Software 9 09-04-2009 06:20 AM
Fedora 9 boots (long delay) as single core if I go to GRUB menu, otherwise boots fine saravkrish Fedora 1 05-27-2008 07:59 AM
/grub/menu.lst file disappeared but computer still boots (grub) rrrssssss Linux - General 5 04-08-2007 09:02 AM
Boots to grub; can't FIND grub.conf, start1 pushtostart Fedora 10 10-09-2006 05:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:27 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