LinuxQuestions.org
Help answer threads with 0 replies.
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 11-18-2007, 11:29 PM   #1
ItsTimeToMoveOn
LQ Newbie
 
Registered: Nov 2007
Distribution: Ubuntu
Posts: 28

Rep: Reputation: 15
How do I install Ubuntu without a CD


I've looked and looked but I can't find out how to do this:

I have half my HD partitioned and I want to install Ubuntu on it without making a CD. How would I go about installing Ubuntu on there without disrupting my windows OS. How do I need to format it? If anyone could give me an entire rundown of how to go about doing this? Don't leave anything out that you think would be helpful. Thanks!
 
Old 11-19-2007, 12:19 AM   #2
duryodhan
Senior Member
 
Registered: Oct 2006
Distribution: Slackware 12 Kernel 2.6.24 - probably upgraded by now
Posts: 1,054

Rep: Reputation: 46
you will need linux afaik.
I have this script somewhere in my comp ... I don't know where I got it from .. it is GPLed .
Quote:
#!/bin/bash
# Convert an Ubuntu live CD iso so that it's bootable off of a USB stick
# Copyright 2007 Red Hat, Inc.
# Jeremy Katz <katzj@redhat.com>
# Jani Monoses <jani@ubuntu.com> (slightly adapted to Ubuntu LiveCD)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Library General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.



# Running :
#$ sudo ./isotostick.sh /path/to/image.iso /dev/sdb1


export PATH=/sbin:/usr/sbin:$PATH

usage() {
echo "$0 [--reset-mbr] [--noverify] <isopath> <usbstick device>"
exit 1
}

cleanup() {
[ -d "$CDMNT" ] && umount $CDMNT && rmdir $CDMNT
[ -d "$USBMNT" ] && umount $USBMNT && rmdir $USBMNT
}

exitclean() {
echo "Cleaning up to exit..."
cleanup
exit 1
}

getdisk() {
DEV=$1

p=$(udevinfo -q path -n $DEV)
if [ -e /sys/$p/device ]; then
device=$(basename /sys/$p)
else
device=$(basename $(readlink -f /sys/$p/../))
fi
if [ ! -e /sys/block/$device -o ! -e /dev/$device ]; then
echo "Error finding block device of $DEV. Aborting!"
exitclean
fi

device="/dev/$device"
}

resetMBR() {
getdisk $1
cat /usr/lib/syslinux/mbr.bin > $device
}

checkMBR() {
getdisk $1

bs=$(mktemp /tmp/bs.XXXXXX)
dd if=$device of=$bs bs=512 count=1 2>/dev/null || exit 2

mbrword=$(hexdump -n 2 $bs |head -n 1|awk {'print $2;'})
rm -f $bs
if [ "$mbrword" = "0000" ]; then
echo "MBR appears to be blank."
echo "Do you want to replace the MBR on this device?"
echo "Press Enter to continue or ctrl-c to abort"
read
resetMBR $1
fi

return 0
}

checkPartActive() {
dev=$1
getdisk $dev

# if we're installing to whole-disk and not a partition, then we
# don't need to worry about being active
if [ "$dev" = "$device" ]; then
return
fi

if [ "$(/sbin/fdisk -l $device 2>/dev/null |grep $dev |awk {'print $2;'})" != "*" ]; then
echo "Partition isn't marked bootable!"
echo "You can mark the partition as bootable with "
echo " # /sbin/parted $device"
echo " (parted) toggle N boot"
echo " (parted) quit"
exitclean
fi
}

checkFilesystem() {
dev=$1

USBFS=$(/lib/udev/vol_id -t $dev)
if [ "$USBFS" != "vfat" -a "$USBFS" != "msdos" -a "$USBFS" != "ext2" -a "$USBFS" != "ext3" ]; then
echo "USB filesystem must be vfat or ext[23]"
exitclean
fi

USBLABEL=$(/lib/udev/vol_id -u $dev)
if [ -n "$USBLABEL" ]; then
USBLABEL="UUID=$USBLABEL" ;
else
USBLABEL=$(/lib/udev/vol_id -l $dev)
if [ -n "$USBLABEL" ]; then
USBLABEL="LABEL=$USBLABEL"
else
echo "Need to have a filesystem label or UUID for your USB device"
if [ "$USBFS" = "vfat" -o "$USBFS" = "msdos" ]; then
echo "Label can be set with /sbin/dosfslabel"
elif [ "$USBFS" = "ext2" -o "$USBFS" = "ext3" ]; then
echo "Label can be set with /sbin/e2label"
fi
exitclean
fi
fi
}

checkSyslinuxVersion() {
if [ ! -x /usr/bin/syslinux ]; then
echo "You need to have syslinux installed to run this script"
exit 1
fi
if ! syslinux 2>&1 | grep -qe -d; then
SYSLINUXPATH=""
else
SYSLINUXPATH="syslinux"
#menu texts are trimmed when syslinux is not in / no idea why
SYSLINUXPATH=""
fi
}

if [ $(id -u) != 0 ]; then
echo "You need to be root to run this script"
exit 1
fi

while [ $# -gt 2 ]; do
case $1 in
--noverify)
noverify=1
;;
--reset-mbr|--resetmbr)
resetmbr=1
;;
*)
usage
;;
esac
shift
done

ISO=$1
USBDEV=$2

if [ -z "$ISO" -o ! -e "$ISO" ]; then
usage
fi

if [ -z "$USBDEV" -o ! -b "$USBDEV" ]; then
usage
fi

if [ -z "$noverify" ]; then
# verify the image
echo "Not verifying image...(no checkisomd5 in Ubuntu so skipping)!"
#checkisomd5 --verbose $ISO
if [ $? -ne 0 ]; then
echo "Are you SURE you want to continue?"
echo "Press Enter to continue or ctrl-c to abort"
read
fi
fi

# do some basic sanity checks.
checkSyslinuxVersion
checkFilesystem $USBDEV
checkPartActive $USBDEV
checkMBR $USBDEV
[ -n $resetmbr ] && resetMBR $USBDEV

# FIXME: would be better if we had better mountpoints
CDMNT=$(mktemp -d /media/cdtmp.XXXXXX)
mount -o loop $ISO $CDMNT || exitclean
USBMNT=$(mktemp -d /media/usbdev.XXXXXX)
mount $USBDEV $USBMNT || exitclean

trap exitclean SIGINT SIGTERM

if [ -d $USBMNT/casper ]; then
echo "Already set up as live image. Deleting old in fifteen seconds..."
sleep 15

rm -rf $USBMNT/casper
fi

echo "Copying live image to USB stick"
if [ ! -d $USBMNT/$SYSLINUXPATH ]; then mkdir $USBMNT/$SYSLINUXPATH ; fi

for file in \
README.diskdefines md5sum.txt \
.disk casper pool dists preseed install;do
cp -a $CDMNT/$file $USBMNT/
done

cp $CDMNT/isolinux/* $USBMNT/$SYSLINUXPATH

echo "Installing boot loader"
if [ "$USBFS" = "vfat" -o "$USBFS" = "msdos" ]; then
# syslinux expects the config to be named syslinux.cfg
# and has to run with the file system unmounted
mv $USBMNT/$SYSLINUXPATH/isolinux.cfg $USBMNT/$SYSLINUXPATH/syslinux.cfg
cleanup
if [ -n "$SYSLINUXPATH" ]; then
syslinux -d $SYSLINUXPATH $USBDEV
else
syslinux $USBDEV
fi
elif [ "$USBFS" = "ext2" -o "$USBFS" = "ext3" ]; then
# extlinux expects the config to be named extlinux.conf
# and has to be run with the file system mounted
mv $USBMNT/$SYSLINUXPATH/isolinux.cfg $USBMNT/$SYSLINUXPATH/extlinux.conf
extlinux -i $USBMNT/syslinux
cleanup
fi

echo "USB stick set up as live image!"
 
Old 11-19-2007, 12:24 AM   #3
ItsTimeToMoveOn
LQ Newbie
 
Registered: Nov 2007
Distribution: Ubuntu
Posts: 28

Original Poster
Rep: Reputation: 15
Uhm...I'm even more lost now. What?
 
Old 11-19-2007, 12:38 AM   #4
2damncommon
Senior Member
 
Registered: Feb 2003
Location: Calif, USA
Distribution: PCLINUXOS
Posts: 2,876

Rep: Reputation: 88
Maybe look at Wubi.
 
Old 11-19-2007, 06:50 AM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Out of curiosity, why not use a CD?

I assume that you don't already have Linux installed somewhere. Without already having a Linux system, the advice from duryodhan is not relevant.
 
Old 11-19-2007, 01:30 PM   #6
ItsTimeToMoveOn
LQ Newbie
 
Registered: Nov 2007
Distribution: Ubuntu
Posts: 28

Original Poster
Rep: Reputation: 15
The last 4 times I've tried using a CD, I always get errors. Missing kernal or something. Thanks 2Damncommon, got it up and running. Now if I could figure out how to install my nvidia driver so my screens not 640x480 and half way out of my monitor. Ive tried using the synamtec manager thingy, sh, sudo, all that stuff and none of it works.
 
Old 11-19-2007, 02:07 PM   #7
ItsTimeToMoveOn
LQ Newbie
 
Registered: Nov 2007
Distribution: Ubuntu
Posts: 28

Original Poster
Rep: Reputation: 15
Ok, since I've got my first question anwsered by 2damncommon(and thankyou for that info), I feel this threads finished. Thanks for the help!
 
  


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
RealPlayer install location (easy install for Ubuntu) tferero Linux - Newbie 5 11-07-2007 08:06 AM
What difference does it make if I install Ubuntu 6.06 or Ubuntu 7.04 tjsullivan1 Ubuntu 3 08-15-2007 07:34 AM
can you install games on ubuntu that are windows?my children love ubuntu but we can't chasity Linux - Software 3 07-14-2006 12:15 AM
Clean install from Ubuntu Warty to Ubuntu Hoary Erik_the_Red Linux - Newbie 2 06-05-2005 07:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:45 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration