LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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-21-2010, 02:29 PM   #1
vit_r
LQ Newbie
 
Registered: Jun 2008
Posts: 14
Blog Entries: 1

Rep: Reputation: 0
Building: Own rescue bash-based OS


Live Linux as initrd( from Slackware's arsenal( unofficial ))

Building: Own rescue bash-based OS

Example, - is sooner a draft or hint( easily changeable )

Slackware 13.1 rescue-like PGS-set
{
60 Mb:
lilo, pkgtools,
c/fdisk, gpm, mc, find, dd,
cd-dvd tools, zips( except rzip ) and so on
}

After installation on logical p7n( 500 Mb; ext2 )
booting and configuring:
{
font, gpm, ..., time,
especially the time, otherwise fsck may..
}
some deletes in /usr:
for example in:
usr/lib/locale, usr/share/locale, usr/share/zoneinfo, usr/share/mc, ...
next dirs can be removed:
var/man, usr/include, usr/doc, usr/share/gtk-doc, ...
next dirs may be removed:
usr/man, usr/info,
because man/info-pages can be read in RAM from hard drive:
- mount /path-to/usr
- mc
- /path-to/usr/man/file.gz
- F3

Creating OS-image( initrd.img ):
~ # cd /
/ # cp etc/rc.d/rc.S etc/fstab root/

To prevent fsck-check of root filesystem while booting to RAM
in etc/rc.d/rc.S( Slackware 13.1 ) is better to delete lines from $LINENO = 131 till 237:
130:# Test to see if the root partition is read-only..
131:READWRITE=no
. . .
236:fi # Done checking root filesystem
237:

We comment in etc/fstab lines which mount any hardware
and leave uncommented next three lines():
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0

Some backups:
/ # cp etc/rc.d/rc.S etc/rc.d/rc.S-for-ram
/ # cp etc/fstab etc/fstab-for-ram

CRITICAL:
To prevent kernel panic:
/ # ln -s sbin/init init

Rebooting
Here native Slackware( vmlinuz-huge-smp-2.6.33.4-smp ) should be booted
We mount initrd-p7n than cd /path-to-initrd-p7n/
/path-to-initrd-p7n/ # mv boot /tmp/
/path-to-initrd-p7n/ # [ -L init ] \
&& find . | cpio -o -H newc | gzip -9c > /tmp/boot/initrd.img \
&& echo -e "\n OS-image( initrd.img ) is created\! \n"

Now the omly task is left: to boot initrd.img

Preparing initrd-p7n for booting from hard drive:
/path-to-initrd-p7n/ # mv /tmp/boot .
/path-to-initrd-p7n/ # /bin/cp -f root/rc.S etc/rc.d/
/path-to-initrd-p7n/ # /bin/cp -f root/fstab etc/
We add in lilo.conf:
next line as first line:
large-memory # This allows LILO to use more than the first 15MB of RAM.
and new section:
image = /boot/vmlinuz-huge-smp-2.6.33.4-smp
initrd = /boot/initrd.img
label = ram
read-only
append=" ... " # usual parameters
addappend=" panic=22 ramdisk_size=248124 "

And finally:
/path-to-initrd-p7n/ # chroot .
with next
/ # sbin/lilo && exit
/path-to-initrd-p7n/ # cd
~ # umount /path-to-initrd-p7n/
~ # reboot

On lilo-prompt:
- label 'ram'

LiveCD/DVD-USB is quite obviouse, isn't it?

ps
Extracting:
cat ../initrd.img | gzip -d | cpio --extract -H newc --preserve-modification-time

Good luck
Attached Files
File Type: txt Sl-13.1-resclike-PGSset.txt (3.0 KB, 15 views)
 
Old 12-21-2010, 03:58 PM   #2
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
I'm not really sure what this is...
 
Old 12-21-2010, 04:03 PM   #3
Jeebizz
Senior Member
 
Registered: May 2004
Distribution: Slackware15.0 64-Bit Desktop, Debian 11 non-free Toshiba Satellite Notebook
Posts: 4,170

Rep: Reputation: 1373Reputation: 1373Reputation: 1373Reputation: 1373Reputation: 1373Reputation: 1373Reputation: 1373Reputation: 1373Reputation: 1373Reputation: 1373
Seems like reinventing the wheel to me. Just boot the Slackware install disc (CD-1 or DVD), no need to go through all this trouble for a 'rescue disc' when one exists.
 
Old 12-21-2010, 04:32 PM   #4
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
You can just use a modified Linux-Live-Scripts + compile kernel with aufs2.1 and squashfs-lzma patches + some slax, etc scripts and you have instant slackware based live distro with cd/usb/hdd persistency
or just use the official DVD or a mixture of both

There are many different existing live kernels you can use from 2.6.33.4 to 2.6.35.7 to 2.6.36.2
and there are already "unofficial" Slackware derivatives like Salix OS that make for great rescue/recovery live media
 
  


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
Building a linux based EVDO router digilink Linux - Networking 0 03-13-2009 10:01 AM
LXer: The Linux-Based Paragon Rescue Kit for Mac OS X Lite LXer Syndicated Linux News 0 05-02-2008 06:50 PM
/bin/bash missing on RHEL 5 - need rescue mode help jmerry01 Linux - Software 2 07-19-2007 05:55 PM
Bash missing - repair without rescue media brianmcgee Linux - General 5 07-12-2007 02:36 AM
Building a RAID-based SAMBA fileserver karavshin Linux - General 2 02-16-2005 10:31 AM

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

All times are GMT -5. The time now is 07:56 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