Showing posts with label Grub. Show all posts
Showing posts with label Grub. Show all posts

Monday, January 14, 2013

PC-BSD 9.1 - Aha! At last!

v 0.4.1
14 Jan 13
16 Jan 13
16 jan 13 Afternoon

I saw on Distrowatch recently, that a new version of PC-BSD had been released.  At the back of my mind I've always wanted to try that, or Free-BSD.  It was re-enforced when I was looking through the titles of the Linux Action Show and saw they had a review of it.  What I saw impressed me no end:
  • Simple Installation
  • Jails
  • Absolutely Solid

I should talk about "Jails".  To me, these are the killer feature of Free-BSD and PC-BSD.  They are effectively a Virtual Machine within the system, but they are not.  More like a sandbox.  As an example, you can create a BSD jail or a Linux jail that runs a complete operating system in a sandbox - for example set up a server there with its own IP address.  If an intruder breaks in, they are trapped inside the jail.  But there is more!  Backups, cloning, snapshots. All done with ease.

Another two really impressive features are the firewall setup and the automatic backup.  Easy to set up and effective.  What more can I say?

The acknowledged problems at the moment include deficiencies in the ATI and Intel video drivers, however progress is expected on these issues by version 9.2 of PC-BSD.

PC-BSD in Virtualbox

I started by downloading the Virtualbox image - a whole 2.4 gig.  I unpacked it and it expanded to about 7.8 gig (from memory) and when mated to Virtualbox, it was a disk that would expand to 34 gig.

The first run allowed me to easily set up the video resolution, timezone and language.  Impressive.  The ability to add software was just so easy I was thinking that this would make a really good vanilla home computer.  Web browsing, email, instant messaging, skype, office, finance - the list goes on.  AND secure.  Very secure.

PC-BSD on Hardware - First Blush

I'll not hold you in suspense - on my chosen "box" (the $400 box described elsewhere on this blog) the whole experience was initially unusable.  I could not even get it to install and configure.  In my particular instance it was just garbage.

Now, it is all very well to report my experience, but WHY did it not work?

Two reasons.
  • Video driver
  • Boot manager
I have an i3 chip in my machine, which provides a level of Intel video capability.  As noted above, that is a deficiency that has already been noted.  The system would come up, confirm my video resolution (1680 x 1050) and go for 24 bit.  When I accepted (or even tried with reduced colour depth with vesa) it just crashed.  Unuseable. (subsequently found to be the lack of driver for the on-board intel video)

The Boot manager detected my Linux install, but I was unable to select it.  BSD was the only thing that would work.  Major work needed.  BSD is almost worse than Windows in its lack of ability to play with other children.  In all the Googling I did, I found people pleading for solutions for dual-boot problems, with nothing that really worked.  Even the official documentation was useless for me when I tried to use Grub2. Solved with a different menu-entry, and after finding out that Grub2 decided to change their numbering system for partitions but nobody knew.

Second Blush - We have Liftoff with nVidia

 Well, I took Cmdr Taggart's advice from Galaxy Quest ... and I kept thinking about this and experimenting.

nVidia cards are mentioned a lot.  I had one lying around, though it needed an extra power supply.  Eventually, I relented and bought the cable, connected it up and .... YES! We have liftoff!  32 minutes past the hour. 

AND the machine was significantly faster as well.

Third Blush - Damn you Grub2!!!!


Computer HDD Setup

I have Debian Linux (wheezy) on the first primary partition, with PC-BSD on the second primary partition using the zfs filesystem.  When I installed PC-BSD, I installed its bootloader which overwrote Grub2 on the MBR.

Recovering Debian Grub2

To re-install Grub2 on the MBR in a Debian system, the installation cd/dvd have the tools specifically built in.  Google on the Debian Wiki and it directs you to the appropriate section of the Debian installation guide.
  • Boot using the Debian Install Disk
  • Advanced Options
  • Recovery Mode
  • You will progress through various screens which are the first part of the Debian Installer - don't worry too much because none of the info will be written to the disk.  Eventually ....
  • A screen will present the available partitions - select the one you want to be the root partition.
  • Select the menu entry to re-install Grub
That's it.

Manual Menu Entries in Debian Grub2

Like a lot of things in life, many things are only obvious in hind-sight.  Gaining that knowledge is hard won, but you feel good after the fact.

Debian automatically builds the Grub2 config file " /boot/grub/grub.cfg" .  There is no point editing it (and they warn you about this - it is a text file that you can read) because it is over-written the next time grub.cfg is created.  Instead, if you look at the end of the file, you will see that they point you to a customisation file " /etc/grub.d/40_custom " .  Open it in an editor (as superuser) and you can add your manual entries to the bottom.  Save the file and then once again as superuser:
" update-grub "
This will incorporate your custimisations in a new grub.cfg file.

Adding PC-BSD to Grub2

The entry I eventually found was for me (after piecing things together) was:

menuentry "PC-BSD 9.1" {
set root='(hd0,2)'
chainloader +1
}

"hd0,2"  -  well, ARRRRGGGGHHHHHHH!!!!!!!!
  • 0 stands for the first hard disk, because you count your disks from zero.
  • 2 stands for the second partition because you count your partitions from one.
 chainloader +1  allows grub to go to the bootloader for PC-BSD which I installed initially if you remember and which is loaded at the start of the PC-BSD partition.

Finally, to change the timeout and default menu entries, I've written previously about this here:
http://glassfloor.blogspot.com.au/search/label/Grub

 So, What do I Think?

 This is definitely worth sticking with as the potential rewards are significant.  So far, I have the system up and running - and the Grub2 bootloader is doing what I want.  Everything boots smoothly to what I want.

If you want to use PC-BSD (and like I said, for a family this makes a great system) .. use an nVidia video card and have only BSD on the system. Once you know what you are doing with re-configuring boot loaders, it is pretty straightforward - but getting there may be an effort.

I'm glad I stuck it out despite my initial setbacks because I'm really quite excited about what can be done with PC-BSD.  For the moment though, I'm happy with what I've achieved and that what I've written up above may help someone have an easier time than me.  I'll write further on this as it is worthwhile documenting.




Later

Thursday, June 16, 2011

Debian Squeeze for My Parents - Config Issues - Pt3

v 0.3

Grub2

Once I'd finished installing Squeeze on my Parent's Computer, I had a dual-boot machine that booted by default into Debian. Initial installation failed to include the Windows XP selection on the bootloader menu, however I wanted it to boot into Windows as the default operating system.

Debian uses the Grub2 bootloader.  Of course, a Windows selection SHOULD appear but didn't.  Instead, the default display had two selection lines, the first being for the normal Debian Squeeze kernel, and the second for a Rescue Mode boot into Debian.  How to organise Grub the way we want it?

The Debian Wiki, of course!  First search the wiki for the bootloader Grub2.  The first challenge we have is to have it recognise the Windows installation.  The clue is in the wiki.  Open a root terminal and:

update-grub

There is now a third line on the Grub menu, pointing to the Windows XP partition.

Next, we are told "To configure grub "v2", you should edit /etc/default/grub, then run update-grub."  Opening this file (as root) shows us the first two uncommented lines as:

GRUB_DEFAULT=0
GRUB_TIMEOUT=5

The first line tells us that the default boot entry is on Line 0 (zero), the top one and that there will be a 5 second delay before the boot continues.  I changed the entries to:

GRUB_DEFAULT=2
GRUB_TIMEOUT=20

I now had the default boot line as line 2 (the third line down) and the default timeout at 20 seconds (to give adequate time to change the selection - don't forget pressing "Enter" will continue the boot process straight away).

update-grub

All fixed!


Tip - Edit file as Root

Open a root terminal window, change to the directory where the file you want to edit is located and:

gedit

gedit opens as root and can edit and save the file as root.

Tip - Open Nautilus File Manager as Root

As above but:

nautilus

and the Gnome file manager starts so you can copy files as root.

Adobe Flash

Whilst there is a package that purports to load Adobe Flash, it didn't work for me.  HowtoForge tells you how to disable the Gnash Flash plugin in "Iceweasel/Firefox", which is a good idea.

To enable flash the manual way, download the tarball for linux from Adobe and extract as root the "libflashplayer.so" file (I think it is called).  Copy it to " /usr/lib/mozilla/plugins " and it will show up nicely in Iceweasel and play Youtube videos for you.

ntfs

Use synaptic to ensure the " ntfs-3g " package is installed.

Assuming Windows is on /dev/hda1, create a directory under either /mnt or /media, say /mnt/windows .

Edit fstab (save the current one as a backup) and add a line such as this on the last line.


/dev/hda1     /mnt/windows     ntfs-3g     defaults

That should do it - you can now read and write to the windows partition.


That's it for the moment, however I still had to configure the router for SSH access - next part.


Later ......

Wednesday, November 4, 2009

Debian Squeeze Pt 3

 Grub
 After I managed to get my Lenny installation back into the Grub menu by using " update-grub ", I spent some time trying to work out WHY Grub in Squeeze didn't seem to correspond with that in Lenny.  Answer - Squeeze uses Grub2 .... well that is pretty obvious.  Instead of a Menu.lst file, there is now a Grub.cfg file that contains the parameters.  Grub.cfg says that the automatically generated part of the file should not be edited, however I see no other way to change the timeout value of the menu splash screen, or which distro is seen as the default.  More research.

grub.cfg notes.

Well, according to the notes, I can edit the file and change the timeout and default boot by a simple edit of two values.  So I opened the file ready to edit it and there at the top it told me to go to " /etc/defaults/grub " and edit the values in there.  Aha! Simple ..... change the timeout value, and put the LINE NO of the entry I want to be the default.  The first line being 0.  In my case, I wanted the 4th entry to be the default, so I set the value to 3.

done!

works a treat!