Find the answer to your Linux question:
Results 1 to 8 of 8
Hello, I am trying to work out how to achieve this: Have a usb stick that upon plugging into laptop and hitting the power button, a fast booting text only ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2011
    Posts
    2

    Just want a fast booting distro that can run a single simple script


    Hello,

    I am trying to work out how to achieve this:

    Have a usb stick that upon plugging into laptop and hitting the power button, a fast booting text only linux distro boots up and runs this script:

    Code:
    #!/bin/bash
     
    clear
    echo "Volume header (Sector 62):"
    echo
    hexdump -C -s 31744 -n 512 /dev/sda
    echo
    echo "Wiping in:"
    echo
    function countdown
    {
            local OLD_IFS="${IFS}"
            IFS=":"
            local ARR=( $1 )
            local SECONDS=$((  (ARR[0] * 60 * 60) + (ARR[1] * 60) + ARR[2]  ))
            local START=$(date +%s)
            local END=$((START + SECONDS))
            local CUR=$START
     
            while [[ $CUR -lt $END ]]
            do
                    CUR=$(date +%s)
                    LEFT=$((END-CUR))
     
                    printf "\r%02d:%02d:%02d" \
                            $((LEFT/3600)) $(( (LEFT/60)%60)) $((LEFT%60))
     
                    sleep 1
            done
            IFS="${OLD_IFS}"
            echo "        "
    }
     
    countdown "00:00:10"
    clear
    for I in {1..100}; do dd if=/dev/urandom of=/dev/sda bs=512 count=1 seek=62; dd if=/dev/zero of=/dev/sda bs=512 count=1 seek=62; done
    echo
    echo "done, result:"
    echo
    hexdump -C -s 31744 -n 512 /dev/sda
    and then it shuts down the laptop.

    What distro should i use? I've tried putting, for example, a live distro called Finnix on a usb stick and it boots in only like 5 seconds which is nice, however there is no file persistence since it is a liveCD only basically. Since i have a script that needs to be run at start-up, i need a persistent install of a distro on the usb don't i? (so that the script will always be in /etc/init.d).

    A file persistent install is easy for ubuntu for example, using unetbootin, but ubuntu is just too big and takes too long to startup considering that all i need executed is that script.

    Ideally it'd just take 20 seconds from pressing restart to the linux loading then computer shutting down. Please help if you have any ideas, thanks!

    I thought another candidate might be 'microcore linux' but i haven't for the life of be been able to work out how to make a persistent install of it on usb stick.

  2. #2
    Linux Guru
    Join Date
    Jul 2008
    Posts
    4,201
    You can use a AntiX full Iso live session to make a AntiX core persistent USB via antixcc (crossed wrenches in Icewm
    Desktop)

    My Base Iso how to.

    antiX-forum - View topic - Antix 11 antix2usb persistent

    edit; I should mention core iso is like a debian net install. No gui. Just init 3 bootup.
    Base Iso comes with fluxbox only and ceni and rutilt as network connection centers.

  3. #3
    Just Joined!
    Join Date
    Jul 2011
    Posts
    2
    I looked at that tutorial... are you saying i need to install the gui version of it (for example in virtualbox) then i can plug in my usb and use that to install the core version only?

  4. $spacer_open
    $spacer_close
  5. #4
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    All you really need is a kernel and a custom initrd image to go with it. and you need a Linux environment in which to build/configure it, of course.

    Have a look at this guy's project, it is simple, customizable, and does what you want. I've never used it (the one I based my own custom rescue OS on has disappeared from the net) but it looks pretty straight-forward.

  6. #5
    Linux Guru
    Join Date
    Jul 2008
    Posts
    4,201
    Quote Originally Posted by whitelines2 View Post
    I looked at that tutorial... are you saying i need to install the gui version of it (for example in virtualbox) then i can plug in my usb and use that to install the core version only?
    Never tried it using Virtual Box. I just used Live Cd or Live USB and downloaded core iso during live session and ran the installer. No need to run virtual box for me. You could try it out in Vbox and see I guess.

  7. #6
    Just Joined!
    Join Date
    Dec 2007
    Posts
    35

    Memory Stick

    Quote Originally Posted by rokytnji View Post
    Never tried it using Virtual Box. I just used Live Cd or Live USB and downloaded core iso during live session and ran the installer. No need to run virtual box for me. You could try it out in Vbox and see I guess.
    Hi,

    I've been running for a while now, different distros of Linux as an INSTALLED RUNNING OS (not live version). I don't need any additional different software to do that. All I do is use the Live version's permanent installation application. And I cause the installation to occur on a USB memory stick, or an external USB hard drive. GRUB boot manager, handles the standard bootup, and that's also on the external stick. If the stick is pulled out, then Windows comes up with no boot manager handling the starting sequence. Nothing gets installed on a Windows hard drive.

    For a fast boot up, you could possibly try Puppy Linux, or some other cut down OS. You can find some choices by checking out "Distrowatch.com". They give quite expansive reports on different OS's. New reviews come out every Monday, with a listing is all kinds of new and updated Linux flavors.

    Hope that this helps.


  8. #7
    Linux Newbie
    Join Date
    Dec 2010
    Posts
    146
    Nice script to teach Microsoft fools a lesson. I've managed to make an image file which if written to a disk, Windows will not 'reinstall'. PM me if you're interested.

  9. #8
    Just Joined!
    Join Date
    Nov 2006
    Location
    near Berea, Kentucky (in a tipi)
    Posts
    47

    single script on USB distro

    I haven't tried it. I believe you could do this easily with tinycore (tinycorelinux.com). You'd need to "remaster" the system on USB stick. I don't think that'd be tough to figure out. (wiki.tinycorelinux.net/wiki:remastering/wiki:remastering). The image is 10 MB, so it boots fast.

    Let us know....

Posting Permissions

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