Results 1 to 4 of 4

Thread: making a current install of mandrake into a boot cd

  1. #1
    Junior Member
    Join Date
    Nov 2003
    Posts
    1

    making a current install of mandrake into a boot cd

    How could I take the server at work running mandrake and make it into a bootable cd?

  2. #2
    Member registered user
    Join Date
    Jan 2003
    Posts
    37
    First of all. Make sure you really want to do do this. I spend 2 weeks (14 days) in trial and error, until i got it working. Secundley even if you follow those steps, you might not succed first time. Be prepared to spend time wondering why it don't work.

    If you are still up to it, have fun. I know i did, when i got it right.

    I have been told that mandrake are not so different from Redhat, so..

    I did this with RedHat version 8, for a school project. where we wantet to make a firewall running on a cd-rom. Some of the following are rufley copyed and translated from my danish sa (i think it's called in english) and translated to english.

    Here the roufley guide of how i got RH 8.0 on a bootable cd.
    Thanks to the knoppix net distrubtion, to sort of show me how it's done



    When you have your system just like you want it. Boot on a rescue disk.
    Mount your partition / partitiosions. Then make a directory to contain your currend installetion.

    I maid the directory /hdimg and used rsync to copy all the files to /hdimg
    Code:
    rsync -av --exclude /hdimg / /hdimg
    Then chroot into /hdimg You don't want to damage your current working installetion.

    Now you have to find the start up script who are resposebill for starting all the services. exaime the file /etc/inittab for a line who looks like this:
    si::sysinit:/etc/rc.d/rc.sysinit

    it is the script /etc/rc.d/rc.sysinit you have to modify.
    You can chooice to put the commands into this file or call another script through rc.sysinit. I used the last option.

    On redhat, the rc.sysinit script there are a line like this:

    Code:
    # Rerun ourselves through initlog
    if [ -z "$IN_INITLOG" -a -x /sbin/initlog ]; then
        exec /sbin/initlog $INITLOG_ARGS -r /etc/rc.d/rc.sysinit
    fi
    You have to place your script after this(or commands) if this line exist, otherwice they will be run twice, witch can do some wired things. I ended up with a 4 TB ramdrive, even through the computer only had 128 mb memory (well at last df -h said it was 4 TB)

    Right after those lines i inserted the following into the file

    Code:
    # Kør custum script
    if [ -f /etc/rc.d/custum ]; then
        . /etc/rc.d/custum
    fi
    created the file /etc/rc.d/custum

    this file lookes somthing like this:
    Code:
    #!/bin/bash
    #Custum boot cd redhat script
    
    #Export global variables
    export PATH=/bin:/sbin
    
    #Format ramdrive
    mke2fs -vvv /dev/ram1
    
    #mount ram drive
    mount -n -t ext2 /dev/ram1 /ramdev
    
    #creates the file /etc/mtab and link it to 
    mkdir /ramdev/etc
    touch /ramdev/etc/mtab
    
    #creates div directoryes.
    mkdir /ramdev/var
    mkdir /ramdev/var/run
    mkdir /ramdev/var/lock
    mkdir /ramdev/var/lock/subsys
    mkdir /ramdev/var/utmp
    
    #Create tep
    mkdir /ramdev/tmp
    
    #Create empty log files
    mkdir /ramdev/var/log
    mkdir /ramdev/var/log/vbox
    touch /ramdev/var/log/boot.log
    touch /ramdev/var/log/cron
    touch /ramdev/var/log/dmesg
    touch /ramdev/var/log/ksyms.0
    touch /ramdev/var/log/lastlog
    touch /ramdev/var/log/maillog
    touch /ramdev/var/log/messages
    touch /ramdev/var/log/rpmpkgs
    touch /ramdev/secure
    touch /ramdev/spooler
    touch /ramdev/wtmp
    make sure to make the file executeable

    I altered the file /etc/fstab
    The first line should be where / gets mountet. i altered this line so it looks like this:
    Code:
    /dev/root.old           /                       ext3    defaults        0 0
    Then delete the file /etc/mtab and create a synlink to /proc mounts
    Code:
     ln -s /proc/mounts /etc/mtab
    and then delete /var/log and var/run

    At this point i exited chroot and created my own kernel-2.4.23
    I maid sure that ext3, iso9660 was compiled in the kernel (not as modules)
    Also ramdrive support, and set it to dafult size of 8Mb. And maked sure that initial ramdisk (initrd) also was compiled into the kernel.
    Else i i maid as mutch as possebil as modules

    I then graped the cloop source code from
    http://developer.linuxtag.net/knoppi..._2.00-1.tar.gz
    And compiled it for my kernel

    I then created the initrd filesystem
    Code:
    dd if=/dev/zero of=./initrd bs=M count=3000
    Format it with ext2 file system
    Code:
    mke2fs ./miniroot
    Mount it
    Code:
    mount -o loop /miniroot /mnt/floppy
    I then created the following on the initrd image:
    Code:
    mkdir system ramdrv modules static loop mnt mnt/floppt mnt/cdrom 
    ln -s system/bin/
    ln -s system/etc/
    ln -s system/lib/
    ln -s system/sbin/
    ln -s system/usr/
    ln -s ramdev/tmp
    ln -s ../ramdrev/var/run
    ln -s ../ramdrev/var/lock
    ln -s ../ramdrev/var/log
    ln -s ../ramdrev/var/tmp
    ln -s ../ramdrev/var/utmp
    cp -dpR /dev/* ./dev/
    cp ~/cloop-2.00/cloop.o ./modules/
    I then graped busybox source code from:
    ://busybox.net/downloads/busybox-1.00-pre3.tar.bz2
    Make sure you chooce build BusyBox as a static binary
    under build options.

    Then all you need to compile in is (i think) mount, ash, insmod
    If you build it in the default directory _install
    copy the contencs of this directory to the bin directory on the initrd image

    Then create the file linuxrc in the root of the initrd image.
    This file looks like this:
    Code:
    #!/bin/ash
    ## DD 5-12-2003
    #Start af initrd
    
    #Export parth
    export PATH=/bin:/sbin:
    
    #mounter proc
    mount -t proc proc /proc
    
    #mount cd note change this to where your cd drive is!!!!
    mount -t iso9660 /dev/hdb /loop
    
    #indlæser cloop.o modulet i kernen og peger på filen /loop/cd
    insmod /modules/cloop.o file=/loop/cdfs
    
    #mounter compressed fs
    mount -t iso9660 -o ro /dev/cloop /system
    
    #Switch troot device
    echo "0x100" > /proc/sys/kernel/real-root-dev
    
    exit 0
    allso make sure to make this script executeable

    Then unmount the initrd image and crompress it with gzip

    Then i created a 2.88 floppy image to be sure everything could fit on the image.
    Code:
    dd if=/dev/zero of=/boot.img bs=M count=2880
    format it with msdos fs
    Code:
    mkfs.msdos /boot.img
    Then grap syslinux from
    http://freshmeat.net/redir/syslinux/...x-2.07.tar.bz2
    and run
    Code:
    syslinux -s ./boot.img
    Make sure the switsh -s is there, otherwise the final cd might not be combatibel with your bios and won't boot!
    mount the floppy
    Code:
    msdos -o loop /boot.img /mnt/floppy
    and copy the nessary files on the floppy image
    Code:
    cp /usr/src/linux-2.4.23/arch/i386/boot/bzImage /miniroot.gz /root/syslinux-2.07/ldlinux.sys /mnt/floppy
    Create the file syslinux.cfg on the root of the floppy
    And this file contains
    Code:
    DEFAULT bzImage
    APPEND ramdisk_size=100000 initrd=miniroot.gz
    
    LABEL linux
    KERNEL bzImage
    APPEND ramdisk_size=100000 initrd=miniroot.gz
    
    PROMPT 1
    Unmount the floppy image.

    I maid the following directoryes to contain my actual cd image
    /bootcd and /bootcd /boot
    Copyed boot.img to /bootcd/boot

    now create the compressed file system with
    Code:
    mkisofs -pad -no-bak -J -R | /root/cloop-2.00/create_compressed_fs - 65536 > /bootcd/cdfs
    and to the final cd who can be burned
    Code:
    cd /bootcd
    mkisofs -pad -J -R -b /boot/boot.img -c /boot/boot.cat -o /redhat_boot_cd.iso ./
    Have fun

    Sincerley
    Gozar

  3. #3
    Senior Member registered user
    Join Date
    Aug 2003
    Location
    Dublin, Ireland
    Posts
    164

    Mandrake has mklivecd

    Though I haven't used it you could look at http://www.linuxminicd.org/mklivecd/ if the server is running Mandrake 9.2+

  4. #4
    Member registered user
    Join Date
    Jun 2003
    Posts
    57
    Does the current MandrakeMove offer any of the functionality you seek in a boot CD?

    -SUO

Similar Threads

  1. how to move current install to a new hard drive
    By Loafy in forum Hdd Install / Debian / Apt
    Replies: 1
    Last Post: 06-06-2005, 07:57 PM
  2. Dual Boot w/Mandrake Linux 10.1
    By Killswitch in forum Hdd Install / Debian / Apt
    Replies: 1
    Last Post: 04-09-2005, 01:51 PM
  3. Help booting mandrake install with grub...
    By rrfish72 in forum General Support
    Replies: 2
    Last Post: 11-14-2004, 10:53 PM
  4. removing mandrake to install knoppix
    By blipblipblip in forum General Support
    Replies: 3
    Last Post: 10-24-2004, 11:26 PM
  5. How 2 install Knpx over Mandrake on dual-boot XP/Linux HDD
    By Éireannach in forum Hdd Install / Debian / Apt
    Replies: 6
    Last Post: 07-22-2004, 05:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Dell PowerEdge M610 Blade Server E5620@2.2GHZ (6x)8GB RAM (2x)146GB 15K SAS HDD picture

Dell PowerEdge M610 Blade Server E5620@2.2GHZ (6x)8GB RAM (2x)146GB 15K SAS HDD

$75.00



Supermicro 4U 36 Bay Storage Server 2.4Ghz 8-C 128GB 1x1280W Rails TrueNAS ZFS picture

Supermicro 4U 36 Bay Storage Server 2.4Ghz 8-C 128GB 1x1280W Rails TrueNAS ZFS

$721.06



H261-Z61 2U 24SFF AMD Server 8x EPYC 7551 256-Cores 256GB RAM 8x25G NIC 2x2200W picture

H261-Z61 2U 24SFF AMD Server 8x EPYC 7551 256-Cores 256GB RAM 8x25G NIC 2x2200W

$2512.18



Dell PowerEdge R630 8SFF 2.6Ghz 20-Core 128GB Mem 4x1G RJ-45 NIC 2x750W PSU picture

Dell PowerEdge R630 8SFF 2.6Ghz 20-Core 128GB Mem 4x1G RJ-45 NIC 2x750W PSU

$399.04



DELL PowerEdge R730 Server 2x E5-2690v3 2.6GHz =24 Cores 32GB H730 4xRJ45 picture

DELL PowerEdge R730 Server 2x E5-2690v3 2.6GHz =24 Cores 32GB H730 4xRJ45

$275.00



Dell PowerEdge R730XD 28 Core Server 2X Xeon E5-2680 V4 H730 128GB RAM No HDD picture

Dell PowerEdge R730XD 28 Core Server 2X Xeon E5-2680 V4 H730 128GB RAM No HDD

$389.99



Dell PowerEdge R720XD Xeon E5-2680 V2 2.8GHz 20 Cores 256GB RAM 12x4TB picture

Dell PowerEdge R720XD Xeon E5-2680 V2 2.8GHz 20 Cores 256GB RAM 12x4TB

$510.00



Dell PowerEdge R620 Server 2x Xeon  E5-2620 @ 2.0GHz 64GB RAM NO HDDs picture

Dell PowerEdge R620 Server 2x Xeon E5-2620 @ 2.0GHz 64GB RAM NO HDDs

$108.96



DELL PowerEdge R630 8SFF Server 2x E5-2690v4 2.6GHz =28 Cores 128GB H730 4xRJ45 picture

DELL PowerEdge R630 8SFF Server 2x E5-2690v4 2.6GHz =28 Cores 128GB H730 4xRJ45

$444.00



HP Proliant DL360 Gen9 28 Core SFF Server 2X E5-2680 V4 16GB RAM P440ar No HDD picture

HP Proliant DL360 Gen9 28 Core SFF Server 2X E5-2680 V4 16GB RAM P440ar No HDD

$191.95