Ok, where/how do I submit this to the CentOS project?
Here's a complete script - anyone, *please* feel free to test it, and let me know if I've missed anything.
Thanks in advance.
mark
#!/bin/bash # ################################### # Author: mark roth # Date: 30 Apr. 2010 # Purpose: to create a working, bootable CentOS install on a USB key #####################################
if [[ $# < 2 ]]; then echo "usage: $0 <devname> <path/to/install.iso>" echo " Example: $0 sdb /scratch/CentOS-5.4-bin-DVD.iso" echo " Note: you must install livecd-tools before running this." exit fi
/sbin/sfdisk -n -uM /dev/$1 << EOF ,10,b,* ,,83 ; ; EOF
mkfs -t vfat /dev/${1}1 mkfs /dev/${1}2
/usr/bin/livecd-iso-to-disk /scratch/CentOS-5.4-i386-LiveCD.iso /dev/${1}1 mount /dev/${1}2 /mnt cp $2 /mnt/
# end
On Fri, Apr 30, 2010 at 11:03 AM, m.roth@5-cent.us wrote:
Ok, where/how do I submit this to the CentOS project?
Here's a complete script - anyone, *please* feel free to test it, and let me know if I've missed anything.
Thanks in advance.
mark
#!/bin/bash # ################################### # Author: mark roth # Date: 30 Apr. 2010 # Purpose: to create a working, bootable CentOS install on a USB key #####################################
if [[ $# < 2 ]]; then echo "usage: $0 <devname> <path/to/install.iso>" echo " Example: $0 sdb /scratch/CentOS-5.4-bin-DVD.iso" echo " Note: you must install livecd-tools before running this." exit fi
/sbin/sfdisk -n -uM /dev/$1 << EOF ,10,b,* ,,83 ; ; EOF
mkfs -t vfat /dev/${1}1 mkfs /dev/${1}2
/usr/bin/livecd-iso-to-disk /scratch/CentOS-5.4-i386-LiveCD.iso /dev/${1}1
s/scratch/CentOS-5.4-i386-LiveCD.iso/${2}/ ???
mount /dev/${1}2 /mnt cp $2 /mnt/
# end
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
-Bob
Bob wrote:
On Fri, Apr 30, 2010 at 11:03 AM, m.roth@5-cent.us wrote:
Ok, where/how do I submit this to the CentOS project?
Here's a complete script - anyone, *please* feel free to test it, and let me know if I've missed anything.
<snip>
#!/bin/bash # ################################### # Author: mark roth # Date: 30 Apr. 2010 # Purpose: to create a working, bootable CentOS install on a USB key #####################################
<MVNCH>
/usr/bin/livecd-iso-to-disk /scratch/CentOS-5.4-i386-LiveCD.iso /dev/${1}1
s/scratch/CentOS-5.4-i386-LiveCD.iso/${2}/ ???
As in, /usr/bin/livecd-iso-to-disk $2
Thanks, Bob, just what I needed. There's probably too much blood in my caffeine stream for me to have noticed that. <snip>
mark
m.roth@5-cent.us wrote on 04/30/2010 11:03 AM:
Ok, where/how do I submit this to the CentOS project?
http://wiki.centos.org/Contribute
If you don't want to jump through the hoops required to become a Wiki author, let me know and I'll be glad to add it with attribution to
http://wiki.centos.org/HowTos/InstallFromUSBkey
Phil
From: "m.roth@5-cent.us" m.roth@5-cent.us
Ok, where/how do I submit this to the CentOS project? Here's a complete script - anyone, *please* feel free to test it, and let me know if I've missed anything.
Don't forget to say in the wiki where to get this 'livecd-iso-to-disk' fedora script
JD
m.roth@5-cent.us wrote on 04/30/2010 11:03 AM:
Ok, where/how do I submit this to the CentOS project?
Here's a complete script - anyone, *please* feel free to test it, and let me know if I've missed anything.
Variation on your theme. Uses ext2 and extlinux with no FAT partition. Remove "-n" from sfdisk so changes are written. Adds some error checking.: ---------------------------------------------------------------------------- #!/bin/bash # ################################### # Author: mark roth # Date: 30 Apr. 2010 # Purpose: to create a working, bootable CentOS install on a USB key #####################################
PATH=/sbin:/bin:/usr/sbin:/usr/bin
if [[ $# < 2 ]]; then echo "usage: $0 <devname> <path/to/install.iso>" echo " Example: $0 sdb /scratch/CentOS-5.4-bin-DVD.iso" exit 1 fi
if [[ ! -f /usr/bin/livecd-iso-to-disk ]]; then echo "You must install livecd-tools before running this." echo "See: http://projects.centos.org/trac/livecd/wiki/GetToolset" exit 2 fi
if [[ -f $2 ]]; then if file $2 | grep -q "ISO 9660"; then echo "Using ISO image $2 ..." else echo "$2 is not an ISO image!" exit 3 fi else echo "$2 ISO image file not found." exit 4 fi
if [[ $EUID -ne 0 ]]; then echo "This script must be run as root." exit 5 fi
if sfdisk -l /dev/$1 >& /dev/null; then echo "Current partitions for /dev/$1:" sfdisk -l /dev/$1 echo -n "Press <Enter> to continue or ^C to abort: " read aline else echo "No such device /dev/$1" exit 6 fi
sfdisk -uM /dev/$1 << EOF ,,83,* ; ; ; EOF
echo "Remove and reinsert the USB key." echo " Use Safely Remove first if in a GUI." echo " Do not mount in GUI after reinsertion." echo -n " Press <Enter> to continue: "
read aline
mkfs /dev/${1}1
/usr/bin/livecd-iso-to-disk --reset-mbr $2 /dev/${1}1
echo "USB boot media of $2 done."
# end ---------------------------------------------------------------------------- Unfortunately the only system I have to test on at the moment boots the installer OK, then asks for the installation media, but doesn't see the USB device when Hard Disk is selected. With the FAT partition and syslinux doesn't see the device as bootable at all.
Phil wrote:
m.roth@5-cent.us wrote on 04/30/2010 11:03 AM:
Ok, where/how do I submit this to the CentOS project?
Here's a complete script - anyone, *please* feel free to test it, and let me know if I've missed anything.
Variation on your theme. Uses ext2 and extlinux with no FAT partition. Remove "-n" from sfdisk so changes are written. Adds some error
Duh, sorry, thanks for noticing the -n.
Here's a question, though: I was under the impression that livecd-iso-to-disk *required* FAT. Also, if I were to make it ext2, would that still be turned into an 8+M filesystem?
checking.:
#!/bin/bash # ################################### # Author: mark roth # Date: 30 Apr. 2010 # Purpose: to create a working, bootable CentOS install on a USB key #####################################
PATH=/sbin:/bin:/usr/sbin:/usr/bin
if [[ $# < 2 ]]; then echo "usage: $0 <devname> <path/to/install.iso>" echo " Example: $0 sdb /scratch/CentOS-5.4-bin-DVD.iso" exit 1 fi
if [[ ! -f /usr/bin/livecd-iso-to-disk ]]; then echo "You must install livecd-tools before running this." echo "See: http://projects.centos.org/trac/livecd/wiki/GetToolset" exit 2 fi
if [[ -f $2 ]]; then if file $2 | grep -q "ISO 9660"; then echo "Using ISO image $2 ..." else echo "$2 is not an ISO image!" exit 3 fi else echo "$2 ISO image file not found." exit 4 fi
if [[ $EUID -ne 0 ]]; then echo "This script must be run as root." exit 5 fi
if sfdisk -l /dev/$1 >& /dev/null; then echo "Current partitions for /dev/$1:" sfdisk -l /dev/$1 echo -n "Press <Enter> to continue or ^C to abort: " read aline else echo "No such device /dev/$1" exit 6 fi
sfdisk -uM /dev/$1 << EOF ,,83,* ; ; ; EOF
echo "Remove and reinsert the USB key." echo " Use Safely Remove first if in a GUI." echo " Do not mount in GUI after reinsertion." echo -n " Press <Enter> to continue: "
read aline
mkfs /dev/${1}1
/usr/bin/livecd-iso-to-disk --reset-mbr $2 /dev/${1}1
echo "USB boot media of $2 done."
# end
Unfortunately the only system I have to test on at the moment boots the installer OK, then asks for the installation media, but doesn't see the USB device when Hard Disk is selected. With the FAT partition and syslinux doesn't see the device as bootable at all.
Right. That's why I did it the way I did: once you get there, you tell it h/d, then point it to the second partition, that has all the rest of the USB key's space on it, and the whole .iso.
mark
On Mon, 3 May 2010 17:21:02 -0400 Phil Schaffner Philip.R.Schaffner@NASA.gov wrote:
m.roth@5-cent.us wrote on 04/30/2010 11:03 AM:
Ok, where/how do I submit this to the CentOS project?
Here's a complete script - anyone, *please* feel free to test it, and let me know if I've missed anything.
Does anyone have a copy of livecd-iso-to-disk converted to use blkid instead of vol_id?