LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   USB bootstick, usbimg2disk.sh and OEM recovery partition (https://www.linuxquestions.org/questions/slackware-14/usb-bootstick-usbimg2disk-sh-and-oem-recovery-partition-810503/)

catkin 05-27-2010 12:35 PM

USB bootstick, usbimg2disk.sh and OEM recovery partition
 
Hello :)

Is it possible to load a USB stick so it works as a Slackware bootstick, a dual boot system and Slackware 13.1 installation medium?

I'm planning to install 13.1 on a netbook (Samsung NP-N150-KA01IN) which comes with Windows 7 installed and probably an OEM recovery partition (I don't have the netbook yet). In this LQ thread, dimm0k asked about keeping the OEM boot system including OEM recovery while being able to dual boot Slackware. samac suggested using a USB stick to control the boot.

During Slackware installation there is a step to create a USB bootstick.

The netbook does not have a CD/DVD drive so I plan to use Eric Hameleers' usbimg2disk.sh (now part of the Slackware 13.1 distribution).

It would be great if all three functions could be combined on single USB stick and it could also carry data files. I would be able to carry a complete "disaster recovery" solution while travelling light.

Only downside to this plan is that losing the USB stick would mean only being able to boot Windows 7 :(

I'm happy to put some work into this but don't know where to look for the architecture of the bootstick and can't reverse engineer it not having created one during installation. Suggestions very welcome.

Best

Charles

linus72 05-27-2010 12:59 PM

Hey catkin

Well, why not use Plop Bootmanager, the executable, not the install-to-MBR one
I include iin all my live stuff
its like 2kb!

anyway, it can boot hdd, usb,cdroms,usb-cdroms,etc on pc's with or without BIOS support for usb,etc
Heres one I use-
http://multidistro.com/downloads/plpbt

So, it can boot the windows hdd from a usb no issue
it can also, on most, boot the usb its on too

very simple too and its somewhat configurable

so, say you had your windows netbook, a fat32/ext2/ext3 usb
and the usb has maybe the whole slack tree, or DVD iso, etc
just make a syslinux.cfg or grub menu.lst or grub2(did you know grub2 can run from fat32 usb?)
and the syslinux.cfg,menu.lst,etc would have plop and slack and whatever entries also
thats actually how I install slack from a DVD on hdd partition

I put the slack kernel(hugesmp.s) , initrd.img and plop on the usb
with a syslinux.cfg
the slack dvd is on hdd partition
my PC doesn't boot from usb
so, I have a grub2 menu entry for plop too
I boot the usb, then boot slack kernel
make 2 mountpoints
mkdir /source
mkdir /iso
then I mount my hdd partition where the dvd is
mount /dev/sda2 /source
then mount the dvd
mount -o loop /source/slack-dvd.iso /iso

then I enter "setup"
and when it gets to where medium is I say premounted directory
and enter
/iso/slackware

anyway, point is Plop plpbt can boot almost anything

But, maybe there are other solutions too?
EDIT: unconfigured, Plop can only "see" the first 4 hdd partitions
as I said it is somewhat configureable and doesn't need to install anywhere

linus72 05-27-2010 01:28 PM

Ok

so heres a sample grub2, grub1, and isolinux/syslinux menu entries for Plop plpbt

Grub2(make sue you use "linux16", not "linux"
Code:

menuentry "PLOP" {
        linux16        /boot/plpbt
}

Grub Legacy
Code:

title Plop Bootmanager
root (hdx,x)
kernel /boot/plpbt

isolinux/syslinux.cfg
Code:

label plpbt
menu label Plop Bootmanager
kernel /boot/plpbt

syslinux.cfg with Plop and slack isolinux.cfg(just rename isolinux folder to syslinux, rename isolinux.cfg to syslinux.cfg
assuming everything on usb is in folder named "current"
Code:

default hugesmp.s
prompt 1
timeout 1200
display /current/message.txt
F1 /current/message.txt
F2 /current/f2.txt
label plpbt
menu label Plop Bootmanager
kernel /current/plpbt
label huge.s
  kernel /current/bzImage
  append initrd=/current/initrd.img load_ramdisk=1 prompt_ramdisk=0 rw SLACK_KERNEL=huge.s
label hugesmp.s
  kernel /current/bzImage
  append initrd=/current/initrd.img load_ramdisk=1 prompt_ramdisk=0 rw SLACK_KERNEL=hugesmp.s
label speakup.s
  kernel /current/bzImage
  append initrd=/current/initrd.img load_ramdisk=1 prompt_ramdisk=0 rw SLACK_KERNEL=speakup.s

EDIT: and of course nothing on pc/lappy is touched
or installed to mbr

catkin 05-27-2010 01:43 PM

Thanks linus72 :)

That will take some digesting but Plop sounds powerful. I'll give the thread a while to gather more replies before jumping in.

linus72 05-27-2010 01:51 PM

I agree, as there may be an easier, simpler way

catkin 05-30-2010 09:36 AM

Some more information about the USB bootstick ...

The script that creates the USB bootstick can be found after installation as /var/log/setup/setup.80.make-bootdisk but it cannot ordinarily be run after installation because it requires syslinux which is part of the installation system but not AFAIK installed.

The USB bootstick has a FAT12 file system. The help text explains what it does ($ROOT_DEVICE is substituted when the bootstick is created):
Code:

By default, this stick boots a root Linux partition on $ROOT_DEVICE when you
hit ENTER.  If you'd like to boot some other partition, use a command like
this on the prompt below:

    mount root=/dev/sda1 ro

Where "/dev/sda1" is the partition you want to boot, and "ro" specifies that
the partition should be initially mounted as read-only.  If you wish to mount
the partition read-write, use "rw" instead.  To set the video console mode,
use the vga= parameter (press F1 to see a table).  You may also add any other
kernel parameters you might need depending on your hardware, and which
drivers are included in your kernel.


sahko 05-30-2010 10:00 AM

I always use isohybrid http://syslinux.zytor.com/wiki/index...HARD_DISK_MODE

bgeddy 05-30-2010 10:25 AM

Quote:

The script that creates the USB bootstick can be found after installation as /var/log/setup/setup.80.make-bootdisk but it cannot ordinarily be run after installation because it requires syslinux which is part of the installation system but not AFAIK installed.
If you neeed to run any of these setup scripts it's easiest to just run pkgtool as root and select "Setup - Choose Slackware installation scripts to run again".

Syslinux is installed in a full Slackware install - it's in the 'a' package series in syslinux-3.84-x86_64-2 on Slackware64 13.1. The usb disk creation scripts run fine.

allend 05-30-2010 10:51 AM

Quote:

Only downside to this plan is that losing the USB stick would mean only being able to boot Windows 7
I suggest you consider setting up a multiboot arrangement rather than using a USB stick.

I recently installed Slackware on an Acer eMachine eM250 that has no optical drive and came with the OEM recovery partition on the first partition and WindowsXP on the second partition.
My method was:
Prepared a USB boot stick with the usbinstaller on the install DVD.
Upon starting, I hit F12 to get a boot device menu and selected the USB option.
Once I had a root login, I then mounted a backup of an existing Slackware installation on an external USB hard disk. I did 'chroot' to this so that I could use 'ntfsresize' to reduce the size of the
preinstalled NTFS partition containing the WindowsXP partition.
I then rebooted into Windows to complete the NTFS resize and used the Windows disk manager tool to setup additional partitions.
After again rebooting with the USB stick, I conducted an NFS install from the install DVD mounted in my desktop. (I had previously set up NFS on the desktop for use with another laptop.)

I am now multi booting Windows and Slackware (13.0 and 13.1) as well as the OEM recovery partition using LILO installed on the MBR as the boot loader.

catkin 06-01-2010 02:50 AM

Quote:

Originally Posted by bgeddy (Post 3986315)
If you neeed to run any of these setup scripts it's easiest to just run pkgtool as root and select "Setup - Choose Slackware installation scripts to run again".

Syslinux is installed in a full Slackware install - it's in the 'a' package series in syslinux-3.84-x86_64-2 on Slackware64 13.1. The usb disk creation scripts run fine.

Thanks bgeddy :) that will teach me to do a full installation next time, as recommended.

catkin 06-01-2010 02:55 AM

Quote:

Originally Posted by sahko (Post 3986281)

Thanks sahko :) that looks like another option to explore.

catkin 06-01-2010 03:19 AM

Quote:

Originally Posted by allend (Post 3986333)
I am now multi booting Windows and Slackware (13.0 and 13.1) as well as the OEM recovery partition using LILO installed on the MBR as the boot loader.

Thanks allend :) It's good to learn you were able to do that and using standard tools is nice. I'll probably:
  1. Use a bootable BootIT New Generation (BING) to resize the RECOVERY and WXP installation partitions (good experiences and familiarity)
  2. Use GRUB rather than LILO (familiarity).
  3. Install fully from a USB stick rather than from a networked file system (so can easily carry disaster recovery tools).
  4. Use usbimg2disk.sh. Still downloading Slackware 13.1 so have not been able to experiment yet.
First set-back last night when tried to make a bootable USB stick with KNOPPIX. Used the ImageWriter technique of
dd bs=4096 if=KNOPPIX_V6.2.1DVD-2010-01-31-EN.iso of=/dev/sdc but neither Samsung N150 nor regular desktop computer would boot it. After booting regular computer from HDD its /var/log/messages had kernel: sdc: unknown partition table but Thunar (Xfce file manager) mounted it OK as iso9660 and was able to browse it ... ?

allend 06-01-2010 03:35 AM

Comments on:
1. Leave that RECOVERY partition alone!
2. I am told it works.
3. That would be just fine. I just did not need to bother with copying the install disk to my usb key or an external USB drive by using this technique.
4. I am a great fan of tools from Alien_Bob.

As for the last, take it up with the KNOPPIX people.

Good luck and have fun :-)

catkin 06-01-2010 04:57 AM

Quote:

Originally Posted by allend (Post 3988300)
1. Leave that RECOVERY partition alone!

Thanks for the warning. Will do.

catkin 06-30-2010 09:10 PM

Update

I went the easy root in the end, leaving the as-supplied partitions untouched, using usbimg2disk.sh to format and populate the USB memory stick and doing a standard Slackware installation -- including installing LILO to the internal HDD and choosing not to make a "Slackware USB boot stick" (it uses FAT12 so the USB stick isn't much use for anything else and the functionality it provides can be provided in other ways).

Plop would probably have been the cleanest, most powerful solution and ISOLINUX worth investigating but I've lost a lot of USB sticks so requiring a USB stick to boot Slackware off HDD was a high risk.

gnashley 07-01-2010 02:54 AM

Too bad plop is not open-source.


All times are GMT -5. The time now is 09:47 PM.