# refracta.freeforums.org

place to talk about refracta

Skip to content

Welcome
Welcome to refracta You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today!

## install grub to partition

Refracta Development, Scripts, etc.
Post a reply
29 posts • Page 2 of 3 • 1, 2, 3

### Re: install grub to partition

by meandean » Sun Oct 14, 2012 6:34 pm

> fsmithred wrote:Right now, I have four hard drives in my main computer. I recently installed refracta to a partition, and I had some trouble figuring out which drive was first. Looking at the wires inside the box didn't help. I had to change the order in the bios. Seems like the bios and the grub or maybe grub and the kernel don't agree.

Thanks for that. I suspected it could get fairly ugly in that regard. Of course I could just go with the excuse that if you have multiple hard drives then it is your mess to figure out. It sounds a bit mean....but...well....

> OK, this is my first time using an iPad, and, well, Let's just say that I prefer a real keypad.

My cheapass $50 android POS was okay in a pinch for a quick web surf or email but it isn't anything I would want to use regularly.

> Automatic stuff that can render a system unbootable is uncool.

But nonautomaitc stuff when a user has no idea and just clicks a button may as well be automatic as it will be screwed either way.

> I'm not sure what the best solution is

Yea I think I have hit this point too....

meandean
  Posts: 392
  Joined: Wed Mar 09, 2011 5:16 am

Top

### Re: install grub to partition

by meandean » Sun Oct 14, 2012 6:38 pm

> ukbrian wrote:Being a 70 year old idiot and getting a bit senile

only 42 here and probably worse than you are

> but have Antony's(Saline) grub doctor on the ISO so after installing run grub doctor.

Might be more attention than he wants for the grubDr. But I do kind of like that idea. Instead of grub being something you do during a install maybe just call anothter program to do so at the end of the install. Of course you could cal it from the installer before it is done, similar to how gparted is handled.
I may have to take a look at grubDr....thanks

meandean
  Posts: 392
  Joined: Wed Mar 09, 2011 5:16 am

Top

### Re: install grub to partition

by fsmithred » Mon Oct 15, 2012 3:30 am

> meandean wrote:

> > fsmithred wrote:Automatic stuff that can render a system unbootable is uncool.

> But nonautomaitc stuff when a user has no idea and just clicks a button may as well be automatic as it will be screwed either way.

Yeah, but at least they can blame themselves when it happens. And if they don't, then we can do it for them. I'd be a nice guy and put a warning in the script. Maybe I already did - haven't looked at it lately.
And 10 minutes into using the iPad, I see trouble for many necks. True, they have a nice case you can use to stand it up, but who wants to type on a vertical keyboard?
I've looked at grub doctor in the past, and I'll look at it again. It's still sitting on my desktop. Might make sense to call a second script or else borrow some code from it.

fsmithred
  Posts: 2101
  Joined: Wed Mar 09, 2011 9:13 pm

Top

### Re: install grub to partition

by meandean » Mon Oct 15, 2012 3:47 am

grubdr is a simple tool that just asks the user to select a partition and a device...cool but still a bit technical
my brain hurts from thinking about this
What about installing grub to the mbr of every detected drive. I wonder how much trouble that would cause. Or maybe hd0 and hd1 at least to be on the safe side.
I am just trying to think of something fairly foolproof without having to ask the user where the boot loader should be installed. Obviously if the user only has one disk then it isn't a big deal as hd0 should cover it. But recently I have noticed that even clueless users often have multiple hard drives, not to mention usb drives, and have fiddled with the bios boot order...usually causing themselves trouble while thinking some installer has cause it.
I just realized what section I am in. Sorry about that. This isn't really about refracta, just about grub installs.

meandean
  Posts: 392
  Joined: Wed Mar 09, 2011 5:16 am

Top

### Re: install grub to partition

by meandean » Mon Oct 15, 2012 5:36 am

Okay, I think I have concluded that asking the user where to install grub and offering hd0 as the default is about as sane as you can get.
ho hum....same ol same ol....wasted a day thinking about it...

meandean
  Posts: 392
  Joined: Wed Mar 09, 2011 5:16 am

Top

### Re: install grub to partition

by dzz » Mon Oct 15, 2012 8:37 am

> Out of curiosity and laziness, I ask, How do you chain load from syslinux?

Although syslinux has the module chain.c32, by itself it doesn't do much more than boot another mbr, can't chain a partition directly.
Easiest way is to place the grub4dos image (grub.exe, 229kb and GPL) in the syslinux directory of the device and load that as a kernel. A custom menu. lst (even a splash or gfxboot image) in the same place get found and used automatically. Behaviour is then just like grub-legacy with menu or prompt.

Code: Select all
  `menu label load grub4dos
  kernel /syslinux/grub.exe`

If you booted from usb normal bios order probably changed but drive mapping is a one-liner in menu.lst or prompt

dzz
  Posts: 647
  Joined: Wed Apr 27, 2011 11:53 am
  Location: Devon, England

Top

### Re: install grub to partition

by meandean » Tue Oct 16, 2012 11:56 am

I was thinking that it would be cool if refracta installer could offer to update grub rather than install grub. Of course rebooting and updating grub is easy enough.
I don't think I have seen an installer that offers to update grub though. I wonder why?
Note to self - when testing grub reinstall scripts be sure the partition is unmounted before doing a rm -rf /target or even better don't point the script toward your data partition until you are sure it works correctly. Now when was the last time I made a backup and where the hell is it...

meandean
  Posts: 392
  Joined: Wed Mar 09, 2011 5:16 am

Top

### Re: install grub to partition

by ukbrian » Tue Oct 16, 2012 12:03 pm

I ran the installer with no grub parameter and then ran grubdr and it was just what I wanted.
Anthony added the label field to grubdrwhen I asked for it and then added it to his installer as well, it makes it so much easier to ID the partitions.
If format a partition can you use the hostname as the default partition label?

ukbrian
  Posts: 109
  Joined: Mon Jul 25, 2011 8:22 am
  Location: Cheltenham, UK

Top

### Re: install grub to partition

by fsmithred » Tue Oct 16, 2012 6:36 pm

If you have multiple installations, and you want to update-grub from a live boot, you have to do it in chroot, and you have to pick the right partition to chroot. I would prefer to boot into that main installation first, to be sure I have the right one, and sometimes even booting into it I have doubts that I'm in the right one. It's probably easy to make it work, and it'll probably work in most cases, but there may be edge cases where it won't work. C'est la vie.
I'll have to look at the code for using labels. At one point, I thought about doing that, but I wasn't sure how to proceed. I think it should be easy to use the hostname as a partition label. I've already got a variable for the hostname in the installer script - it automatically uses the hostname of the running system if you don't enter anything. That might be a problem if you have multiple installations with the same hostname. I don't know if e2label complains if you try to use a label that's already present on the system. It also won't work if you have encrypted partitions, because the label is on the filesystem, which is hidden inside the encrypted volume.

fsmithred
  Posts: 2101
  Joined: Wed Mar 09, 2011 9:13 pm

Top

### Re: install grub to partition

by ukbrian » Tue Oct 16, 2012 8:32 pm

If you look at Anthony's grubdr he gets the labels with an array and I think it would be good to get the file type as well. I think it's a block of code you can just grab.

> If you have multiple installations, and you want to update-grub from a live boot, you have to do it in chroot, and you have to pick the right partition to chroot. I would prefer to boot into that main installation first,

I'm normally installing into sdc? so I put the grub in sdc but then boot into sda and update-grub, so I don't need to install grub just run grub doctor from the live dvd.
One odd thing about grubdr is if you running an OS on say sdc3 and point at sda1 as primary partition and sda for MBR it doesn't include sdc3 the partition your running it on in the grub it writes.
It had me scratching my head for ages until I realised what was happening but when I mentioned it to Anthony he said it was a bug in grub and not his script.
Sorry if that's not very clear
I've had occasions when the running update-grub from sda hasn't found the newly installed OS on sdc so I've run grubdr pointing at sdc? and sdc for MBR and then run it again pointing at sda1 and sda for MBR and it's always corrected itself, I do think that grub can be a bit flaky at times.
I like the option you have in your installer to use existing partitions, Anthony is lacking that at the moment.

ukbrian
  Posts: 109
  Joined: Mon Jul 25, 2011 8:22 am
  Location: Cheltenham, UK

Top

Previous Next Display posts from previous:
Sort by

Post a reply
29 posts • Page 2 of 3 • 1, 2, 3

Return to Discuss

Jump to:

### Who is online

Users browsing this forum: No registered users and 0 guests

Donate Now
ProNight Style by ModphpBB3
Hosted by © 2017 FreeForums.org | Create a free forum | Powered by phpBB
A Member of the Crowdgather Forum Community
About FreeForums | Legal | Advertise Here | Investors | Contact FreeForums.org
Report Violation
suspicion-preferred