LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices

Reply
 
Search this Thread
Old 06-16-2014, 04:47 PM   #1
wagscat123
Member
 
Registered: Jan 2009
Location: Westminster, Maryland USA
Distribution: openSUSE 13.1and Linux Mint 17
Posts: 198
Blog Entries: 7

Rep: Reputation: 21
Getting BSD to boot with GRUB


Well... here's another one's dive into BSD.

I am getting into PC-BSD 10.0, and installed it onto the first partition of my second hard disk. Once I rebooted, I found it messed with the first hard disk's MBR, and that on my second hard disk the 2nd partition after my BSD one was corrupted (the Linux installation on it was acting weird - good riddens, and am not trying to recover it).

When I try to boot, GRUB says that a device (it names it by a UUID) isn't available, and then it throws me into the rescue prompt. Is there a way that I can manually change the GRUB settings so it works? It seems the graphical installer does not provide a lot of flexibility in how to configure GRUB.

I've tried using the rescue environment and was going to chroot to the BSD installation to fiddle with GRUB, but I couldn't figure out how to mount the BSD partition. How are disks labeled in BSD? I tried looking it up on online guides, but I couldn't get anything to work. Also, what's a slice?

Here's what my partition layout (from fdisk and parted), as partitioning info is imperative when configuring boot settings.

Code:
ubuntu@ubuntu:~/Documents/firefox$ sudo fdisk /dev/sda

Command (m for help): p

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 / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xdc9d61b2

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1              63       80324       40131    6  FAT16
/dev/sda2   *       81920    31141887    15529984    7  HPFS/NTFS/exFAT
/dev/sda3        31141888  1953521663   961189888    f  W95 Ext'd (LBA)
/dev/sda5        31143936   117159935    43008000    7  HPFS/NTFS/exFAT
/dev/sda6       117161984   143785983    13312000    7  HPFS/NTFS/exFAT
/dev/sda7       143788032   983468031   419840000    7  HPFS/NTFS/exFAT
/dev/sda8       983470080  1618350079   317440000    7  HPFS/NTFS/exFAT

Command (m for help): q

ubuntu@ubuntu:~/Documents/firefox$ sudo parted /dev/sdb
GNU Parted 2.3
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                            
Model: ATA WDC WD20EZRX-00D (scsi)
Disk /dev/sdb: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start   End     Size    File system     Name     Flags
 1      135MB   10.9GB  10.7GB
 2      10.9GB  37.7GB  26.8GB  zfs                      msftdata
 3      37.7GB  1148GB  1111GB                           msftdata
 4      1148GB  1578GB  429GB   fat32           primary  msftdata
 6      1578GB  1631GB  53.7GB  ext4            primary  msftdata
 7      1631GB  1642GB  10.2GB
 8      1642GB  1642GB  537MB
 5      1998GB  2000GB  2067MB  linux-swap(v1)  primary  msftdata

(parted) q                                                                
ubuntu@ubuntu:~/Documents/firefox$
I've tried a tons of googles on the issues, but can't quite figure it out.

Any tips would be greatly appreciated.
 
Old 06-16-2014, 07:32 PM   #2
astrogeek
Senior Member
 
Registered: Oct 2008
Distribution: Slackware: 12.1, 13.1, 14.1, 64-14.1, -current, FreeBSD-10
Posts: 1,953

Rep: Reputation: 727Reputation: 727Reputation: 727Reputation: 727Reputation: 727Reputation: 727Reputation: 727
Since no one else has stepped up, I'll offer what comments that I can but...

* I am new to BSD myself
* I am not a Grub user
* I have never used Gpt partitions

That said, I have recently installed FreeBSD into a multi-disk, multi-boot config with Slackware using Lilo, and I know that chain booting to the BSD (primary) partition works easily (I did not allow BSD to write to the MBR of either disk).

Although I do not know the Grub syntax, I know that Grub can chain boot just like Lilo, and can even be mixed into a Lilo environment, so you should be able to easily chain boot from your Grub MBR setup to the BSD boot partition just as I did with Lilo.

If you can still boot to Linux on the first drive, I would suggest that you get the id or uuid of the BSD disk/partition, something like this...

Code:
ls -l /dev/disk/by-id/
ls -l /dev/disk/by-uuid/
Then search for the correct Grub syntax to chain boot by disk id and you should be able to get there.

For completeness, the corresponding Lilo chain syntax is something like...

Code:
other = /dev/disk/by-uuid/xxxyyyzzz...
label = FreeBSD-10.0
When referenced by uuid it should have no difficulty identifying the partition - as long as you get the right one!

Last edited by astrogeek; 06-16-2014 at 07:38 PM.
 
Old 06-16-2014, 09:16 PM   #3
jefro
Guru
 
Registered: Mar 2008
Posts: 11,731

Rep: Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445
I tend to use bios to assist me on this sort of two drive issue.

What I do is either remove the first drive or make the second drive the first in the hard drive boot order in bios. This makes the installers and usually me not watching installers use the second drive now as destination for grub and such.

Then I return system to normal and select boot in bios or from F key.

You can try to repair your issue if you want maybe. PC-BSD can use FreeBSD loader or Grub2. If your system has grub then you may have to chain load to grub2 in different location.

Last edited by jefro; 06-16-2014 at 09:18 PM.
 
Old 06-16-2014, 10:11 PM   #4
wagscat123
Member
 
Registered: Jan 2009
Location: Westminster, Maryland USA
Distribution: openSUSE 13.1and Linux Mint 17
Posts: 198
Blog Entries: 7

Original Poster
Rep: Reputation: 21
Do you know how to mount zfs filesystems?

I'll try booting to the second hard disk too.

Last edited by wagscat123; 06-16-2014 at 10:13 PM.
 
Old 06-16-2014, 11:09 PM   #5
astrogeek
Senior Member
 
Registered: Oct 2008
Distribution: Slackware: 12.1, 13.1, 14.1, 64-14.1, -current, FreeBSD-10
Posts: 1,953

Rep: Reputation: 727Reputation: 727Reputation: 727Reputation: 727Reputation: 727Reputation: 727Reputation: 727
Quote:
Originally Posted by wagscat123 View Post
Do you know how to mount zfs filesystems?

I'll try booting to the second hard disk too.
I found this site, zfs on Linux which looks like it probably has the answer, but don't know anything about zfs.... either

Last edited by astrogeek; 06-16-2014 at 11:12 PM.
 
Old 06-17-2014, 11:36 PM   #6
wagscat123
Member
 
Registered: Jan 2009
Location: Westminster, Maryland USA
Distribution: openSUSE 13.1and Linux Mint 17
Posts: 198
Blog Entries: 7

Original Poster
Rep: Reputation: 21
Thanks for the help, but now in addition to my 2nd Linux partition, the whole partition table is shot after an attempt to use the BSD bootloader from the getgo in the graphical installer. I'm pulling up testdisk on an Ubuntu Live-CDto recover my data, and ditching this Operation Barbarossa. I'll do something else with the space I would have used for BSD, and will try to run FreeBSD in VirtualBox.
 
Old 06-17-2014, 11:55 PM   #7
astrogeek
Senior Member
 
Registered: Oct 2008
Distribution: Slackware: 12.1, 13.1, 14.1, 64-14.1, -current, FreeBSD-10
Posts: 1,953

Rep: Reputation: 727Reputation: 727Reputation: 727Reputation: 727Reputation: 727Reputation: 727Reputation: 727
Quote:
Originally Posted by wagscat123 View Post
Thanks for the help, but now in addition to my 2nd Linux partition, the whole partition table is shot after an attempt to use the BSD bootloader from the getgo in the graphical installer. I'm pulling up testdisk on an Ubuntu Live-CDto recover my data, and ditching this Operation Barbarossa. I'll do something else with the space I would have used for BSD, and will try to run FreeBSD in VirtualBox.
Sorry to hear it, but I sympathize.

I have read back over your original post thinking a fresh look might ring some bell or other, but my unfamiliarity with all of Grub, Gpt and Zfs make me reluctant to offer any ill-founded advice!

The fact that existing partitions seem to have been corrupted is a little troubling and would make me double-check the drive itself, as in potential hardware problem. You should be able to use the smartmon tools on it from the working Linux boot.

In any event - good luck! Let us know how it works out.
 
Old 06-18-2014, 05:56 PM   #8
wagscat123
Member
 
Registered: Jan 2009
Location: Westminster, Maryland USA
Distribution: openSUSE 13.1and Linux Mint 17
Posts: 198
Blog Entries: 7

Original Poster
Rep: Reputation: 21
Do either of you have experience with TestDisk?
 
Old 06-18-2014, 06:53 PM   #9
astrogeek
Senior Member
 
Registered: Oct 2008
Distribution: Slackware: 12.1, 13.1, 14.1, 64-14.1, -current, FreeBSD-10
Posts: 1,953

Rep: Reputation: 727Reputation: 727Reputation: 727Reputation: 727Reputation: 727Reputation: 727Reputation: 727
Quote:
Originally Posted by wagscat123 View Post
Do either of you have experience with TestDisk?
Again, I do not have that experience.

I have seen quite a few threads on LQ in recent months with advice and instructions for its use. From one of those I found this link to TestDisk Step by Step.

Here is one set of results for testdisk in the LQ hardware section, you might try others as well.

I know that the universal advice for a corrupted drive is to not mount it writeable - copy an image to another drive and work from the image, otherwise it degenerates into mush...
 
Old 06-18-2014, 07:23 PM   #10
astrogeek
Senior Member
 
Registered: Oct 2008
Distribution: Slackware: 12.1, 13.1, 14.1, 64-14.1, -current, FreeBSD-10
Posts: 1,953

Rep: Reputation: 727Reputation: 727Reputation: 727Reputation: 727Reputation: 727Reputation: 727Reputation: 727
... and of course, I would suggest that you open a new thread on the subject, maybe in the hardware or software sections of LQ, to attract responses from others who know but might not visit the BSD forum.
 
Old 06-18-2014, 10:33 PM   #11
wagscat123
Member
 
Registered: Jan 2009
Location: Westminster, Maryland USA
Distribution: openSUSE 13.1and Linux Mint 17
Posts: 198
Blog Entries: 7

Original Poster
Rep: Reputation: 21
OK - if I have any more trouble with that I'll open a new thread there. Thanks for the tips and moral support
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Grub 2: bsd command does not exist Skyer Linux - Newbie 9 08-12-2011 03:52 AM
[SOLVED] How come I can't edit /boot/grub/grub.conf or /boot/grub/menu.lst in Fedora 14? trien27 Fedora 4 01-22-2011 04:02 PM
Grub menu doesnt load at startup : dual boot : grub in the /boot partition jayesh.bhoot Linux - General 7 10-23-2010 03:58 AM
Why /boot/grub/grub.conf is symlinked to /boot/grub/menu.lst raj_hcl1986@rediffma Linux - Newbie 2 10-19-2008 02:19 AM
GRUB gets eaten by BSD boot loader? JZL240I-U Linux - Software 2 10-07-2008 03:09 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration