You are not logged in.

#1 2011-03-12 03:15:21

Caipré
Member
From: U.S.
Registered: 2009-07-29
Posts: 9

[Solved] Need help to install GRUB2 offline

Hello,

I need to install grub2, but I'm on a university campus which requires a (browser based) login to access the internet. Hence I can't download the package through pacman.

Background:
I'm trying to set up Arch on a Dell Optiplex 320. I'm using arch x86_64 and installing from a USB. My partition setup is as follows:

sda1  /boot
sda2  swap
sda3  /
sda4  /home

After encountering some issues booting, I discovered that this particular system isn't compatible with grub legacy. The solution given was to install grub2. I followed the commands provided in that thread, the results were as follows:

# mkdir /mnt/local
# mount /dev/sda3 /mnt/local
# cd /mnt/local
# pacman --root . --cacheddir /var/cache/pacman/pkg --dbpath /var/lib/pacman -S grub2
grub2 package not found, searching for group...
error: 'grub2': not found in sync db

I'm still learning Arch, but I think I understand what's happening here. In order to install grub2, we're loading the default installation packages from the usb onto the local harddrive. Then we're attempting to install grub2 from that new "repository." Unfortunately, it doesn't exist. I thought I might be able to install the package from the internet instead. The issue then became my campus's network filter. Basically, until I log in using a web browser, I can only access the campus network. I thought I might try using Lynx to log in, but that isn't in the default installation packages either.

Is there any way to bypass the campus filter? Or somehow log in?
More important, Is there any way I can install grub2?

Thanks for any advice.

Last edited by Caipré (2011-03-15 14:00:18)

Offline

#2 2011-03-12 10:52:18

nTia89
Banned
From: varese, italy
Registered: 2008-12-22
Posts: 1,230

Re: [Solved] Need help to install GRUB2 offline

i haven't understand the question, but:

if you want to install a file you must use

-U

switch instead

-S

, just

cd folder/where/you/have/file.tar.xz
pacman -U file.tar.xz

second, the package

grub2

doesn't exist, there are

grub2-common, grub2-bios, grub2-efi-i386, grub2-efi-x86_64

according to install grub2 efi version or bios version

in both case read our archwiki


+pc: custom | AMD Opteron 175 | nForce4 Ultra | 2GB ram DDR400 | nVidia 9800GT 1GB | ArchLinux x86_64 w/ openbox
+laptop: Apple | MacBook (2,1) | 2GB ram | Mac OS X 10.4 -> DIED
+ultrabook: Dell | XPS 13 (9343) | 8GB ram | 256GB ssd | FullHD display | Windows 8.1 64bit ArchLinux x86_64 w/ Gnome

Offline

#3 2011-03-12 11:15:38

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: [Solved] Need help to install GRUB2 offline

Well, if you can't make pacman download the packages, then you can do it manually.

Here are the links:

ftp://ftp.archlinux.org/extra/os/i686/grub2-common-1.99~rc1-3-i686.pkg.tar.xz
ftp://ftp.archlinux.org/extra/os/i686/grub2-bios-1.99~rc1-3-i686.pkg.tar.xz

After downloading these through your browser, you'll have to install them in this order

pacman -U /path/to/grub2-common-1.99~rc1-3-i686.pkg.tar.xz
pacman -U /path/to/grub2-bios-1.99~rc1-3-i686.pkg.tar.xz

I hope this works.

Last edited by x33a (2011-03-12 11:24:04)

Offline

#4 2011-03-12 17:15:12

Caipré
Member
From: U.S.
Registered: 2009-07-29
Posts: 9

Re: [Solved] Need help to install GRUB2 offline

Thanks for the advice nTia89 and x33a.

I have finally managed to make some progress.
Originally I put the packages on my usb stick, but that's the same usb I'm using as a "livedisk"  for the installation. I wasn't able to figure out where it was mounted in order to access the packages, so I've borrowed a second usb stick from a friend. I was able to mount that and run

# pacman -U /mnt/usbstick/grub2-common-1.99~rc1-3-i686.pkg.tar.xz

But that notified me of the missing dependencies: freetype2 and xz . I've downloaded those to the usb (I'm hoping I already have their dependencies) and will make another attempt to install them into the Arch system. I've also downloaded the Lynx browser (and its dependencies) in the hopes that I'll be able to log in and connect to the internet once I'm able to boot.

Manually managing dependencies sucks. I feel like I'm doing LFS!

Edit:
I was able to install freenode2*, but I'm running into an error installing xz:

#pacman -u xz-5.0.1-1-x86_64.pkg.tar.gz
loading package data...
checking dependencies...
error: replacing packages with -U is not supported yet
error: you can replace packages manually using -Rd and -U
error: failed to prepare transaction (conflicting dependencies)
:: xz: conflicts with xz-utils

I'm not sure whether I want to remove xz-utils or not? I saw that libarchive depends on it, and I assume libarchive is necessary for unarchiving files (ie, .tar.gz and the like).

Seems I'm stuck again.

* I'm not actually sure where it installed to. I'm still running a "livedisk" from usb, so I don't know if this installed to the harddrive or the usb.

Last edited by Caipré (2011-03-12 17:27:04)

Offline

#5 2011-03-12 17:53:13

nTia89
Banned
From: varese, italy
Registered: 2008-12-22
Posts: 1,230

Re: [Solved] Need help to install GRUB2 offline

this work must be done after arch installation; i've installed grub2-bios in my system BUT after arch linux installation

or maybe you can try the beta ISOs, which contain updated packages (this is a workaround for your xz problem)
EDIT: you can found here: http://releng.archlinux.org/isos/

but the first is the way

Last edited by nTia89 (2011-03-12 17:54:51)


+pc: custom | AMD Opteron 175 | nForce4 Ultra | 2GB ram DDR400 | nVidia 9800GT 1GB | ArchLinux x86_64 w/ openbox
+laptop: Apple | MacBook (2,1) | 2GB ram | Mac OS X 10.4 -> DIED
+ultrabook: Dell | XPS 13 (9343) | 8GB ram | 256GB ssd | FullHD display | Windows 8.1 64bit ArchLinux x86_64 w/ Gnome

Offline

#6 2011-03-12 18:37:38

Caipré
Member
From: U.S.
Registered: 2009-07-29
Posts: 9

Re: [Solved] Need help to install GRUB2 offline

nTia89, I'm not sure what you mean by "after the installation."

I have performed all steps of AIF, except I've neglected to install grub as the bootloader.
Thus I'm at the console at the point where I'm supposed to reboot, but without a bootloader I won't be able to boot into the OS.

I consider this to be after the installation. Is that not correct?

Last edited by Caipré (2011-03-12 18:38:27)

Offline

#7 2011-03-12 19:02:47

skunktrader
Member
From: Brisbane, Australia
Registered: 2010-02-14
Posts: 1,538

Re: [Solved] Need help to install GRUB2 offline

Offline

#8 2011-03-12 19:33:10

Caipré
Member
From: U.S.
Registered: 2009-07-29
Posts: 9

Re: [Solved] Need help to install GRUB2 offline

skunktrader, thanks for the reference but I have been to that section before.

I went through it again anyway, and encountered the same issue: xz conflicts with xz-utils.
Also of note, per nTia89's first post, that page should be updated to reflect that there is no package named "grub2"

For testing purposes, I went ahead and removed xz-utils. Now pacman doesn't work at all! smile
I'm downloading the beta ISO nTia89 suggested, and I'll reinstall using that.

Thanks for the help so far, please keep it coming!

Offline

#9 2011-03-14 20:24:00

Caipré
Member
From: U.S.
Registered: 2009-07-29
Posts: 9

Re: [Solved] Need help to install GRUB2 offline

Made some significant progress! However, I'm still not able to boot. sad

Here's where I'm at:

  1. Downloaded the archlinux-2011.03.05-core-x86_64.iso

  2. Used UNetBootin to make the live-usb (after I had had a lot of difficulty with Universal USB Installer)

  3. Booted from the live-usb. The system halts with the display similar to this and this:

    :: Waiting for boot device ...
    Waiting 30 seconds for device /dev/disk/by-label/ARCH_201103 ...
    ERROR: boot device didn't show up after 30 seconds ...
       Falling back to interactive prompt
       You can try to fix the problem manually, log out when you are finished
    /bin/sh: can't access tty; job control turned off
    [ramfs /]# 
  4. I managed to fix this problem by entering the following:

    [ramfs /]# ln -s /dev/sdb1 /dev/disk/by-label/ARCH_201103
    [ramfs /]# exit
  5. This got me into the live-usb boot of Arch

  6. I proceeded through the AIF, skipped installation of a boot loader and selected the extra package xz

  7. In /etc/rc.conf, changed the hostname to be:

    HOSTNAME="arch"
  8. Finished the AIF, dropped to interactive prompt

  9. Installed grub2 per the instructions on this page (notably, the chroot) using a second usb containing the packages freetype2, grub2-common, and grub2-bios:

    [root@archiso ~]# modprobe md-mod
    [root@archiso ~]# mount -o bind /dev /mnt/dev
    [root@archiso ~]# chroot /mnt bash
    [root@archiso /]# mkdir /mnt/usbdisk
    [root@archiso /]# mount /dev/disk/by-id/usb-Generic_Flash_Disk_JT4EDSHY-0\:0 /mnt/usbdisk
    [root@archiso /]# cd /mnt/usbdisk/arch
    [root@archiso usbdisk]# pacman -U freetype2-2.4.4-2-x86_64.pkg.tar.xz
    ...
    [root@archiso usbdisk]# pacman -U grub2-common-1.99~rc1-3-x86_64.pkg.tar.xz
    :: grub2-common and grub are in conflict. Remove grub? y
    ...
    [root@archiso usbdisk]# pacman -U grub2-bios-1.99~rc1-3-x86_64.pkg.tar.xz
    ...
    [root@archiso usbdisk]# reboot
  10. Rebooted, hoping everything worked...no luck. I still only see this screen:

    GRUB Loading stage1.5.
    
    GRUB loading, please wait...
    Error 15

Things I notice:

  • After the chroot, I expected the prompt to being [root@arch], not [root@archiso] . Why doesn't it? Should it?

  • I'm not sure what's happening with the mount -o bind /dev /mnt/dev command, and wonder whether it's accurate

  • I'm also not sure whether the chroot /mnt bash command is accurate

  • The ultimate result after rebooting leads me to believe I've never actually removed the original grub install. How can I be sure grub2 is in my MBR?

Edit:
I also just noticed that the GRUB2 page might have a typo. Below the "Installing GRUB2 during Arch Linux installation" heading is the command:

# modprobe md-mod

Later on is the command:

# sudo modprobe dm-mod

Is this (md-mod vs dm-mod) an error?

Last edited by Caipré (2011-03-14 21:09:18)

Offline

#10 2011-03-14 23:03:00

mhertz
Member
From: Denmark
Registered: 2010-06-19
Posts: 681

Re: [Solved] Need help to install GRUB2 offline

I believe(never used grub2 myself!) you've neglected the second part of the instructions i.e. the part about actually installing grub2 to your mbr and have it setup as your bootloader, instead of just as an installed package...

For grub2 >= 1.99 (including bzr trunk)

Note: this should have to do before, as mentioned over
# sudo modprobe dm-mod
# sudo grub_bios-install --boot-directory=/boot --no-floppy --recheck /dev/sda
# sudo cp /usr/share/grub/{unicode.pf2,ascii.pf2} /boot/grub/

Btw, for next time, then all arch images can be dd'ed to usb sticks directly, as they're hybrid images...

Last edited by mhertz (2011-03-14 23:22:33)

Offline

#11 2011-03-15 13:59:49

Caipré
Member
From: U.S.
Registered: 2009-07-29
Posts: 9

Re: [Solved] Need help to install GRUB2 offline

Thank you mhertz, that was it! I guess I didn't realize the instructions carried through across the headers. There's some English grammar issues on that page, and I just misunderstood. skunktrader, seems you had the right idea all along! Thanks also to nTia89 and x33a, I had to use the advice from each post here to get things working.

I now have grub2 installed and am able to boot into Arch... almost! I'm now encountering this error, but I'll save asking questions about that until I've made a few attempts of my own to solve it. I think this thread is solved though, thanks again all!

Offline

Board footer

Powered by FluxBB