LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-18-2017, 01:58 PM   #1
askfor
Member
 
Registered: Aug 2016
Posts: 84

Rep: Reputation: 46
boot from USB external drive case


I happen to have external drive case with USB interface. The drive inside classic SATA hard drive partitioned with DOS/MBR scheme. Drive has some data which can't be deleted at the moment and one free primary partition. That would be /dev/sdb3. I was thinking to mark sdb3 as active, copy data from ISO image with dd and create bootable installation image. Could it actually work that way ?
 
Old 10-18-2017, 02:36 PM   #2
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Do you want to copy an installation disk over to the drive so you can take the drive to various computers to install it, or do you want to install Slackware to that partition so you can use that drive as your normal OS?
 
Old 10-18-2017, 03:32 PM   #3
askfor
Member
 
Registered: Aug 2016
Posts: 84

Original Poster
Rep: Reputation: 46
I'd like to copy installation disk over one of the primary partitions on external drive. In order to install on other computers, yes. It does not necessarily need to be Slackware installation only, could be other OS's, too. Actually, this is not a Slackware specific question, or even Linux specific, but the answer would be interesting to many out there.
 
Old 10-18-2017, 03:58 PM   #4
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,501

Rep: Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489
If you have an MBR system, installing Grub2 to the MBR of that drive pointing to the partition you want to use. You could then put any number of iso bootable files there and boot them. You would need to install Grub2 first and manually create your grub.cfg file.

Quote:
sudo grub-install --boot-directory="/media/sdb3/boot" /dev/sdb
You would first format with a Linux filesystem sdb3, then create the directory sdb3 with a boot directory in it and mount the partition. You would lose any data on sdb3 currently. There are numerous sites explaining booting an iso directly but if you have a specific distribution in mind, post back and someone might be able to give you an example.

Of course, if you already have a bootable Linux with Grub2 on that drive, the only step necessary is creating the menuentries in grub.cfg.

Simply copying an iso image to a partition with dd or some other means is not going to make it bootable. You need a bootloader and Grub2 works fine for this.

Not sure why you would want to mark the partition as 'active' unless you plan to put some windows software on it. It won't be a problem but I've never found it necessary with any Linux. I'm not sure Grub2 will directly boot a windows iso, at least I'm unaware of any method but you can extract the iso contents of windows and copy to a partition and boot with a correct menuentry.
 
Old 10-18-2017, 04:19 PM   #5
askfor
Member
 
Registered: Aug 2016
Posts: 84

Original Poster
Rep: Reputation: 46
What am I trying to do is use sdb3 as bootable CD or stick. External disk has partition table and 4 partitions, 3 primaries and one extended. It also has MBR code in first sector. My reasoning is that any BIOS capable of booting from USB and booting from DOS/MBR partitions should be able to boot any OS installation image on active partition. In theory.

At the moment I have LILO on the external disk with Slackware on /dev/sdb2 and some Windows on /dev/sdb1. LILO is installed in /dev/sdb2 and it used to boot both Slackware and Windows.

Booting LILO on /dev/sdb2 and other OS on /dev/sdb3 sounds fine. But if that works, then marking /dev/sdb3 as active partition and booting from it seems even simpler. Besides, I am not sure how to setup LILO to boot from ISO image.

However, you gave me an idea. If I could boot Slack on /dev/sdb2 then I could probably boot iso image on sdb3, as well. If the latter is made active. And I can try it out right away, without waiting for several gigs to be copied over USB. Thanks, you have helped me a lot.
 
Old 10-19-2017, 04:42 AM   #6
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,484

Rep: Reputation: Disabled
Much easier to make a live pendrive to use as an install media, & no danger of causing problems to what is already working on your external HDD.
 
Old 10-19-2017, 06:23 AM   #7
askfor
Member
 
Registered: Aug 2016
Posts: 84

Original Poster
Rep: Reputation: 46
I have never played with USB boot so far. I am able to boot in LILO on old /dev/sdb drive. LILO is installed on /dev/sdb2 which is marked as 'active'.

However, I tried to copy FreeDOS ISO to /dev/sdb3 with dd. Then I made sdb3 active. Machine won't boot ISO image, the message is "Error: missing operating system". dd command line was:

dd if=FD12CD.iso of=/dev/sdb3 bs=16M status=progress

I also tried an old Windows CD, which is not very large. same result. I also tried boot with qemu-kvm:

qemu-kvm -hda /dev/sda3

Same result.

Last edited by askfor; 10-19-2017 at 08:34 AM.
 
Old 10-20-2017, 04:35 AM   #8
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,484

Rep: Reputation: Disabled
If I remember right, lilo will only boot one OS, so unless you changed which partition it is trying to boot from, it is still trying to boot sda2. Maybe you should use grub, or syslinux/extlinux, as your boot manager.
 
Old 10-20-2017, 06:31 AM   #9
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by fatmac View Post
If I remember right, lilo will only boot one OS, so unless you changed which partition it is trying to boot from, it is still trying to boot sda2. Maybe you should use grub, or syslinux/extlinux, as your boot manager.
lilo can boot as many OSes as you can add to the lilo.conf (although, I suppose there could be a limit, but I've had at least 10 entries listed before and haven't had problems booting any of them). It supports both booting the OS directly using entries for its kernel and root device or chainloading to another bootloader.
 
Old 10-20-2017, 09:52 AM   #10
askfor
Member
 
Registered: Aug 2016
Posts: 84

Original Poster
Rep: Reputation: 46
I got it working. What I did is format free disk partition with file system appropriate for OS which needs to be installed. Then copy all the files from installation ISO image to free partition. After that I set the LILO which I had installed already on the disk to chain boot it ("other" section). Installation files can be copied by mounting ISO with "-o loop" switch.

It is probably easier with GRUB2, which can boot ISO directly. And with recent UEFI BIOS which might also be able to that. However, I need to try that yet. Hope this could help someone out there.
 
Old 10-20-2017, 01:46 PM   #11
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,484

Rep: Reputation: Disabled
Quote:
Originally Posted by bassmadrigal View Post
lilo can boot as many OSes as you can add to the lilo.conf (although, I suppose there could be a limit, but I've had at least 10 entries listed before and haven't had problems booting any of them). It supports both booting the OS directly using entries for its kernel and root device or chainloading to another bootloader.
Yes, you are right, I am wrong, I had forgotten, (in my defence, it has been many years since I have used lilo), sorry for that, OP.
 
  


Reply

Tags
boot, external hdd, usb



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Peppermint CD boots off external USB CD drive, but is ignored if put in internal CD drive and selected as the boot device Ulysses_ Linux - Hardware 4 05-09-2016 05:22 PM
duel-boot using a usb external hard drive without usb boot option Cabtech Linux - Newbie 4 04-22-2012 05:15 PM
Boot from USB external drive, from laptop without USB boot support. darirod Linux - Newbie 2 12-19-2006 10:00 AM
howto boot Suse 9.1 from external usb drive through bios-accessable boot partition McHenner Linux - Hardware 2 09-30-2004 07:27 AM
How to boot from an external USB drive? Dywas Linux - General 1 04-03-2004 02:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration