How can you install archlinux without burning a cdrom?
Currently our hero (me) has yet another weekend of his favorite past time - break his computer (usually software) and then fix it again.
After the mouse going crazy and corrupting my Debian/XFCE installation (which was an attempted speed improvement over debian/Gnome) ... and being unable to remove the configuration files and re-install...
I decided to try a new linux distribution...
I backed my "linux based" data (ie config files) to a usb stick and reformatted my /dev/hda2 partition (goodbye debian).
Then when I tried to reboot into my Windows XP partition I remembered that GRUB had replaced the MBR ... and Grub couldn't find (hd0,2) or /boot/grub
hmmm...
In my special case this means pressing F12 on my ibm r31 to get the boot device selection (from a cold boot, apparently control + alt + del doesn't give you access to the BIOS F1 and F12 keys!)
So I used SystemRescueCD and F2 for the "options menu" and used GAG (graphical boot menu) to Add my Windows partition to the menu and boot into Windows... Then pressed "h" to install GAG to my hard drive...
(Technically I have used a cdrom drive and cd but in this case it was to overcome the loss of GRUB - technically I could have using a windows boot cd or even run some MBR fixing program to overwrite the MBR with a "windows only" view of the world)...
(WE COULD PRETEND that I was smarter and downloaded unetbootin and systemrescuecd.iso first, and installed GAG by booting using unetbootin? BUT NO... then I wouldn't get to boot at all because broken GRUB comes first... so if I was really smart I'd somehow install an easy to configure MBR/BOOT system... )
I downloaded the archlinux.iso and googled the question, "Install archlinux without burning a cd"...
Imagine my surprise that there was not only an answer, but a solution!
This freaky "unetbootin" program can somehow use squashfs and initrd and all sorts of things to allow you to boot from an ISO without using a cd... (if you have an existing operating system that already works...)
Double clicking on unetbootin-windows-408.exe allowed me to install unetbootin and I can tell it to boot from the archlinux.iso that's on my windows hard drive (let's call it c:\archlinux-2009.08-core-i686.iso )
It copies the files from the .iso into a c:\boot folder...
Directory of C:\boot
07/03/2010 17:44
When it's ready it asks me to reboot the computer...
From GAG boot menu choose the Windows Partition which then amazingly actually eventually gives me a choice: netbootin OR windows!
UNFORTUNATELY every netbootin attempt at booting ended with:
Waiting 30 seconds for device /dev/archiso/ ... 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 finised ramfs$ _
Back to windows for a little more research, "netbootin" does play nice and on the next windows boot (via GAG) it offers to uninstall itself. (Declined so far...)
MAYBE it's that archiso is expecting the file from the cdrom drive and we have to:
After the first failure, commands to list devices in ramfs$: cat /proc/scsi/scsi echo /dev/sd echo /dev/hd
output for a multi partition ide hard drive should be: /dev/hda /dev/hda1 /dev/hda2 /dev/hda3
I tried the incorrect: ln -sf /dev/hda1 /dev/archiso
THE CORRECT command in ramfs$ would be:
ln -sf /dev/hda /dev/archiso exit
...
Gives me Mounting root filesystem ... cannot mount /bootmnt/isomounts: No such... Kernel panic - not syncing: ... Call Tracing...
I even tried another way, since I've already got two linux partitions of 2GB I've extracted the archiso.iso files using IzArc2Go, copied them to my "extra" ext3 formatted partition using ext2 Volume Manager (ext2fsd.com)
ln -sf /dev/hda4 /dev/archiso
DISCOVERED the ext3
Both methods still don't work =(
STILL FURTHER internet advice is to ensure that the disk with the /boot folder has a label, so using windows explorer -> rename... c:\ now becomes (c:) disk
REBOOTING AGAIN USING GAG AND NETBOOTIN...
This time press ESC (escape key), then chosen the IDE version and 'e' to modify the boot menu from the default...
kernel (hd0,1)/boot/vmlinuz26 lang=en locale=en_US.UTF-8 archisolabel=pqi ramdisk_size=75% initrd (hd0,1)/boot/archiso_ide.img
TO something very custom...
title disk find --set-root /archlinux-2009.08-core-i686.iso map /archlinux-2009.08-core-i686.iso (hd32) map --hook root (hd32) chainloader (hd32)
"The chainloader (hd32) command will boot the bootsector of the iso, which will in turn boot the actual iso."
NOTE that I haven't actually had a problem (I think) getting to the ISO, it's that the ISO doesn't find the rest of the archiso image (because it thinks it's on a CD)
The most important files are probably...
vmlinuz26 archiso_ide.img
There's a bunch of others about memtest, x86test, archiso_pata (for SATA drives), etc.
So the help.txt about BOOT EXISTING points out the default settings...
root (hd0,0)
kernel /vmlinuz26 root=/dev/hda3 ro
initrd /kernel26.img
SHOULD BE MODIFIED
root (hd0,1)
kernel /boot/vmlinuz26 root=/dev/hda1 ro
initrd /boot/archiso_ide.img
SO FAR NOTHING HAS WORKED
It appears that reading the vmlinuz boot works fine from NTFS (as I quickly see a "file system type NTFS" appear)...
So the problem is entirely with the archiso_ide.img not believing /dev/archiso...
Even though other people on the internet have claimed to have been successful, AND lots of people seem to have posted the exact same sequence of errors, the best "helpful" advice I've gotten from the ArchLinux forums is to format a usb stick and rawwrite / dd the .iso image files onto it...
So, as per their instructions:
Create one partition with FAT16 aka "just FAT" type, make it bootable. (volume label BUFFALO)
Now use unetbootin to write the USB specific image: archlinux-2009.08-core-i686.img to the USB Drive E:\
OOPS, I chose the .iso instead of Floppy and obviously an .img is a floppy image (no matter what the size...)
ln -s /dev/sda1 /dev/archiso
OK, I GIVE UP, LET ME USE THE SYSTEMRESCUECD AGAIN!
BOOT into system rescue cd (with the ISO available to it from ntfs-3g to the windows partition)
Ensure your "extra" partition is an ext2/ext3 and then:
dd if=archlinux-2009.08-{core|netinstall}-{i686|x86_64}.img of=/dev/sdx
DO NOT USE /dev/sdx1 ... this is a common mistake that I may have made but won't admit.
THEORETICALLY this new partition is bootable, update your GAG (or MBR/BOOT manager of choice)
Since my BIOS doesn't support USB boot then the theory doesn't hold water then apparently try the mythical GRUB 'c' option to create your own connection to the usb stick (apparently by pressing the tab key you can see list of available disks)
kernel (hd0,1)/boot/vmlinuz26 lang=en locale=en_US.UTF-8 archisolabel=pqi ramdisk_size=75% initrd (hd0,1)/boot/archiso_ide.img
grub > root (hdX,Y) grub > kernel /BOOT/vmlinuz26 root=/dev/sdZN init=/etc/init grub > initrd /BOOT/archiso_ide.img grub > boot
to reinstall GRUB on a second partition? (maybe I should have made a BOOT partition...)
sudo grub
root (hd0,2) setup (hd0) exit
None of the above is really working (though I have a slightly better understanding of GRUB commands and partitions...
basically I can boot using SystemRescueCD and type "grub" that gets me interactive GRUB where
root (hd0,4) Was giving me "unknown file type" ... that's because I used dd to /hda4 (which didn't work)
dd if=archlinux-2009.08-{core|netinstall}-{i686|x86_64}.img of=/dev/sdx
Interestingly the root (hd1,0) should have worked...
But when I formatted /sda4 (aka hda4... weird, I know) to ext3 and cp -a all of the files from the USB stick (which was formatted with win32diskimage and .img file) I still get kernel panics from the booting... hmmm...
Make a note of the number of records (blocks) read in and written out, then perform the following check: dd if=/dev/sdx count=number_of_records status=noxfer | md5sum
4850d533ddd343b80507543536258229 archlinux-2009.08-core-i686.img 1618a0e47dc8cea00a4dbdd97ea9921f archlinux-2009.08-core-i686.iso 610d50d6336361426d830759d1ee57e9 archlinux-2009.08-core-x86_64.img 6267b1cae50ead21f25e6d879462db91 archlinux-2009.08-core-x86_64.iso ef92b274bf4445540c03df0903a9986c archlinux-2009.08-netinstall-i686-isolinux.iso 91b8a8e6ba3d7a65900ca5a0aabc90d4 archlinux-2009.08-netinstall-i686.img 93d6d6968c1f390d5681a5fa7612e18d archlinux-2009.08-netinstall-i686.iso cfce7f0d4c088b09c9201d54c42b095f archlinux-2009.08-netinstall-x86_64-isolinux.iso 64cdedf65f5da1b1ca584fe12a892ca1 archlinux-2009.08-netinstall-x86_64.img b57b844e23df599f0e25fdd2232223de archlinux-2009.08-netinstall-x86_64.iso
BEFORE THE INSTALL YOU CAN MAKE SOME MINOR ADJUSTMENTS
Edit grub with 'e' and add the following to the end for 1024x768 resolution vga=773
to use an alternate key mapping, after logging in as "root", type: km
less /arch/docs/official_installation_guide_en
- When you reboot, before running /arch/setup, do the following:
Code:
mkdir /temphdd mount /dev/sda1 /temphdd mount -o loop /temphdd/archlinux.iso /src
Here, I'm assuming that you downloaded the arch iso directly to partition 1 of hard drive 1 (/dev/sda1); adjust the filenames of the iso and directories accordingly. When you enter in:
Code:
ls /src
You should see "arch" and "isolinux". If not, you must have mounted something to the wrong spot; go back and check the commands you entered.
- Now, run:
Code:
/arch/setup
mount /dev/sdb1 /mnt/custom and now the "new" steps of accessing the iso through a mounted loopback device
mkdir /src mount -o loop /mnt/custom/archlinux.iso /src
ls /src
UNFORTUNATELY this shows me the boot cd files... which I could have seen with any ISO busting/opening software...
So let's rethink this... maybe I need to use SystemRescueCD's magic ability to boot other kernels?
OR, I need to extract the files from the .bin / .img THEN, reboot with SystemRescueCD and see if I can run...
/arch/setup