LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 12-18-2008, 08:41 AM   #1
uppman
Member
 
Registered: Jul 2008
Location: Stockholm, Sweden
Distribution: Slackware 13.1 32-bit
Posts: 145

Rep: Reputation: 24
Howto: LiveCD/DVD with ramdisk coolness


Hi fellow Slackers!

I have more or less finished my latest project, a LiveCD/DVD which runs completely in RAM (tmpfs).
The cool stuff is that the LiveCD/DVD can utilize a swap file on disk to expand the available RAM memory. This allows a complete Slackware installation to be used as a LiveDVD.

You can actually use ANY installation, just put e.g. diskimage.tar.gz file on a DVD and run live/livedvd image=diskimage.tar.gz. Be quick to change to your DVD after the kernel is booting.

Try it out:
(Slackware 12.2)
http://linuxconfig.dyndns.org/lazy/L...pix_LiveCD/DVD

(Slackware 13.0 for 32-bit and Slackware 13.0-current for 64-bit)
http://linuxconfig.dyndns.org/lazy/L...Slackware_13.0

This is how the latest version looks at bootup:
Quote:
Welcome to GNU/Linux! Linuxfunkar-2010Jan11 (Based on Slackware 13.0 32-bit)

Support and questions should be directed at www.linuxfunkar.se

Press enter to start the system or specify command as below:

boot: linux safevga (Start the system in safe graphical mode)
boot: linux autovga (Start the system in autodetect graphical mode)
boot: linux lang=en_US keyb=us (Change locale and keyboard layout)
boot: linux 3 (Start the system in command line mode)
boot: linux label="SW_13.0" (Specify the root partition label)
boot: 2.6.32.3-smp/vmlinuz root=/dev/sda1 rootdelay=10 (For experts)
boot: live (Run "Live" using disk image from DVD)
boot: live media=disk label=SW_13.0-USB (Run "Live" from USB-disk)
boot: rescue (Rescue and disk image installation tools running from CD/DVD)
boot: rescue media=disk label=SW_13.0-USB (Run rescue tools from USB-disk)

[F1] Display this message.
[F2] Display boot configuration.
[F3-F4] Display example backup/restore commands.
You can change the locale and keyboard at the boot prompt with:
linux lang=en_US keyb=us

2010-01-11
New 32-bit version with Kernel 2.6.32.3 and some other goodies.

2009-12-12
Added version based on Slackware-current for 64-bit.

2009-12-04
Improved the installer and rescue tools and added a boot option to change the locale and keyboard layout.
Upgraded to KDE 4.3.3.
Nvidia and ATI drivers are installed.
Flash and Realplayer are installed.
All preconfigured user accounts (anv1-anv5) are locked. No password is set for root.

2009-11-05
Updated with a version for Slackware 13.0 (with KDE 4.3.2):
There is also a few new options which can be useful when you need to rescue or backup a system. It also contains a simple installer (slackdeploy.sh) which can install the LiveDVD to a hard disk.


/Magnus

Last edited by uppman; 01-15-2010 at 07:48 AM. Reason: New version 2010Jan11
 
Old 12-19-2008, 06:20 PM   #2
yasker
LQ Newbie
 
Registered: Dec 2008
Posts: 12

Rep: Reputation: 0
Thanks

That is something great friend.
I actually want to do something like that!
I'm sure that will be very useful.

Thanks.
 
Old 12-24-2008, 08:41 AM   #3
mrclisdue
Senior Member
 
Registered: Dec 2005
Distribution: Slackware
Posts: 1,134

Rep: Reputation: 277Reputation: 277Reputation: 277
So, How Can I Get This On A USB Stick?

Is there any relatively easy way to put this on a bootable usb stick?

I've been trying for a few days to put myslack on a bootable usb stick so that I can always have myslack with me - a teddy bear, so to speak.

My best chance was following the instructions at linux-live.org, but I've become bogged down too many times - I'll wait until the new year and perhaps take another stab.

I've also tried things like unetbootin, etc., but I'm having no luck.

I have, of course, been able to install slax to a usb stick, but it's just not the same.

So, can anyone offer help? Unfortunately, as of tomorrow, I'll be afk for a couple of weeks, so if you respond and I don't immediately get back to you, I'm not being rude, just incommunicado.

cheers,
 
Old 12-24-2008, 04:33 PM   #4
Romanus81
Member
 
Registered: Feb 2008
Posts: 201

Rep: Reputation: 31
You rock! I've been looking for an faq on this for so long. Thanks!
 
Old 12-24-2008, 05:10 PM   #5
HerbertJ
LQ Newbie
 
Registered: Oct 2008
Posts: 28

Rep: Reputation: 16
I have Slackware on a USB drive that I created. I use SYSLINUX ( http://syslinux.zytor.com/wiki/index.php/SYSLINUX ) to load the kernel. I use mkinitrd to create initrd.gz file that the kernel uses to first mount the loopback files where I keep all of my stuff. Unfortunately the filesize limit for FAT32 is 2GB according to "dd", so I use a couple 2GB files as loopback devices.

I recommend that if you want to do this like I did it, repartition your USB stick to have a ext2 file system on the drive if you still want to be able to use the USB stick with Windows systems. That way you will not have to mess with creating several loopback devices that are mounted at boot.

Converting an existing live CD is easier, as you only have to copy over the ISO and/or ramdisk to the USB drive after installing SYSLINUX. Use the same kernel options that the CD uses in your SYSLINUX.CFG file, changing out the root device if necessary. Fortunately, uppman's project is all ramdisk, so you won't have to fool around with getting the correct root device to load, as the root device will be in RAM. The downside is, if your computer uses USB 1, you will be waiting a long, long time for the system to load off the USB stick.
 
Old 01-02-2009, 06:37 AM   #6
uppman
Member
 
Registered: Jul 2008
Location: Stockholm, Sweden
Distribution: Slackware 13.1 32-bit
Posts: 145

Original Poster
Rep: Reputation: 24
Update with LiveUSB!

As the title says..

http://linuxconfig.dyndns.org/lazy/L...pix_LiveCD/DVD

Enjoy!

/Magnus

Last edited by uppman; 06-18-2009 at 07:40 AM. Reason: Removed :1184 from the URL, some firewalls doesn't like it..
 
Old 06-18-2009, 07:53 AM   #7
uppman
Member
 
Registered: Jul 2008
Location: Stockholm, Sweden
Distribution: Slackware 13.1 32-bit
Posts: 145

Original Poster
Rep: Reputation: 24
New Live-DVD with Slackware "Current"

I have made a couple of new Live DVD's:

For 12.2 with patches:
sw_12.2_rescue_dvd_20090604.iso

For current as of June 12:
sw_current_rescue_dvd_20090612.iso

Get'em at:
http://linuxconfig.dyndns.org/linuxf...produkter/iso/

The complete build environment and some docs are here:
http://linuxconfig.dyndns.org/linuxf..._preinstalled/

/Magnus
 
Old 06-21-2009, 06:29 PM   #8
SqdnGuns
Senior Member
 
Registered: Aug 2005
Location: Pensacola, FL
Distribution: Slackware64® Current & Arch
Posts: 1,092

Rep: Reputation: 174Reputation: 174
Tack sa mycket!!
 
Old 06-22-2009, 09:37 AM   #9
uppman
Member
 
Registered: Jul 2008
Location: Stockholm, Sweden
Distribution: Slackware 13.1 32-bit
Posts: 145

Original Poster
Rep: Reputation: 24
Quote:
Originally Posted by SqdnGuns View Post
Tack sa mycket!!
Varsaagod!
 
Old 11-05-2009, 02:55 AM   #10
uppman
Member
 
Registered: Jul 2008
Location: Stockholm, Sweden
Distribution: Slackware 13.1 32-bit
Posts: 145

Original Poster
Rep: Reputation: 24
*bump* New version for Slackware 13.0 with KDE 4.3.2!
 
Old 11-06-2009, 09:38 AM   #11
Lufbery
Senior Member
 
Registered: Aug 2006
Location: Harrisburg, PA
Distribution: Slackware 64 14.2
Posts: 1,180
Blog Entries: 29

Rep: Reputation: 135Reputation: 135
Uppman,

That's great news. I'll check it out in the next couple of days. I think this would make a great rescue disk (among other uses).

Very quick question: is it available for 32 and 64 bit computers?

Thanks,
 
Old 11-06-2009, 01:19 PM   #12
uppman
Member
 
Registered: Jul 2008
Location: Stockholm, Sweden
Distribution: Slackware 13.1 32-bit
Posts: 145

Original Poster
Rep: Reputation: 24
Quote:
Originally Posted by Lufbery View Post
Uppman,

That's great news. I'll check it out in the next couple of days. I think this would make a great rescue disk (among other uses).

Very quick question: is it available for 32 and 64 bit computers?

Thanks,
Only 32-bit at the moment.

You are welcome, I appreciate feedback!

/Magnus
 
Old 12-04-2009, 05:02 AM   #13
uppman
Member
 
Registered: Jul 2008
Location: Stockholm, Sweden
Distribution: Slackware 13.1 32-bit
Posts: 145

Original Poster
Rep: Reputation: 24
New version with improved installer

Anyone tried this stuff yet?
Now it's a childs play to install any backup disk image with my new improved installer!

Below is a sample run:

1. Pop in the DVD.
2. Type rescue at the boot prompt.
boot: rescue

*** Welcome to slackdeploy! ***
Author: Magnus Uppman <magnus_uppman@hotmail.com>

Install with two partitions (b)oot and root, or only (r)oot partition?
Show disk (i)nfo, Edit (d)isk
Reinstall (l)ilo to MBR, Reinstall lilo to (s)uperblock
Reinstall (p)lain MBR to boot the active partition
Backup par(t)ition
(q)uit, s(h)ell, (v)ersion
(i,d,l,s,p,b,r,t,q,h,v) ->b
Enter root partition device name:
(c)ancel. Show disk (i)nfo
(/dev/XXXy, c, i) ->/dev/hda2
Install root to /dev/hda2? (Warning, /dev/hda2 will be completely erased!!!)
(yes,No) ->yes
Enter boot partition device name:
(c)ancel. Show disk (i)nfo
(/dev/XXXy, c, i) ->/dev/hda1
Install extlinux to /dev/hda1? (Warning, /dev/hda1 will be completely erased!!!)
(yes,No) ->yes
Installing filesystem to root partition: /dev/hda2..


slackdeploy.sh
Code:
#!/bin/ash
#
# Author: Magnus Uppman, magnus_uppman@hotmail.com
# License: GPL

# Uses: lilo, mktemp, cfdisk, blkid, extlinux, mbr.bin, tar, mkfs (ext2,ext4)
# Changelog:
# 2009-11-23 No longer copies system_13.0.tar.gz to the root partition.
# v0.04, 2009-12-02 Added backup option. Removed set -e

VERSION=0.04

# Create temp dir
TMPDIR=`mktemp -d /tmp/slackdeploy.XXXXXX`
#echo $TMPDIR
mkdir $TMPDIR/install
mkdir $TMPDIR/boot
mkdir $TMPDIR/backup
mkdir $TMPDIR/backup-store

show_info()
{
cat /proc/partitions
/sbin/blkid -c /dev/null
}

edit_disk()
{
echo "Enter disk device name:"
echo -n "(/dev/XXX) ->"
read ASK
case $ASK in
  /dev/???)
	  /sbin/cfdisk $ASK
	  ;;
  *)	
	  echo "Wrong parameter, please try again!"
esac
}


reinstall_lilo_mbr()
{
echo "Enter root partition device name:"
echo -n "(/dev/XXXy) ->"
read ASK
case $ASK in
  /dev/????)
	  # Install lilo to MBR?
	  ROOT_PART=$ASK
	  DISK=`echo $ROOT_PART | cut -c -8`
	  echo "Install lilo to the MBR on disk $DISK? Warning, the MBR on disk $DISK will be overwritten, make sure no other operating systems are installed on this disk!"
	  echo -n "(y/N)"
	  read ASK
	  case $ASK in
	    y)
		    echo "Installing lilo to MBR in $DISK"
		    mount $ROOT_PART $TMPDIR/install
		    /sbin/lilo -v -b $DISK -r $TMPDIR/install
		    umount $TMPDIR/install
		    ;;
	    *)	
		    echo "No changes made to the MBR!"
	  esac
	  ;;
  *)	
	  echo "Wrong parameter, please try again!"
esac
}

reinstall_lilo_superblock()
{
echo "Enter root partition device name:"
echo -n "(/dev/XXXy) ->"
read ASK
case $ASK in
  /dev/????)
	  ROOT_PART=$ASK
	  # Install lilo to superblock 
	  echo "Installing lilo to superblock in $ROOT_PART"
	  mount $ROOT_PART $TMPDIR/install
	  /sbin/lilo -v -b $ROOT_PART -r $TMPDIR/install
	  umount $TMPDIR/install
	  ;;
  *)	
	  echo "Wrong parameter, please try again!"
esac
}

reinstall_plain_mbr()
{
echo "Enter disk device name:"
echo -n "(/dev/XXX) ->"
read ASK
case $ASK in
  /dev/???)
	  DISK=$ASK
	  echo "Install new MBR on disk ${DISK}? Warning, the MBR on disk $DISK will be overwritten, make sure no other operating systems are installed on this disk!"
	  echo -n "(y/N)"
	  read ASK
	  case $ASK in
	    y)
	      echo "Installing new MBR on $DISK"
	      cat /usr/lib/syslinux/mbr.bin > $DISK
	      ;;
	    *)	
	      echo "No changes made to the MBR!"
	  esac
	  ;;
  *)	
	  echo "Wrong parameter, please try again!"
esac
}


install_root_part()
{
CONTINUE=0
while `test $CONTINUE -eq 0` 
do
echo "Enter root partition device name:"
echo "(c)ancel. Show disk (i)nfo"
echo -n "(/dev/XXXy, c, i) ->"
read ASK
case $ASK in
  /dev/????)
	  echo "Install root to ${ASK}? (Warning, ${ASK} will be completely erased!!!)"
	  echo -n "(yes,No) ->"
	  read WARN
	  case $WARN in
	    yes)
	      ROOT_PART=$ASK
	      CONTINUE=1
	      install_root
	      ;;
	    *)
	      echo "Selection aborted!"
	  esac
	  ;;
  i)
	    show_info
	    ;;
  c)
	    CONTINUE=1
	    ;;
  *)	
	  echo "Wrong parameter, please try again!"
esac
done
}

install_root_and_boot_part()
{
CONTINUE=0
while `test $CONTINUE -eq 0` 
do
echo "Enter root partition device name:"
echo "(c)ancel. Show disk (i)nfo"
echo -n "(/dev/XXXy, c, i) ->"
read ASK
case $ASK in
  /dev/????)
	  echo "Install root to ${ASK}? (Warning, ${ASK} will be completely erased!!!)"
	  echo -n "(yes,No) ->"
	  read WARN
	  case $WARN in
	    yes)
	      ROOT_PART=$ASK
	      CONTINUE=1
	      install_root_and_boot_part2
	      ;;
	    *)
	      echo "Selection aborted!"
	  esac
	  ;;
  i)
	    show_info
	    ;;
  c)
	    CONTINUE=1
	    ;;
  *)	
	  echo "Wrong parameter, please try again!"
esac
done
}

install_root_and_boot_part2()
{
CONTINUE=0
while `test $CONTINUE -eq 0` 
do
echo "Enter boot partition device name:"
echo "(c)ancel. Show disk (i)nfo"
echo -n "(/dev/XXXy, c, i) ->"
read ASK
case $ASK in
  /dev/????)
	  echo "Install extlinux to ${ASK}? (Warning, ${ASK} will be completely erased!!!)"
	  echo -n "(yes,No) ->"
	  read WARN
	  case $WARN in
	    yes)
	      BOOT_PART=$ASK
	      CONTINUE=1
	      install_root
	      install_boot
	      ;;
	    *)
	      echo "Selection aborted!"
	  esac
	  ;;
  i)
	    show_info
	  ;;
  c)
	    CONTINUE=1
	    ;;
  *)	
	  echo "Wrong parameter, please try again!"
esac
done
}

install_root()
{
  echo "Installing filesystem to root partition: $ROOT_PART.."
  echo "Note: The disk image system_13.0.tar.gz must be in the current working directory!" 
  ls -l ./system_13.0.tar.gz || exit
  /sbin/mkfs -t ext4 $ROOT_PART || exit
  mount $ROOT_PART $TMPDIR/install || exit
  echo "Copying system to $ROOT_PART.."
  tar --checkpoint=.10000 -xpzf ./system_13.0.tar.gz -C $TMPDIR/install || exit
#  cp ./system_13.0.tar.gz $TMPDIR/install

# Install lilo to superblock 
   echo -n "Installing lilo to superblock in $ROOT_PART"
   /sbin/lilo -v -b $ROOT_PART -r $TMPDIR/install || exit

  umount $TMPDIR/install || exit
  /sbin/e2label $ROOT_PART SW_13.0 || exit
  echo "Root installed to partition: $ROOT_PART"

  sync
}

install_boot()
{
  echo "Installing extlinux to $BOOT_PART"
  mount $ROOT_PART $TMPDIR/install || exit
  /sbin/mkfs -t ext2 $BOOT_PART || exit
  mount $BOOT_PART $TMPDIR/boot || exit
  cp -a  $TMPDIR/install/extlinux $TMPDIR/boot || exit
  /sbin/extlinux --install $TMPDIR/boot/extlinux || exit
  umount $TMPDIR/boot || exit
  umount $TMPDIR/install || exit
  echo "Extlinux installed to: $BOOT_PART"
  DISK=`echo $BOOT_PART | cut -c -8`
  echo "Install new MBR on disk ${DISK}? Warning, the MBR on disk $DISK will be overwritten, make sure no other operating systems are installed on this disk!"
	  echo -n "(y/N)"
	  read ASK
	  case $ASK in
	    y)
	      echo "Installing new MBR on $DISK, make sure that $BOOT_PART is active"
	      cat /usr/lib/syslinux/mbr.bin > $DISK 
	      ;;
	    *)	
	      echo "No changes made to the MBR!"
	  esac

  sync

}

backup_part()
{
CONTINUE=0
while `test $CONTINUE -eq 0` 
do
echo "Enter device name for partition to backup:"
echo "(c)ancel. Show disk (i)nfo"
echo -n "(/dev/XXXy, c, i) ->"
read ASK
case $ASK in
  /dev/????)
	  BACKUP_PART=$ASK
	  CONTINUE=1
	  backup_part2
	  ;;
  i)
	  show_info
	  ;;
  c)
	  CONTINUE=1
	  ;;
  *)	
	  echo "Wrong parameter, please try again!"
esac
done
}

backup_part2()
{
CONTINUE=0
while `test $CONTINUE -eq 0` 
do
echo "Enter device name for partition to store the backup on:"
echo "(c)ancel. Show disk (i)nfo"
echo -n "(/dev/XXXy, c, i) ->"
read ASK
case $ASK in
  /dev/????)
	  BACKUP_DATE=`date -I`
	  DISK_NAME=`basename $BACKUP_PART`
	  BACKUP_NAME=${DISK_NAME}-${BACKUP_DATE}.tar.gz
	  echo "Store backup of partition $BACKUP_PART on partition ${ASK}? The backup will be stored as $BACKUP_NAME"
	  echo -n "(yes,No) ->"
	  read WARN
	  case $WARN in
	    yes)
	      BACKUP_STORE_PART=$ASK
	      CONTINUE=1
	      mount $BACKUP_PART $TMPDIR/backup || exit
	      mount $BACKUP_STORE_PART $TMPDIR/backup-store || exit
	      cd $TMPDIR/backup || exit
	      tar -cvpszf $TMPDIR/backup-store/${BACKUP_NAME} . || exit
	      cd - || exit
	      umount $TMPDIR/backup || exit
	      umount $TMPDIR/backup-store || exit
	      ;;
	    *)
	      echo "Aborted!"
	  esac
	  ;;
  i)
	    show_info
	  ;;
  c)
	    CONTINUE=1
	    ;;
  *)	
	  echo "Wrong parameter, please try again!"
esac
done
}

while true 
do
echo
echo "*** Welcome to slackdeploy! ***"
echo "Author: Magnus Uppman <magnus_uppman@hotmail.com>"
echo
  echo "Install with two partitions (b)oot and root, or only (r)oot partition?"
  echo "Show disk (i)nfo, Edit (d)isk"
  echo "Reinstall (l)ilo to MBR, Reinstall lilo to (s)uperblock"
  echo "Reinstall (p)lain MBR to boot the active partition"
  echo "Backup par(t)ition"
  echo "(q)uit, s(h)ell, (v)ersion"
  echo -n "(i,d,l,s,p,b,r,t,q,h,v) ->"
  read ASK
  case $ASK in
    i)
	    show_info
	    ;;
    d)
	    edit_disk
	    ;;
    l)
	    reinstall_lilo_mbr
	    ;;
    s)
	    reinstall_lilo_superblock
	    ;;
    p)
	    reinstall_plain_mbr
	    ;;
    b)
	    install_root_and_boot_part
	    ;;
    r)
	    install_root_part
	    ;;
    t)
	    backup_part
	    ;;
    v)
	    echo "Version: "$VERSION
	    ;;
    q)
	    exit
	    ;;
    h) 	    
	    /bin/sh
	    ;;
    *)			  
	  echo "Wrong parameter, please try again!"
  esac

  echo -n "Press Enter to continue.."
  read ASK

done
 
Old 12-04-2009, 06:16 AM   #14
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: Slack14.2/Many
Posts: 5,573

Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
I will be trying bro and thank you!

I'm gonna read the whole thread
but, this is a live installer cd/dvd or a Live cd/dvd
or both?
 
Old 12-04-2009, 07:10 AM   #15
uppman
Member
 
Registered: Jul 2008
Location: Stockholm, Sweden
Distribution: Slackware 13.1 32-bit
Posts: 145

Original Poster
Rep: Reputation: 24
Quote:
Originally Posted by linus72 View Post
but, this is a live installer cd/dvd or a Live cd/dvd
or both?
I'm happy to hear that someone dares to try! I did try to make things easier and not the opposite.

For 12.2 it's only a LiveDVD, for 13.0 it's a LiveDVD and a simple cli installer.


/Magnus
 
  


Reply



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
Ramdisk size, howto increase limit (Kernel parameters) imagineers7 Linux - Kernel 5 03-23-2009 02:44 PM
LXer: HowTo Remaster a LiveCD or LiveDVD using SLAX LXer Syndicated Linux News 0 10-06-2008 04:11 AM
Ramdisk size, howto increase limit (Kernel parameters) imagineers7 Linux - General 0 06-10-2006 01:34 AM
howto create linux to boot from ramdisk only?? pingvina Linux - Software 2 02-09-2006 01:17 PM
howto install livecd on hd cigarstub Linux - General 4 09-14-2005 07:53 AM

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

All times are GMT -5. The time now is 11:03 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
Open Source Consulting | Domain Registration