Users online right now: 107 - Login  » search  » forum index  

(SLAX 7) Install SLAX To HDD

djucius
wrote 1 year ago


reply
Hello. Sorry for my poor beginner's English.

I want install SLAX to hard drive from customized SLAX 7 iso.

First of all, why do I need this?
Because I have a very old computer with Pentium III, 4GB hard disk and 128 RAM installed in it.
From this pc I want to make a little web server with php and mysql.

So:

Q.01: Whether it is possible?
Because I am not sure of the answer, so far i have done this:

00. Customized SLAX 7 iso. Removed all of the modules except for the following two:
1. "01-core.sb";
2. "06-devel.sb".
And started SLAX.

01. Created partitions:
1. sda1 - SWAP;
2. sda2 - EXT4.

02. Mounted files destination dir:
1. # mkdir /mnt/c
2. # mount /dev/sda2 /mnt/c/


03. Copied and created root directories:
1. # cp --preserve -R /{bin,dev,etc,home,lib,root,sbin,usr,var,opt} /mnt/c/
2. # mkdir -p /mnt/c/{boot,mnt,proc,sys,tmp}


04. Copied boot directory from SLAX cd:
1. # cp /mnt/live/memory/data/slax/boot/* /mnt/c/boot/


05. Ran the boot install script:
1. # cd /mnt/c/boot/
2. # ./bootinst.sh


06. Edited the "syslinux.cfg" boot menu configuration script from "/slax/boot/" to "/boot/".

And when I started a SLAX from hdd, it runs from RAM with limitations, no "reboot", no "mc"
commands. I want it run from the hdd not from the RAM. So I think something is missing =[


Q.02: What commands are missing for my instruction that it be fully operational? And SLAX can
run from hdd like other to hdd installed linuxes.




Links I have readed:
01. http://www.slax.org/en/documentation.php
02. http://old.slax.org/forum.php?action=view&parentID=4456
03. http://backtrack.serveftp.com/backtrack/misctools/slax6-install.kmdr
04. http://gr8idea.info/os/tutorials/slax/install.html
05. http://old.slax.org/forum.php?action=view&parentID=82557&highlight=how%20to%20install
06. http://old.slax.org/forum.php?action=view&parentID=82726&highlight=how%20to%20install
07. http://old.slax.org/forum.php?action=view&parentID=83043&highlight=how%20to%20install
08. http://old.slax.org/forum.php?action=view&parentID=7331
09. http://doc.slitaz.org/en:handbook:installation
10. http://www.linuxhelp.net/forums/lofiversion/index.php/t9210.html


David
 
linus72
wrote 1 year ago


reply
This is the way I have done it with many "live" distros installing to a HDD as a HDD system, no longer live.

booted off usb no copy2ram, fresh mode

(If you ned to, use cfdisk(terminal) or Gparted (GTK)
to partition/format your hard drives,usb,etc)

Did fdisk -l to identify my partitions and hdd, which is sda; partition sda7

formatted existing partition of 7GB

mkfs.ext3 /dev/sda7

made a mount point for install and mounted sda7

mkdir /target
mount /dev/sda7 /target

Then I just copied all pertinet folders to /target partition

cp -R --preserve /bin /target
cp -R --preserve /boot /target
cp -R --preserve /dev /target
cp -R --preserve /etc /target
cp -R --preserve /home /target
cp -R --preserve /lib /target
cp -R --preserve /opt /target
cp -R --preserve /root /target
cp -R --preserve /sbin /target
cp -R --preserve /srv /target
cp -R --preserve /usr /target
cp -R --preserve /var /target

Made the additional needed empty folders

mkdir -p /target/media
mkdir -p /target/mnt
mkdir -p /target/opt
mkdir -p /target/proc
mkdir -p /target/sys
mkdir -p /target/tmp

Create a /etc/mtab and /etc/fstab files for new install

Use nano, vi or leafpad, for sda7 like this

/etc/fstab (dont know if the aufs one is needed, probably not?

aufs / aufs defaults 0 0 # AutoUpdate
/dev/sda5 swap swap defaults 0 0
/dev/sda7 / ext3 defaults 1 1
/dev/cdrom /mnt/cdrom auto noauto,owner,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
none /mnt/slaxdrive slaxdrive defaults 0 0 # This is for Slax Drive integration into KDE

and /etc/mtab

/dev/root / ext3 rw,errors=continue,data=ordered 0 0
/proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
usbfs /proc/bus/usb usbfs rw 0 0
tmpfs /dev/shm tmpfs rw 0 0

and now must make a /etc/lilo.conf to boot
there should already be one in /etc or now in /target/etc

Look at the top part and comment or uncomment whether you want Lilo
installed to root of sda7 or to MBR.
It is set there to install Lilo to MBR
If dual booting with Windows see any info you need thru Google or here at LQ!
If you have Ubuntu or similar installed somewhere, just install Lilo to root
of partition and then boot into your buntu setup and issue "update-grub" and buntu should setup
the grub.cfg
You dont need a initrd with this kernel if using ext2/ext3/ext4 partition,etc

Open it with Leafpad and it should look similar to this-

# LILO configuration file
# generated by 'liloconfig'
#
# Start LILO global section
# boot = /dev/sda # Installs Lilo to MBR
boot = /dev/sda7 # Installs Lilo to root of partition
#compact # faster, but won't work on all systems.
# Append any additional kernel parameters:
append=" vt.default_utf8=0 autoexec=telinit~4"
prompt
timeout = 50
# VESA framebuffer console @ 1024x768x256
# vga = 773
# Normal VGA console
# vga = normal
# VESA framebuffer console @ 1024x768x64k
# vga=791
# VESA framebuffer console @ 1024x768x32k
# vga=790
# VESA framebuffer console @ 1024x768x256
# vga=773
# VESA framebuffer console @ 800x600x64k
vga=788
# VESA framebuffer console @ 800x600x32k
# vga=787
# VESA framebuffer console @ 800x600x256
# vga=771
# VESA framebuffer console @ 640x480x64k
# vga=785
# VESA framebuffer console @ 640x480x32k
# vga=784
# VESA framebuffer console @ 640x480x256
# vga=769
# ramdisk = 0 # paranoia setting
# End LILO global section
# Linux bootable partition config begins
image = /boot/vmlinuz
root = /dev/sda7
label = nFluxOS_13.1
read-only # Partitions should be mounted read-only for checking
# Linux bootable partition config ends

heres the full grub2 entry so far
menuentry "nFluxOS_13.1 (on /dev/sda7)" {
insmod ext2
set root='(/dev/hda,7)'
search --no-floppy --fs-uuid --set 42f24b82-e53b-4ba4-9dd3-c7c7b0ef07ad
linux /boot/vmlinuz root=/dev/sda7 ro quiet vga=788
}

heres example grub legacy(1) entry

title Slax7
root (hd0,6)
kernel /boot/vmlinuz root=/dev/sda7 ro quiet vga=788

Now chroot into partition and install Lilo, or Grub 1 or Grub2, to MBR or root of partition

mount --bind /dev/ /target/dev
mount -t proc none /target/proc
mount -t sysfs none /target/sys
mount -t devpts none /target/dev/pts

export HOME=/root
export LC_ALL=C

chroot /target
/usr/bin/dbus-uuidgen --ensure

/sbin/lilo

Or

grub-install --no-floppy /dev/sda
grub-install --no-floppy /dev/sda7
then do
update-grub
liloconfig (gui lilo installer!)

Now, exit from chroot, unmount everything and reboot.
back at terminal enter

exit
umount -l -f /target/proc
umount -l -f /target/sys
umount -l -f /target/dev/pts
umount -l -f /target/dev
umount /target

and once I rebooted and did update-grub from my Debian install, which controls sda with grub2
I rebooted into my shiny new
Slax install!

Edit it as needed for partition/name, etc
Don't know if Slax7 has either lilo/grub so may have to make a module, etc.
also, if "run" folder needs to be created?

I just copy/paste all the cp commands into terminal,
 
Max
wrote 1 year ago


reply
Maybe someday someone making installation in slax 7.Like other live cd.Just press install in hdd and its starting.I hope so.
 
bb as guest
wrote 1 year ago


reply
OK, I'm gonna throw this out; bb's quick and dirty install ...

-- you are booted into slax7-64, the latest version (7.0.4 I think)

-- and you have a linux partition to overwrite (using sda8 below)

#umount /dev/sda8
#mkfs.reiserfs /dev/sda8 (and answer 'y' to the question)
#mkdir /mnt/sda8
#mount /dev/sda8 /mnt/sda8

#cd /path/to/slax
#for x in *.sb; do sb2dir $x /mnt/sda8; done

#mkdir /mnt/sda8/boot
#cp boot/vmlinuz /mnt/sda8/boot/.


then edit the following 3 lines into your grub's menu.lst ...

Title Slax7-64 on sda8
kernel (hd0,7)/boot/vmlinuz root=/dev/sda8 ro vga=791
boot

Obviously, use your own device names where I have sda8 and hd1,7 above.

Enjoy. This seems to work OK here, running it right now. I did this a few times back in the 612 days, thought I'd give it a try with slax7.
 
storris
wrote 1 year ago


reply
Can you not just install the .iso and then uninstall the unwanted modules?
 
jcsoh
wrote 1 year ago


reply
"And when I started a SLAX from hdd, it runs from RAM with limitations, no "reboot", no "mc"
commands. I want it run from the hdd not from the RAM. So I think something is missing =["

" no "reboot"," . You mean if you type "reboot" in a console , it doesn't reboot or state no such command ?
no "mc" - I am not sure where mc is in , but obviously if it is not in 001_core , then it won't be there , but surely you can download and just install it vas a standalone .

I want it run from the hdd not from the RAM. Check the slax.flag to exclude copy2ram.
Or do you mean you want slax as a real installation and not as a livecd/frugal installation ?
 
djucius
wrote 1 year ago


reply
jcsoh wrote:
"And when I started a SLAX from hdd, it runs from RAM with limitations, no "reboot", no "mc"
commands. I want it run from the hdd not from the RAM. So I think something is missing =["

" no "reboot"," . You mean if you type "reboot" in a console , it doesn't reboot or state no such command ?
no "mc" - I am not sure where mc is in , but obviously if it is not in 001_core , then it won't be there , but surely you can download and just install it vas a standalone .

I want it run from the hdd not from the RAM. Check the slax.flag to exclude copy2ram.
Or do you mean you want slax as a real installation and not as a livecd/frugal installation ?



1. Yes, when I type "reboot" in a console, it state no such command.
2. Yes I want SLAX as a real installation and not as a livecd/frugal installation.
 
djucius
wrote 1 year ago


reply
Max wrote:
Maybe someday someone making installation in slax 7.Like other live cd.Just press install in hdd and its starting.I hope so.


That would be awesome =]
 
djucius
wrote 1 year ago


reply
"linus72" way helped me to solve installation problems.

My full installation instructions:

01. Create SWAP and EXT4 partitions.

02. Mount files destination dir:
02.1. # mkdir /mnt/c
02.2. # mount /dev/sda2 /mnt/c/


03. Copy and create root directories:
03.1. # cp --preserve -R /{bin,dev,etc,home,lib,root,sbin,usr,var,opt,srv} /mnt/c/
03.2. # mkdir -p /mnt/c/{boot,mnt,proc,sys,tmp}


04. Copy boot directory from SLAX cd:
04.1. # cp /mnt/live/memory/data/slax/boot/* /mnt/c/boot/
I think there would be enough just to copy one file "vmlinuz".


05. Edit "mtab" and "fstab" files in "/mnt/c/etc/" dir:

05.1. My "mtab" file:
/dev/root / ext4 rw,errors=continue,data=ordered 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
tmpfs /dev/shm tmpfs rw 0 0

05.2. My "fstab" file:
aufs / aufs defaults 0 0
/dev/sda1 swap swap defaults 0 0
/dev/sda2 ext4 defaults 1 1
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs defaults 0 0


06. Create copy of "lilo.conf_example" and rename to "lilo.conf".


07. Edit "lilo.conf", my file (installed in root not MBR):
lba32
boot = /dev/sda2
map = /boot/map
prompt
timeout = 50
vga = 791 # VESA framebuffer console @ 1024x768x64
append = " vt.default_utf8=1 "
image = /boot/vmlinuz
label = "SLAX"
root = /dev/sda2
read-only

08. Install Lilo to root partition:
08.1. # mount --bind /dev/ /mnt/c/dev/
08.2. # mount -t proc none /mnt/c/proc/
08.3. # mount -t sysfs none /mnt/c/sys/
08.4. # mount -t devpts none /mnt/c/dev/pts/
08.5. # export HOME=/root
08.6. # export LC_ALL=C
08.7. # chroot /mnt/c/
08.8. # /sbin/lilo

09. "Exit from chroot, unmount everything and reboot":
09.1. # exit
09.2. # umount -l -f /mnt/c/proc/
09.3. # umount -l -f /mnt/c/sys
09.4. # umount -l -f /mnt/c/dev/pts/
09.5. # umount -l -f /mnt/c/dev/
09.6. # umount /mnt/c/
09.7. # reboot


My instructions end. =]

I think that after the "boot" directory copying, script "bootinst.sh" starting is unnecessary.
 
Vampirs
wrote 1 year ago


reply
djucius wrote:
Max wrote:
Maybe someday someone making installation in slax 7.Like other live cd.Just press install in hdd and its starting.I hope so.


That would be awesome =]


Yes,yes.Maby in the Slax 7.0.5 it will be :)
 
whowne
wrote 1 year ago


reply
Try with all the base modules :)
 
Anon
wrote 1 year ago


reply
Where is this lilo.conf present ? Should I install it from Slax Modules , but neither grub nor lilo is present ? Sorry , for noob question ..
 
jcsoh
wrote 1 year ago


reply
Lilo
http://slackfind.net/en/packages/search/?name=lilo&distversion=

Grub legacy /0.97
http://slackfind.net/en/packages/search/?name=grub&distversion=

Convert from a console using

tgz2sb
or
txz2sb

eg txz2sb inputfile.txz outputfile.sb
 
bb as guest
wrote 1 year ago


reply
@ anon ... I'd strongly recommend using the grub to boot your hard disk.

I don't have access to a slax iso at the moment, but in the past Tomas has constructed the lilo.conf on the fly in /boot, using echo statements in boot_inst.sh files. (and then invokes lilo with a switch to specify the location of the file) So .. lilo.conf doesn't exist prior to executing the boot install script -- but you should be able to find it after.
 
bb as guest
wrote 1 year ago


reply
@ anon ... and just to be clear, if you are asking about slax7 version, then that does not use lilo at all; bootinst.sh uses extlinux, while bootinst.bat uses syslinux. Lilo was used in slax6 boot scripts, as I wrote previously.
 
nonassimilant
wrote 1 year ago


reply
djucius wrote:
Hello. Sorry for my poor beginner's English.

I want install SLAX to hard drive from customized SLAX 7 iso.

First of all, why do I need this?
Because I have a very old computer with Pentium III, 4GB hard disk and 128 RAM installed in it.
From this pc I want to make a little web server with php and mysql.

So:

Q.01: Whether it is possible?
Because I am not sure of the answer, so far i have done this:

00. Customized SLAX 7 iso. Removed all of the modules except for the following two:
1. "01-core.sb";
2. "06-devel.sb".
And started SLAX.

01. Created partitions:
1. sda1 - SWAP;
2. sda2 - EXT4.

02. Mounted files destination dir:
1. # mkdir /mnt/c
2. # mount /dev/sda2 /mnt/c/


03. Copied and created root directories:
1. # cp --preserve -R /{bin,dev,etc,home,lib,root,sbin,usr,var,opt} /mnt/c/
2. # mkdir -p /mnt/c/{boot,mnt,proc,sys,tmp}


04. Copied boot directory from SLAX cd:
1. # cp /mnt/live/memory/data/slax/boot/* /mnt/c/boot/


05. Ran the boot install script:
1. # cd /mnt/c/boot/
2. # ./bootinst.sh


06. Edited the "syslinux.cfg" boot menu configuration script from "/slax/boot/" to "/boot/".

And when I started a SLAX from hdd, it runs from RAM with limitations, no "reboot", no "mc"
commands. I want it run from the hdd not from the RAM. So I think something is missing =[


Q.02: What commands are missing for my instruction that it be fully operational? And SLAX can
run from hdd like other to hdd installed linuxes.




Links I have readed:
01. http://www.slax.org/en/documentation.php
02. http://old.slax.org/forum.php?action=view&parentID=4456
03. http://backtrack.serveftp.com/backtrack/misctools/slax6-install.kmdr
04. http://gr8idea.info/os/tutorials/slax/install.html
05. http://old.slax.org/forum.php?action=view&parentID=82557&highlight=how%20to%20install
06. http://old.slax.org/forum.php?action=view&parentID=82726&highlight=how%20to%20install
07. http://old.slax.org/forum.php?action=view&parentID=83043&highlight=how%20to%20install
08. http://old.slax.org/forum.php?action=view&parentID=7331
09. http://doc.slitaz.org/en:handbook:installation
10. http://www.linuxhelp.net/forums/lofiversion/index.php/t9210.html


David
 
nonassimilant
wrote 1 year ago


reply
djucius wrote:
Hello. Sorry for my poor beginner's English.

I want install SLAX to hard drive from customized SLAX 7 iso.

First of all, why do I need this?
Because I have a very old computer with Pentium III, 4GB hard disk and 128 RAM installed in it.
From this pc I want to make a little web server with php and mysql.

So:

Q.01: Whether it is possible?
Because I am not sure of the answer, so far i have done this:

00. Customized SLAX 7 iso. Removed all of the modules except for the following two:
1. "01-core.sb";
2. "06-devel.sb".
And started SLAX.

01. Created partitions:
1. sda1 - SWAP;
2. sda2 - EXT4.

02. Mounted files destination dir:
1. # mkdir /mnt/c
2. # mount /dev/sda2 /mnt/c/


03. Copied and created root directories:
1. # cp --preserve -R /{bin,dev,etc,home,lib,root,sbin,usr,var,opt} /mnt/c/
2. # mkdir -p /mnt/c/{boot,mnt,proc,sys,tmp}


04. Copied boot directory from SLAX cd:
1. # cp /mnt/live/memory/data/slax/boot/* /mnt/c/boot/


05. Ran the boot install script:
1. # cd /mnt/c/boot/
2. # ./bootinst.sh


06. Edited the "syslinux.cfg" boot menu configuration script from "/slax/boot/" to "/boot/".

And when I started a SLAX from hdd, it runs from RAM with limitations, no "reboot", no "mc"
commands. I want it run from the hdd not from the RAM. So I think something is missing =[


Q.02: What commands are missing for my instruction that it be fully operational? And SLAX can
run from hdd like other to hdd installed linuxes.




Links I have readed:
01. http://www.slax.org/en/documentation.php
02. http://old.slax.org/forum.php?action=view&parentID=4456
03. http://backtrack.serveftp.com/backtrack/misctools/slax6-install.kmdr
04. http://gr8idea.info/os/tutorials/slax/install.html
05. http://old.slax.org/forum.php?action=view&parentID=82557&highlight=how%20to%20install
06. http://old.slax.org/forum.php?action=view&parentID=82726&highlight=how%20to%20install
07. http://old.slax.org/forum.php?action=view&parentID=83043&highlight=how%20to%20install
08. http://old.slax.org/forum.php?action=view&parentID=7331
09. http://doc.slitaz.org/en:handbook:installation
10. http://www.linuxhelp.net/forums/lofiversion/index.php/t9210.html


David
djucius wrote:
Hello. Sorry for my poor beginner's English.

I want install SLAX to hard drive from customized SLAX 7 iso.

First of all, why do I need this?
Because I have a very old computer with Pentium III, 4GB hard disk and 128 RAM installed in it.
From this pc I want to make a little web server with php and mysql.

So:

Q.01: Whether it is possible?
Because I am not sure of the answer, so far i have done this:

00. Customized SLAX 7 iso. Removed all of the modules except for the following two:
1. "01-core.sb";
2. "06-devel.sb".
And started SLAX.

01. Created partitions:
1. sda1 - SWAP;
2. sda2 - EXT4.

02. Mounted files destination dir:
1. # mkdir /mnt/c
2. # mount /dev/sda2 /mnt/c/


03. Copied and created root directories:
1. # cp --preserve -R /{bin,dev,etc,home,lib,root,sbin,usr,var,opt} /mnt/c/
2. # mkdir -p /mnt/c/{boot,mnt,proc,sys,tmp}


04. Copied boot directory from SLAX cd:
1. # cp /mnt/live/memory/data/slax/boot/* /mnt/c/boot/


05. Ran the boot install script:
1. # cd /mnt/c/boot/
2. # ./bootinst.sh


06. Edited the "syslinux.cfg" boot menu configuration script from "/slax/boot/" to "/boot/".

And when I started a SLAX from hdd, it runs from RAM with limitations, no "reboot", no "mc"
commands. I want it run from the hdd not from the RAM. So I think something is missing =[


Q.02: What commands are missing for my instruction that it be fully operational? And SLAX can
run from hdd like other to hdd installed linuxes.




Links I have readed:
01. http://www.slax.org/en/documentation.php
02. http://old.slax.org/forum.php?action=view&parentID=4456
03. http://backtrack.serveftp.com/backtrack/misctools/slax6-install.kmdr
04. http://gr8idea.info/os/tutorials/slax/install.html
05. http://old.slax.org/forum.php?action=view&parentID=82557&highlight=how%20to%20install
06. http://old.slax.org/forum.php?action=view&parentID=82726&highlight=how%20to%20install
07. http://old.slax.org/forum.php?action=view&parentID=83043&highlight=how%20to%20install
08. http://old.slax.org/forum.php?action=view&parentID=7331
09. http://doc.slitaz.org/en:handbook:installation
10. http://www.linuxhelp.net/forums/lofiversion/index.php/t9210.html


David


Maybe my computer is newer, but what you've done seems quite complicated. Here's what I did.

1. Start computer and boot to Slax.
2. Open up Konsole.
3. Navigate to C D on one side.
4. Naviagate to desired Hard Drive on the other.
5. Copy Slax to hard Drive
6. Navigate to Boot on Hard Drive.
7. Find bootinst.sh and press enter on keyboard.
8. Follow appropriate instructions.
9. Reboot
10. Set bios to recognize new boot drive.
11. Wallah!!!

Hope that helps you.
 
pvtmert
wrote 1 year ago


reply
Anon wrote:
Where is this lilo.conf present ? Should I install it from Slax Modules , but neither grub nor lilo is present ? Sorry , for noob question ..


probably 'late' answer but

try running this command:
locate lilo
 
nonassimilant
wrote 1 year ago


reply
/(your boot drive)/boot/
 
burninbush
wrote 1 year ago


reply
@ pvtmert, nonassimilant ... this thread is a mix of slax7 and slax6 issues & advice. As near as I can tell, slax7 does not use lilo at all, is instead using extlinux if run from Slax. Look at bootinst.sh in /boot with a text editor. Basically he now just uses dd to copy a magic 440-byte file (mbr.bin) onto the first disk sector. This will leave an existing master partition table untouched.

Slax7 install if run from Windows, bootinst.bat uses syslinux.exe to make a disk bootable.

On Slax6, liloinst.sh uses lilo, and the lilo.conf file is created with an echo string command, to the /boot directory; lilo is invoked with a switch to use that location instead of /etc where you'd expect to find it.
 
sorajio
wrote 1 year ago


reply
hellow everyone

I had tryed installing it to a SD card,
but I don`t know how to install a grub and lilo ,
so I modified the syslinux.cfg that used "/boot" Replaced "/slax/boot",
then I failed...........
 
pvtmert
wrote 1 year ago


reply
I have created this script (most of them from 'linus72')

One problem, slax doesnt booting. getting kernel panic
first it couldnt find any root
i have give root with root=/dev/sda1 kernel param.
second it couldnt find any 'init'
i have tried init=/bin/bash, init=/bin/init, init=/sbin/init, init=/sbin/bash, init=/bin/sh but none of them worked (ps im in x86_64)

I have fixed this. (Actually skyhog99 fixed it! Thanks goes to him!) And updated the script (May 31, 2013)
Up-to-date script will located at http://pvtmert.zapto.org/src/slax/instx

Before run script prepare your disk by;
Create 'install' partition with id 83
Create 'swap' partition with id 82
Find your 'target' drive device (sdx)

Then execute: ./slaxinst [mountdir] [block-device] [part-num] [swap-num] [filesystem] [disk-label*] [from=dir*] [boot-files*]
Example: ./slaxinst /media/myhdd sdb 2 4 ext3 desktop-pc slax7 boot/syslinux
It will mount to /media/hdd then uses [sdb] and sdb[2] for install parition, sdb[4] as swap area. install partition with ext3-fs and desktop-pc as drive label. Files will search in slax7 and boot/syslinux directories in usb root...
Parameters with * (star) are optional
If you dont want to set swap space, set it to 0 (zero): ./script /media sda 1 0 ext4 slax7-64
Note: disk label also becomes your hostname...

Even with 'core' slax 7, it can take 1.2 GB space. And installation can take some time. Depends your cd-dvd drive speed, usb speed and obviously harddisk speed.
Biggest folder is USR, be patient! and second biggest is LIB...

Script tested with Slax 7.0.8 64-bit ISO and Virtual Box...

#!/bin/bash
# Slax Installation Script
# $1 mountdir: /media
# $2 Device name: hda, hdb, sda, sdb...
# $3 partition number: sda[1]
# $4 SWAP partition number: sda[2]
# $5 File system type: ext2, ext3, ext4 etc...
# $6 Drive Label: Slax [optional]
# $7 Slax's main folder (default: slax) [optional]
# Example Command line: ./script /media/hdd sda 1 2 ext3 slax64 myslax
# Author: Mert Akengin
# Version: 0.82 (beta)
# Last Update: 2013 June 19

scrname="$0"
helptext="$0: Slax Installation Script;
Usage: $scrname [mountpoint-dir] [device] [install-partition-num]
[swap-partition-num] [file-system] [disk-label*]
[main-folder*] [boot-files*]
Example: $scrname /media/hdd sda 1 2 ext3 slax64 myslax
-> This will install to sda1 with 'slax64' labelled ext3 fs. Swap partition will be set on sdb2...
Module & Bundle data and boot data will search in 'myslax' dir in usb root.
Note: Attributes with * (star) are OPTIONAL. You don't have to specify these values.
Note2: You can disable SWAP by just putting 0 (zero) for it..."

if [ "$1" == "--help" ]; then
echo -e "$helptext"
exit 1
else
echo "CHECKING & STARTING..."
fi

if [ ! "$1" ] || [ ! "$2" ] || [ ! "$3" ] || [ ! "$4" ] || [ ! "$5" ] ; then
echo -e "Wrong Syntax in: $*\nMissing Statement(s)!"
echo -e "$helptext"
exit 2
fi

MOUNT="$1"
DEV="$2"
PART="$3"
SWAP="$4"
FILE="$5"
LABEL="$6"

if [ "$7" ]; then
FROM="$7"
else
FROM="slax"
fi

if [ "$8" ]; then
BOOT="$8"
else
BOOT="$FROM/boot"
fi

folders=('bin' 'boot' 'dev' 'etc' 'home' 'lib' 'lib64' 'opt' 'root' 'sbin' 'srv' 'usr' 'var')

LIVE="/mnt/live/memory/data"

filesb="
$LIVE/$FROM/initrfs.img
$LIVE/$FROM/vmlinuz
$LIVE/$BOOT/initrfs.img
$LIVE/$BOOT/vmlinuz
"

EXTL="$LIVE/$BOOT/extlinux.exe"
COM32_1="$LIVE/$BOOT/libcom32.c32"
COM32_2="$LIVE/$BOOT/libutil_com.c32"

if echo $SWAP | grep -q '0' ; then
SWAP=""
DEVINFO="Device: $2 (Install on: $2$3 No-Swap-Space)"
else
SWAP="/dev/$2$4 swap swap defaults 0 0"
DEVINFO="Device: $2 (Install on: $2$3 Swap: $2$4)"

fi

echo "Before starting installation, make sure your disk well-formatted and ready to use..."
#echo "Starting FDISK as you specified in command line..."
echo "You can verify your disk at this stage! After that, there is no way to return!"
echo "ALL OF YOUR DATA ON SPECIFIED DISK WILL BE ERASED!"
echo "Press [ENTER] to continue, [CTRL+C] to exit."
read junk

echo "Notes about your input: "
echo "Mount point: $1"
echo "$DEVINFO"
echo "Target file-system format ($2$3): $5"
echo "File system label *If exists*($2$3): $6"
echo -n "Are these values are true? [Y/N]: "
read junk

if echo $junk | grep -qi 'y' ; then
echo "Proceeding Setup..."
else
echo "Cancelled by user..."
exit 3
fi

#fdisk /dev/$2
if [ "$6" ]; then
mkfs.$5 /dev/$2$3 -L "$6"
else
mkfs.$5 /dev/$2$3
fi

if [ "$SWAP" ]; then
mkfs.swap /dev/$2$4 -L slax-swap
fi

mkdir "$1" &>/dev/null
mount /dev/$2$3 "$1"

for dir in ${folders[*]}
do
echo -n "Copying /$dir ..."
cp -R --preserve=all /"$dir" "$1" && echo " [ OK ]"
done

echo -n "Creating system directories..."
mkdir -p "$1"/media
mkdir -p "$1"/mnt
mkdir -p "$1"/opt
mkdir -p "$1"/proc
mkdir -p "$1"/sys
mkdir -p "$1"/tmp
echo " [ OK ]"

echo -n "Creating FSTAB..."
echo -e "
aufs / aufs defaults 0 0
/dev/$2$3 / $5 defaults 1 1
/dev/cdrom /mnt/cdrom auto noauto,owner,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
none /mnt/slaxdrive slaxdrive defaults 0 0
$SWAP" > "$1"/etc/fstab && echo " [ OK ]"

echo -n "Creating MTAB..."
echo -e "
/dev/root / $5 rw,errors=continue,data=ordered 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
usbfs /proc/bus/usb usbfs rw 0 0
tmpfs /dev/shm tmpfs rw 0 0
" > "$1"/etc/mtab_ && echo " [ OK ]"

echo -n "Copying BOOT data..."


for file in $(echo "$filesb")
do
if [ -f "$file" ]; then
cp "$file" "$1"/boot/
fi
done

cp "$LIVE"/"$BOOT"/*.c32 "$1"/boot/

if [ -f "$COM32_1" ]; then
cp "$COM32_1" "$1"/boot/
fi

if [ -f "$COM32_2" ]; then
cp "$COM32_2" "$1"/boot/
fi

echo " [ OK ]"

echo -n "Installing Boot-Sector..."
#cat "$1"/boot/mbr.bin > /dev/$2
cat "$LIVE"/"$BOOT"/mbr.bin > /dev/$2
echo " [ OK ]"
if [ ! -e "$EXTL" ]; then
echo -e "Could not found 'extlinux' binary..."
echo -n "Please enter location of 'EXTLINUX' binary: "
read EXTL
fi
"$EXTL" --install "$1"/boot/
echo "Installing Boot-Loader... [ OK ]"

##### ASKING SOME... #####
echo -n "Do you want to start X-Server automatically right after boot? [Y/N]: "
read bootopt
if echo $bootopt | grep -qi 'y' ; then
flags="xmode,$flags"
fi
echo -n "Do you want to start PXE Server automatically right after boot? [Y/N]: "
read bootopt
if echo $bootopt | grep -qi 'y' ; then
flags="pxe,$flags"
fi
echo -n "Enter VGA= parameter or leave it empty for default [normal]: "
read bootopt
if [ "$bootopt" ]; then
vga="$bootopt"
else
vga="normal"
fi
###-----###

echo -n "Creating SYSLINUX.CFG..."
echo -e "
UI /boot/vesamenu.c32
MENU TITLE Slax | Syslinux
PROMPT 0
TIMEOUT 10
LABEL Slax
MENU LABEL Slax 7
KERNEL /boot/vmlinuz
APPEND root=/dev/$2$3 printk.time=0 vga=$vga ro quiet slax.flags=$flags
" > "$1"/boot/extlinux.conf
echo " [ OK ]"

if [ "$LABEL" ]; then
sed 's/hostname=slax//g' /etc/NetworkManager/NetworkManager.conf > "$1"/etc/NetworkManager/NetworkManager.conf
echo "hostname=$LABEL" >> "$1"/etc/NetworkManager/NetworkManager.conf
fi

modprobe -c >> "$1"/lib/modprobe.d/slax-modules.conf
echo "\l `uname -o` \r | `cat /etc/slax-version` | \t - \d
>> \n @ \o
\s \m \v
>> \U logged in.
" >"$1"/etc/issue
echo -n "Last question: Do you want to enable auto-login of root?
(This may cause security issues) [Y/N]: "
read autologin
if echo $autologin | grep -qi 'y' ; then
passwd -d root
cp /etc/{shadow,passwd} "$1"/etc/
sed 's/agetty/agetty -a root/g' /etc/inittab > "$1"/etc/inittab
fi
sed 's/\ --noclear//g' "$1"/etc/inittab > "$1"/inittab
rm -f "$1"/etc/inittab && mv "$1"/inittab "$1"/etc/

echo -n "Unmounting File Systems..."
umount /dev/$2$3
echo " [ OK ]"

echo " --- "
echo "
Setup is (seems to be) completed.
If you haven't set your partition active, set it now!
Then reboot your computer!
PS. Do 'fdisk /dev/$2' command
Then press [A] and hit [ENTER]
Press $3 and hit [ENTER] again.
For saving and writing changes, press [W] and hit [ENTER] "
exit 0
 
OrionRed
wrote 1 year ago


reply
What bothers me about this is the changes.dat handling. The longer you have that installed, the bigger that file is going to get. Eventually, it will get too big for something, or just slow things down so much you can't use it.

You'd almost need something that writes the changes permanently to the file system, then reset the changes.dat file.
 
sorajio
wrote 1 year ago


reply
OrionRed wrote:
What bothers me about this is the changes.dat handling. The longer you have that installed, the bigger that file is going to get. Eventually, it will get too big for something, or just slow things down so much you can't use it.

You'd almost need something that writes the changes permanently to the file system, then reset the changes.dat file.


I know an other linux distro(porteus) base on slax that can make the modifys and settings to be a "module".
 
bb as guest
wrote 1 year ago


reply
sorajio wrote:
OrionRed wrote:
What bothers me about this is the changes.dat handling. The longer you have that installed, the bigger that file is going to get. Eventually, it will get too big for something, or just slow things down so much you can't use it.

You'd almost need something that writes the changes permanently to the file system, then reset the changes.dat file.


I know an other linux distro(porteus) base on slax that can make the modifys and settings to be a "module".



I think that could be done with existing slax tools; copy off the directory to another linux filesystem, explore into that then and delete unwanted directories [mnt, dev, tmp, and so forth] and then finally do a dir2sb on what is left, and copy that to /slax/modules. And then boot without perch, and go into /mnt/live/memory/changes and delete everything.
 
skyhog99
wrote 1 year ago


reply
Visitors to this thread are probably wondering, "I followed all the instructions with the 64bit version of Slax but it doesn't seem to work. What am I doing wrong?!"

There are a few additional directories that are not being copied in these instructions, one of them is lib64. If you don't copy this directory, you get a kernel panic, init not found.

Learned this the hard way,
skyhog99
 
pvtmert
wrote 1 year ago


reply
skyhog99 wrote:
Visitors to this thread are probably wondering, "I followed all the instructions with the 64bit version of Slax but it doesn't seem to work. What am I doing wrong?!"

There are a few additional directories that are not being copied in these instructions, one of them is lib64. If you don't copy this directory, you get a kernel panic, init not found.

Learned this the hard way,
skyhog99

thanks man really worked well!
i will update my script soon!
 
yereverluvinunclebert
wrote 1 year ago


reply
It is ABOUT TIME that someone with the required slax knowledge built a simple installation for installing Slax on a hard drive. The way it is at the moment it is MOST OFF-PUTTING for any poor Windows user who might want to replace their o/s with a system like Slax. If there isn't a simple installation file then most won't know what to do and won't have the confidence to start.

For goodness sake - create an installation file for installing Slax into a Hard drive, all the others can do it...
 
jcsoh
wrote 1 year ago


reply
Unofficial installer

http://old.slax.org/forum.php?action=view&parentID=83007&highlight=window%207%20installer
 
Steve Auguste
wrote 1 year ago


reply
I figured out how to install on hard drive! I used grub4dos to make it work. In the menu.lst, you have to enter
kernel /slax/boot/vmlinuz . Hit enter and type
initrd /slax/boot/initrfs.img . Then enter
boot /slax/boot/vesamenu.c32 .

You should have three lines like above in the menu.lst:

kernel /slax/boot/vmlinuz
initrd /slax/boot/initrfs.img
boot /slax/boot/vesamenu.c32

What you see right above this typing is what I have in the menu.lst and slax boots up. Please note that you have to log in with "root" for username and "toor" for password. After entering that, you have to enter "startx" or it won't boot.

Please note that I have lucid puppy 5.28 as my main operating system. I believe it should work with whatever operating system you have, but slax can't be the primary for some reason in my case. Let me know if anyone can make slax primary operating system.
 
ridak
wrote 1 year ago


reply
OrionRed wrote:
What bothers me about this is the changes.dat handling. The longer you have that installed, the bigger that file is going to get. Eventually, it will get too big for something, or just slow things down so much you can't use it.

You'd almost need something that writes the changes permanently to the file system, then reset the changes.dat file.


Is there a solution for Slax' growing changes.dat meanwhile? Would be pretty cool then with an hdd-install out of the box...
 

  » search  » forum index  

Post your reply

Your name (Login):

Message:

These HTML tags are allowed: <quote>, <b>, <u>, <i>, <pre>, <code>, <small>, <h1>, <h2>, <h3>, <li>



Slax is generously supported by: P&P Software GmbH and wisol technologie GmbH