You are not logged in.

#1 2013-08-10 01:54:50

rudepeople
Member
Registered: 2013-03-10
Posts: 13

Custom remastered install image on a thumbdrive...

I work on a LOT of PCs in my profession. I see everything from Arch, to windows, to ubuntu. I want a thumbdrive with all my tools on it that works easily from each and all platforms even as a instant recovery cd. to do this I want to load arch into an ext3 partition at the back of the thumbdrive and keep it bootable, and then at the front I want a vfat partition that can be loaded in windows. because this is a "removable device" windows will only ackoledge the first partition so it has to be fat. If I load arch into an ext partition at the end of the drive, it all works fine, except there is that little problem if writes on a flash drive... trying to alleviate that causes more and more and more frusterations.

enough!

so here's the idea... what if I dump the contents of the arch install disk onto a 10 GB ext3 partition at the end of the flash drive as previously planned, and load it as if it was an ISO imaged to the drive? well heres how far I have gotten:

boot to arch install disk on a PC with no drives but the CDrom, and the thumb drive attached. no HDDs.

partition the flash drive thusly:

cfdisk    /dev/sda:

  Name   Flags  Part Type  FS Type    [Label]        Size (MB)
--------------------------------------------------------------
  sda1           Primary   vfat       [MVUTILITIES]   52000.00
  sda1           Primary   Linux      [ARCH_201308]    8000.00
  sda1           Primary   vfat       [ARCHISO_EFI]      64.00

next format/name the partitions (though it shows above, no I did not label them in cfdisk) thusly:

# mkfs.vfat /dev/sda1 -n MVUTILITIES
# mkfs.ext3 /dev/sda1 -n ARCH_201308
# mkfs.vfat /dev/sda1 -n ARCHISO_EFI

now I get to mount the ISO and copy the contents!

# mkdir /mnt/stageing
# mkdir /mnt/archiso
# mount /dev/sr0 /mnt/archiso
# cp -a /mnt/archiso /mnt/stageing
# umount /dev/sr0
# mount /dev/sda2 /mnt/archiso
# cp -a /mnt/staging/archiso /mnt/
# umount /dev/sda2
# mount /dev/sda3 /mnt/archiso
# cp -a /mnt/staging/EFI /mnt/archiso
# cp -a /mnt/staging/loader /mnt/archiso
# umount /dev/sda3
# reboot

and this is where I'm stuck.

if the arch install CD is in the CD drive and I boot, the system loads the boot image from the cd but loads the squashfs file from /dev/sda2 (which is labeled ARCH_201308) so I get this nice little hybrid boot in which the CD is only necesary for the first loading then can be removed with no ill affects. Additionally, it is EASY to just install arch into the ext3 partition and boot, it works fine! so I know what I want to do is technically possible. can someone direct me to the next step?

what do I need to do to get a boot loader onto my thumb drive which will act EXACTLY like the original ISO did, but where the disk image is located AFTER a viable vfat partition?

UPDATE: Well that was fun... I figured out if I image the drive thusly:

# dd if=/dev/sr0 of=/dev/sda

then repartition the drive thusly:

cfdisk    /dev/sda:

  Name   Flags  Part Type  FS Type    [Label]        Size (MB)
--------------------------------------------------------------
  sda1           Primary   Free Space                    34.93    <--NOTE!!!
  sda1           Primary   vfat       [MVUTILITIES]   52000.00
  sda1           Primary   Linux      [ARCH_201308]    8000.00
  sda1           Primary   vfat       [ARCHISO_EFI]      64.00

NOTE: there WAS 2M free space and a 32M vfat partition I just deleted the vfat AFTER adding MVUTILITIES and left it as is.

then followed the rest of my notes above... the thing actually worked!

but still, there _has_ to be a better way

Last edited by rudepeople (2013-08-10 02:24:25)

Offline

#2 2013-08-10 03:44:39

rudepeople
Member
Registered: 2013-03-10
Posts: 13

Re: Custom remastered install image on a thumbdrive...

UPDATE: ok, so the legacy/bios boot works now, and I can remaster the install disk on the fly if I desire... but I still have a problem. UEFI does not appear to work. when I try I get the following, "Error loading /arch/boot/x86_64/vmlinuz: Not Found"... I gather gummiboot is not set to load from the correct location... how do I fix this one?

Also, though I havent tried it yet, I am prety sure that if I were to remaster the image and update the kernel, I would run into some nastiness as the init image would be the original install image... is this fixable, or am I just stuck with the current kernel untill arch updates the install disk?

finally, still wondering if all this can be simplified...

Last edited by rudepeople (2013-08-10 03:46:49)

Offline

#3 2013-08-10 04:02:44

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Custom remastered install image on a thumbdrive...

With USB, the archiso does not make an image that is able to be dd'ed to a thumbdrive and still be UEFI compatible.  To do this, you have to create a FAT32 partition, and then copy the contents over to the partition.  Then enusre that that name of the filesystem matches that of what is sepcified in the gummiboot configurations.  This is typiaclly ARCH_201308 or similar, though this can be specified with a cunstom archiso.

See the wiki page on UEFI (towards the bottom) for more info on how to create a UEFI bootable USB.

You may have to either carry two USB's or create two separate partitions on the USB... though I imagine that you could also just slap the necessary parts into the existing FAT partition you are already making in the beginning og the USB.


Edit: Okay apparently I didn't read the whole first post.  You do have these separate partitions already.  In this case, you need to ensure that the VFAT archiso partition is named what is specified in the \loader\entries directory.  Since you already have a dd'ed archiso on the USB, you are probably going to have to create a custom archiso with a different name, so that the filesystem names can be different.

Last edited by WonderWoofy (2013-08-10 04:05:05)

Offline

#4 2013-08-12 15:33:39

rudepeople
Member
Registered: 2013-03-10
Posts: 13

Re: Custom remastered install image on a thumbdrive...

yep... so far everything is working. I got stuck after a while with a "not enough space on /" issue, despite having more than 5 gigs free on the remastering partition... but I have the feeling that was due to trying to remaster an image while loaded into the install image... I have not yet confirmed this, but I'll post an update later if it works.

If I get this working, would anyone be interested in a "how to" guide?

Offline

Board footer

Powered by FluxBB