LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 01-31-2014, 05:26 PM   #1
ShaneRoach
Member
 
Registered: Apr 2013
Posts: 68

Rep: Reputation: 3
Now I've done it - Debian dual boot (Sid, Wheezy) grub overwritten, lost Wheezy?


I had SteamOS on one hard drive and a stable Wheezy on the second. I got tired of SteamOS as it was going to be more trouble than it was worth to get the Debian desktop functional, and I had been wanting to begin using Sid anyhow. My understandig is that you basically install either stable or testing and migrate to Sid. Two steps of migration if you install stable, or one if you install testing. I installed stable.

I apparently overwrote the grub information in the process, and now neither grub nor the new Wheezy install seem to see the other disk.

If I escape into grub I can see the disk, but I can't even seem to boot into my newest install from the command line, much less recover the old one, if indeed it is all still there.

Anyhow, anyone able to help? It's not a huge loss if I have to reformat and reinstall, but I have done SOME work on that installation, and in any event I'd really like to learn how to rescue screwed up grub files and so forth.

Thanks in advance if anyone can help.
 
Old 01-31-2014, 08:22 PM   #2
ukiuki
Senior Member
 
Registered: May 2010
Location: Planet Earth
Distribution: Debian
Posts: 1,030

Rep: Reputation: 385Reputation: 385Reputation: 385Reputation: 385
Run the command:
Code:
update-grub
That should fix it.

Regards
 
Old 01-31-2014, 08:29 PM   #3
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,336

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
If you can boot into either of your installed versions of Debian then do so. Then su to root and run grub-mkconfig and grub-install.

The command to create a new grub.cfg is:
grub-mkconfig -o /boot/grub/grub.cfg

The command to install a new grub bootloader is:
grub-install /dev/sdx

where /dev/sdx is the hard drive that you boot from, likely /dev/sda.

If you can't boot into one of your Debian systems then boot from a rescue CD, chroot to one of your / partitions and then run grub-mkconfig and grub-install. Assuming that your root partition is /dev/sda1 then do the following in the rescue CD:

mkdir /spare1

mount /dev/sda1 /spare1

chroot /spare1

grub-mkconfig -o /boot/grub/grub.cfg

grub-install /dev/sdx

where /dev/sdx is the hard drive that you boot from, likely /dev/sda.


-------------------
Steve Stites
 
Old 01-31-2014, 08:39 PM   #4
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628

Rep: Reputation: 497Reputation: 497Reputation: 497Reputation: 497Reputation: 497
Get a live CD/DVD of some distro. There are live Wheezy images available.

Boot to the live session and see what is on your drives. Then that will be clear. From there we may be able to find what is going on.
 
Old 01-31-2014, 10:17 PM   #5
ShaneRoach
Member
 
Registered: Apr 2013
Posts: 68

Original Poster
Rep: Reputation: 3
Ukiuki and Jailbait, thanks. Did not work. I can indeed boot the newest installation. But these commands seem to have merely duplicated the grub setup as it already existed.

Widget, I am downloading a live dvd image now. I can tell you this though. I can escape into grub from bootup by hitting the c button. When I do and do an 'ls', I get the following.

Code:
grub> ls
(hd0) (hd0,msdos5) (hd0,msdos1) (hd1) (hd1,msdos5) (hd1,msdos1)
If I further ls (hd0,msdos1) it shows to have an ext2 filesystem. For some reason I don't quite get, (hd1,msdos1) has a fat file system, and I have not had Windows on this machine ever, at all, period, end of story. Plus, I am pretty sure the SteamOS disk is the one I over-wrote, so even the idea that SteamOS might have something like that for some reason seems far fetched because I don't think that is the remaining of the two previous installs.

The iso just finished downloading as I was typing. Not sure what info would be of more use for you, but I will hack at it some more tonight and if anyone has any ideas, feel free.

Thanks all!

P.S. I do not understand why I cannot at least SEE the other disk from my operable Wheezy. Before, I could look at the file system of SteamOS from Wheezy, and likewise look at the Wheezy file system from the SteamOS/Debian desktop.

One of those to HAS to be still on the other disk, but I cannot see it from the operable current Wheezy.

P.P.S. I can select the second hard drive from a boot loader built into my bios, but that disk will not boot... I think this is just because both disks originally booted from the mbr of the one disk.

Last edited by ShaneRoach; 01-31-2014 at 10:31 PM.
 
Old 01-31-2014, 10:39 PM   #6
ShaneRoach
Member
 
Registered: Apr 2013
Posts: 68

Original Poster
Rep: Reputation: 3
I may as well start another post for this.

I am in on the Live DVD now, and can indeed see both disks. They both list as "983 GB Filesystem" in the devices list on the left hand side of the "places" window in Gnome. They are both essentially identical from there, but the first one's boot folder has a grub folder, config-3.2.0-4-amd64 file, intrd.img-3.2.0-4-amd64 file (looks like a package), System.map-3.2.0-4-amd64 file, and finally a vmlinuz-3.2.0-4-amd64 file. I am betting this is the bootable disk.

The other disk's boot folder just has a EFI folder at first, which opens into a debian folder, which contains a grubx64.efi file.

I hope there is more on the whole disk than that...? Is it possible my new wheezy install reformatted that disk in the process?

It sure looks as if it must have reformatted it, but I do not understand why. I had no issues at all adding wheezy to the second disk when I had SteamOS on the first...

Last edited by ShaneRoach; 01-31-2014 at 10:41 PM.
 
Old 01-31-2014, 10:48 PM   #7
ShaneRoach
Member
 
Registered: Apr 2013
Posts: 68

Original Poster
Rep: Reputation: 3
Which I guess brings me to my third and final post for now...

How the heck are you supposed to tell what is on a given disk when installing to a multiple disk system? Even from this live dvd, I cannot tell which of these two is sda0 and which is sda1 when I go to install the OS. Once I have the installation up and running and there are two disks there, unless there is something specific about the file system itself I can recognize, such as a number of paritions or whatnot, I have no way of knowing which disk contains what except my own recollection, which is traditionally woefully inadequate to such tasks.....

I think I'm screwed.

I thought the disks were labelled during installation, but that does not show up at all during the installation steps leading up to formatting the new disk for the OS.
 
Old 01-31-2014, 11:18 PM   #8
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,336

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
Quote:
Originally Posted by ShaneRoach View Post
I can indeed boot the newest installation. But these commands seem to have merely duplicated the grub setup as it already existed.
Please list your /boot/grub/grub.cfg. That will show what operating systems grub-mkconfig found on which partitions.

------------------------
Steve Stites

Last edited by jailbait; 01-31-2014 at 11:47 PM.
 
Old 02-01-2014, 03:17 AM   #9
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628

Rep: Reputation: 497Reputation: 497Reputation: 497Reputation: 497Reputation: 497
The best thing to do is get the boot info script and run it from the Live Session. This will give all the information we need for both drives.
http://bootinfoscript.sourceforge.net/

If you want to look at the drives in a graphic manner most Live Sessions include Gparted and you can see what you have on there quite plainly.

One thing you should consider in the future is labeling your partitions. Makes telling them apart much easier.
 
Old 02-01-2014, 09:04 AM   #10
ShaneRoach
Member
 
Registered: Apr 2013
Posts: 68

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by widget View Post
The best thing to do is get the boot info script and run it from the Live Session. This will give all the information we need for both drives.
http://bootinfoscript.sourceforge.net/

If you want to look at the drives in a graphic manner most Live Sessions include Gparted and you can see what you have on there quite plainly.

One thing you should consider in the future is labeling your partitions. Makes telling them apart much easier.
As I had said, I thought I was doing this during install. It would seem not... What command does one use to label these suckers? e2label pops up on a google search. Is that what you use?
 
Old 02-01-2014, 03:58 PM   #11
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
As requested, from a Linux system go get the bootinfo script.
run it.
post the RESULT.txt file it generates here.

Real data will stop all the guesswork.
 
Old 02-01-2014, 04:17 PM   #12
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628

Rep: Reputation: 497Reputation: 497Reputation: 497Reputation: 497Reputation: 497
Quote:
Originally Posted by ShaneRoach View Post
As I had said, I thought I was doing this during install. It would seem not... What command does one use to label these suckers? e2label pops up on a google search. Is that what you use?
You can put a label on partitions in the Debian installer.

e2label is a fine tool for the job. Pretty quick and easy.

If you use gparted you can lable partitions there too.

As with most things dealing with partitions it is best if done when the partition(s) are unmounted. This is another reason it is nice to have installs on more than one drive and/or a Live Session of some sort available.

The boot info script will list your partitions and what they are. It will give all the info on each partition to tell us what is on that partition.
 
1 members found this post helpful.
Old 02-01-2014, 05:10 PM   #13
ShaneRoach
Member
 
Registered: Apr 2013
Posts: 68

Original Poster
Rep: Reputation: 3
Here's that RESULT.txt. It would appear from my reading that the MBR is indeed gone from the other disk. Is it recoverable?

I am about to buy me a little USB key to create a bootable rescue environment. I ran this from the operating Wheezy hard drive, and it appears that makes it hard for the script. On the other hand, I am tired of creating dvd after dvd after dvd for troubleshooting.

=)

Thanks all, and I will be looking at TestDisk to see if I can recover this doohickey in the meantime, but please chime in as I will be checking back here frequently.

I'll let you know if I lose heart and decide to just reinstall all over again.

P.S. Where in the installation process did I fail to label these? I know this current Wheezy I named DebianSid (Because it is the one I eventually want to migrate to Sid), but that information does not seem to be saved in the paritions or disk names.

I could have sworn you could name disks too....


Code:
                  Boot Info Script 0.61      [1 April 2012]


============================= Boot Info Summary: ===============================

 => Grub2 (v1.99) is installed in the MBR of /dev/sda and looks at sector 1 of 
    the same hard drive for core.img. core.img is at this location and looks 
    for (,msdos1)/boot/grub on this drive.
 => No boot loader is installed in the MBR of /dev/sdb.
 => No boot loader is installed in the MBR of /dev/sdc.

sda1: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info: 
    Mounting failed:   mount: /dev/sda1 already mounted or sda1 busy

sda2: __________________________________________________________________________

    File system:       Extended Partition
    Boot sector type:  -
    Boot sector info: 

sda5: __________________________________________________________________________

    File system:       swap
    Boot sector type:  -
    Boot sector info: 

sdb1: __________________________________________________________________________

    File system:       vfat
    Boot sector type:  -
    Boot sector info:  According to the info in the boot sector, sdb1 has 
                       997376 sectors.. But according to the info from the 
                       partition table, it has 1920196607 sectors.
    Operating System:  
    Boot files:        

sdb2: __________________________________________________________________________

    File system:       Extended Partition
    Boot sector type:  -
    Boot sector info: 

sdb5: __________________________________________________________________________

    File system:       
    Boot sector type:  -
    Boot sector info: 
    Mounting failed:   mount: /dev/sda1 already mounted or sda1 busy
mount: unknown filesystem type ''

sdc1: __________________________________________________________________________

    File system:       vfat
    Boot sector type:  -
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        

============================ Drive/Partition Info: =============================

Drive: sda _____________________________________________________________________

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sda1    *          2,048 1,920,198,655 1,920,196,608  83 Linux
/dev/sda2       1,920,200,702 1,953,523,711    33,323,010   5 Extended
/dev/sda5       1,920,200,704 1,953,523,711    33,323,008  82 Linux swap / Solaris


Drive: sdb _____________________________________________________________________

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sdb1               2,048 1,920,198,655 1,920,196,608  83 Linux
/dev/sdb2       1,920,200,702 1,953,523,711    33,323,010   5 Extended
/dev/sdb5       1,920,200,704 1,953,523,711    33,323,008  82 Linux swap / Solaris


Drive: sdc _____________________________________________________________________

Disk /dev/sdc: 8004 MB, 8004304896 bytes
35 heads, 21 sectors/track, 21269 cylinders, total 15633408 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sdc1                  32    15,633,407    15,633,376   b W95 FAT32


"blkid" output: ________________________________________________________________

Device           UUID                                   TYPE       LABEL

/dev/sda1        3e66733f-21bb-433e-9faa-5ecba8b51b36   ext4       
/dev/sda5        53b60b7f-5715-4f65-84f0-381329787278   swap       
/dev/sdb1        FC43-BB5B                              vfat       
/dev/sdc1        065C-763C                              vfat       

================================ Mount points: =================================

Device           Mount_Point              Type       Options

/dev/disk/by-uuid/3e66733f-21bb-433e-9faa-5ecba8b51b36 /                        ext4       (rw,relatime,errors=remount-ro,user_xattr,barrier=1,data=ordered)
/dev/sdc1        /media/065C-763C         vfat       (rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0077,codepage=cp437,iocharset=utf8,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks)


=============================== StdErr Messages: ===============================

xz: (stdin): Compressed data is corrupt
 
Old 02-01-2014, 06:04 PM   #14
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628

Rep: Reputation: 497Reputation: 497Reputation: 497Reputation: 497Reputation: 497
That is not all the data you should have gotten from the boot info script.

What do you mean
"I am tired of creating dvd after dvd after dvd for troubleshooting."

While I like a stick set up with a Live Session, the DVD should work for years.

Most ISOs are "hybrid". You can put them on a disk or a stick.

Putting on a stick is really hard (we need a sarcasm smiley).
Code:
dd if=<file> of=<device> bs=4M; sync
does it nicely. In the case of one of my ISO files on my desktop this works out to;
Code:
dd if=/home/sam/Desktop/manjaro-openbox-0.8.7.1-i686.iso of=/dev/sdc bs=4M; sync
if is Input File
of is Output File

Stick is used as a whole.

This will not fill a stick if it is nice size. I have a stick with Wheezy on it with persistence. You just need to dd the ISO on first and then create any other partitions you want. I actually have mine of 32gig stick. Gives a lot of storage space for recovery operations.

I think an 8gig stick is the best size. You can use something else for storage if you need it.

4gig is actually plenty. I just like capacity and have music files loaded so I can listen to tunes while exploring some wreckage.
 
Old 02-01-2014, 06:54 PM   #15
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
The mounts failing stops a lot of the info we would normally see - running from a liveUSB should fix that issue.
I would say the real problem is that whilst the /dev/sdb1 partition is flagged as "Linux" (x'83') its filesystem has been formatted as VFAT - I'm surprised the installer would allow that (but I don't use Debian).
I'd blow it away and start again.

As for "which disk is which", I try to always have different size disks - when I can't, I use different partition layouts so I can tell the difference. I never allow installers to do the partitioning. Always "Custom" layouts - I have too many systems on each box to allow what devs think they can dictate to screw everything.
As mentioned, filesystems can have labels (or UUIDs) - not disks or partitions (in a MBR layout). gpt disks allow partitions to have a GUID (similar to UUID) which can be used to boot Linux, and avoid using an initrd (for that - you may have other requirements for the initrd).
 
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
[SOLVED] How to dual boot Windows 7 and Wheezy using UEFI? m_yates Debian 8 02-08-2014 01:32 AM
how to boot wheezy from grub without starting X buradd Debian 11 04-18-2012 12:53 AM
[SOLVED] Newly installed debian sid & saved debian wheezy home would like to transfer files EDDY1 Linux - Newbie 11 01-20-2012 07:43 PM
[SOLVED] Java and Vuze installation on KDE Debian Wheezy sid infoslaw Linux - Newbie 11 12-28-2011 08:24 AM
LXer: Living on the bleeding edge: Debian wheezy/sid LXer Syndicated Linux News 0 02-14-2011 07:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

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