LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-29-2009, 11:27 AM   #1
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,087

Rep: Reputation: 337Reputation: 337Reputation: 337Reputation: 337
Possible to boot a Linux distro from a EXT2 formatted USB?


I know Syslinux boots from FAT32/16, is there something to boot a "livecd/liveUSB" distro from an EXT2 type partition on a USB drive, or must it be FAT32/16??
 
Old 03-29-2009, 11:41 AM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
puppy boots from ext3 on usb (is the default AFAIK)
 
Old 03-29-2009, 11:59 AM   #3
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,087

Original Poster
Rep: Reputation: 337Reputation: 337Reputation: 337Reputation: 337
Really-but how does it boot?
With isolinux or syslinux?
 
Old 03-29-2009, 12:19 PM   #4
mrclisdue
Senior Member
 
Registered: Dec 2005
Distribution: Slackware -current, 14.1
Posts: 1,075

Rep: Reputation: 189Reputation: 189
Slax boots from usb, ext2 or ext3, using lilo - there's a script, liloinst.sh that invokes lilo and includes a lilo.conf within:

Code:
#!/bin/bash
# This script will make almost ANY partition bootable, regardless the filesystem
# used on it. bootinst.sh/.bat is only for FAT filesystems, while this one should
# work everywhere. Moreover it setups a 'slaxchanges' directory to be used for
# persistent changes.

set -e
TARGET=""
MBR=""

# Find out which partition or disk are we using
MYMNT=$(cd -P $(dirname $0) ; pwd)
while [ "$MYMNT" != "" -a "$MYMNT" != "." -a "$MYMNT" != "/" ]; do
   TARGET=$(egrep "[^[:space:]]+[[:space:]]+$MYMNT[[:space:]]+" /proc/mounts | cut -d " " -f 1)
   if [ "$TARGET" != "" ]; then break; fi
   MYMNT=$(dirname "$MYMNT")
done

if [ "$TARGET" = "" ]; then
   echo "Can't find device to install to."
   echo "Make sure you run this script from a mounted device."
   exit 1
fi

if [ "$(cat /proc/mounts | grep "^$TARGET" | grep noexec)" ]; then
   echo "The disk $TARGET is mounted with noexec parameter, trying to remount..."
   mount -o remount,exec "$TARGET"
fi

MBR=$(echo "$TARGET" | sed -r "s/[0-9]+\$//g")
NUM=${TARGET:${#MBR}}
cd "$MYMNT"

# only partition is allowed, not the whole disk
if [ "$MBR" = "$TARGET" ]; then
   echo Error: You must install your system to a partition, not the whole disk
   exit 1
fi

clear
echo "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
echo "                        Welcome to Slax boot installer                         "
echo "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
echo
echo "This installer will setup disk $MBR to boot only Slax from $TARGET."
echo "Warning! Master boot record (MBR) of $MBR will be overwritten."
echo "If you use $MBR to boot any existing operating system, it will not work"
echo "anymore. Only Slax will boot from this device. Be careful!"
echo
echo "Press any key to continue, or Ctrl+C to abort..."
read junk
clear

echo "Flushing filesystem buffers, this may take a while..."
sync

mkdir -p $MYMNT/slaxchanges
if [ $? -ne 0 ]; then
   echo "Make sure to mount the partition read-write." >&2
   exit 5
fi

cat << ENDOFTEXT >$MYMNT/boot/lilo.conf
boot=$MBR
prompt
timeout=40
lba32
compact
change-rules
reset
install=text
image=$MYMNT/boot/vmlinuz
initrd=$MYMNT/boot/initrd.gz
label=Slax
root=/dev/ram0
read-write
append = "ramdisk_size=6666 changes=slaxchanges toram"
ENDOFTEXT

echo Updating MBR to setup boot record...
boot/syslinux/lilo -C $MYMNT/boot/lilo.conf -S $MYMNT/boot/ -m $MYMNT/boot/lilo.map
echo "Disk $MBR should be bootable now. Installation finished."

echo
echo "Read the information above and then press any key to exit..."
read junk
cheers,
 
Old 03-29-2009, 12:23 PM   #5
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,087

Original Poster
Rep: Reputation: 337Reputation: 337Reputation: 337Reputation: 337
Damn it Jim!
I already have it too!
Dolt!
I have alot of scripts I've collected-I need some more.
Thanks alot.

Last edited by linus72; 04-04-2009 at 09:36 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
recovery mkfs.ext2 formatted USB-Stick eriche Linux - General 1 03-30-2009 03:52 PM
Read an EXT2 formatted flopy in Windows bilali Programming 5 05-10-2008 05:23 AM
External WD500 (ext2 or ext3, Suse 10.2) 'no longer formatted' after hard reset PeterHK Linux - Distributions 2 10-05-2007 04:49 PM
Flashdisk -- accidentally formatted to ext2 ... BinJajer Linux - Hardware 1 01-26-2006 04:47 PM
rm lockup on usb stick formatted as ext2 pbjoiner Linux - General 0 03-18-2005 06:29 PM


All times are GMT -5. The time now is 02:23 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration