Results 1 to 9 of 9

Thread: Unattended mount of persistent image at boot time

Hybrid View

  1. #1
    Junior Member
    Join Date
    Aug 2007
    Posts
    3

    Unattended mount of persistent image at boot time

    Hello,

    I've done some searches both in this forum and through Google without success.

    I've managed to get Knoppix v5.1.1 on a USB thumb drive, and am able to use it successfully. I have also been able to create a persistent image on the same thumb drive (/media/sda4). Whenever Knoppix boots, it finds the image and presents this dialog box:

    [X] Mount persistent KNOPPIX-homedirectory
    [X] Add as persistent, writeable system area
    [ ] Overwrite / update stored system configuration
    [X] Start INIT-bootscripts (Network, printer etc.)

    < OK > < CANCEL >

    Left alone on its own, this dialog defaults to not mounting the image; only after I press the "Ok" button before the timeout period does Knoppix mount this /media/sda4/knoppix.img. I have a need for Knoppix to mount this image without human intervention. Is this possible via some cheat codes, or must I remaster?

    Thanks in advance

  2. #2
    Junior Member registered user
    Join Date
    Aug 2007
    Posts
    12
    When you add the cheatcode
    Code:
    home=scan
    at boot, this dialog also appears, but the default option is then mounting the image.
    I'm still not sure if the image is being mounted then without pressing ENTER...

  3. #3
    Junior Member
    Join Date
    Aug 2007
    Posts
    3
    Double12,

    I've tested the "home=scan" option with and without the manual "Enter" press. Without pressing the "Enter" key, the image will not mount, even though the default selection is on the "Ok" button.

    The reason I'm doing this is because I use X10 home automation components in my house. I've populated this USB Knoppix boot with some utilities that will simulate a "living" house (lights on/off, radio on/off at certain time). When I leave the house for an extended period, I would just plug this USB drive in my computer and reboot and everything is up and running. The problem is that if there's a power failure while I'm away, this setup would not boot into the right configuration without my intervention (ie "Enter" press). I can do this with the knoppix.cfg script, but thought this way is cleaner.

  4. #4
    Junior Member registered user
    Join Date
    Aug 2007
    Posts
    12
    Quote Originally Posted by omaha64
    Double12,

    I've tested the "home=scan" option with and without the manual "Enter" press. Without pressing the "Enter" key, the image will not mount, even though the default selection is on the "Ok" button.

    The reason I'm doing this is because I use X10 home automation components in my house. I've populated this USB Knoppix boot with some utilities that will simulate a "living" house (lights on/off, radio on/off at certain time). When I leave the house for an extended period, I would just plug this USB drive in my computer and reboot and everything is up and running. The problem is that if there's a power failure while I'm away, this setup would not boot into the right configuration without my intervention (ie "Enter" press). I can do this with the knoppix.cfg script, but thought this way is cleaner.
    When I add cheatcode "home=scan", I have to press ENTER if I want to use the found image as home directory. If I don't press ENTER, the image is mounted and browseable, but not used as home directory.
    You indeed will have to write some kind of script or remaster the disk to let Knoppix use the image automatically without human intervention.
    But I'm not experienced enough to know how to do that.

  5. #5
    Junior Member
    Join Date
    Sep 2007
    Posts
    1
    I'm seeing the same behaviour with Kaella 3.2-DVD-rc1 which is based on Knoppix 5.1.1 (2007-01-04).

    This is a bug in the /usr/sbin/knoppix-image script. Here is a patch that works for me :
    Code:
    --- knoppix-image.old   2007-09-18 15:43:56.000000000 +0200
    +++ knoppix-image.new   2007-09-18 15:43:56.000000000 +0200
    @@ -141,6 +141,7 @@
     # Try to mount this filesystem read-write
     # trymount device|file mountpoint
     trymount(){
    +local RC=1
      # Check if already mounted
      case "$(cat /proc/mounts)" in *\ $2\ *)
       checkwritable "$2" && return 0
    @@ -229,8 +230,16 @@
     [ -n "$FORCE" ] && AUTO="--timeout 10" || AUTO="--timeout 20 --defaultno"
     $DIALOG --title "$TITLE" $AUTO --checklist "$DESC1" 22 75 4 home "$MENU1" on system "$MENU2" on overwrite "$MENU3" off init "$MENU4" on 2>"$TMP"
     RC="$?"
    -if [ "$RC" = "0" ] || [ "$RC" = "255" -a -n "$FORCE" ]; then
    - SELECTION="$(<$TMP)"
    +if [ "$RC" = "1" ] || [ "$RC" = "255" -a -z "$FORCE" ]; then
    + rm -f "$TMP"
    + umount /KNOPPIX.IMG 2>/dev/null
    + bailout
    +else
    + if [ "$RC" = "0" ]; then
    +  SELECTION="$(<$TMP)"
    + else
    +  SELECTION='"home" "system" "init"'
    + fi
      rm -f "$TMP"
      # mount base partition rw
      BASE="$(dirname "$IMAGE")"
    @@ -238,10 +247,6 @@
      checkwritable "$BASE" || { umount -l "$BASE"; sleep 2; mount -o rw "$BASE"; }
      checkwritable "$BASE" || { $DIALOG --title ERROR --msgbox "$ERRORW" 15 75; bailout; }
      trymount "$IMAGE" /KNOPPIX.IMG || { $DIALOG --title ERROR --msgbox "$ERRORW" 15 75; umount /KNOPPIX.IMG 2>/dev/null; bailout; }
    -else
    - rm -f "$TMP"
    - umount /KNOPPIX.IMG 2>/dev/null
    - bailout
     fi
     
     OLDHOMEDIR=""

  6. #6
    Senior Member registered user
    Join Date
    Sep 2006
    Posts
    148
    Well... I've got to thank omaha64 for starting this thread. It describes the situation accurately, and was always a small peeve of mine. The presense of the knoppix.img should create the assumption that it is there to be used... and without interaction. Then I could turn on the pc and go and get some coffee.

    I wish there was a way to get this to work without having to remaster knoppix. If knoppix.sh executed first then we could just copy over the culprit script with a better version more to our liking. By the time I could make a remaster, knoppix 6.0 will be out!

    Thanks to both xhienne and Double 12 for adding their info to this one. I guess this may be the thing that gets me to try and remaster knoppix.

  7. #7
    Administrator Site Admin-
    Join Date
    Apr 2003
    Location
    USA
    Posts
    5,441
    You guys seem to be discussing something that I asked for years ago, see this thread. Unfortunately, while many of us think that this would be the natural way that Knoppix should operate, the developers have what I consider to be rather paranoid views that prevent them from giving us this feature. Unless common sense prevails, and that hardly seems likely, yes, you will have to remaster to get this very desirable feature.

  8. #8
    Senior Member registered user
    Join Date
    Sep 2006
    Posts
    148
    Hi Harry,

    Wow... all the way back in 2004! Yeah, like I said... it was a small peeve I had. What say we make a iso with the one small change and call it knoppix-home. I think I may try and do the CD version. We could put it up on torrent for mass consumption.

    Time for something to happen with this problem.
    I am also trying to figure out what is wrong with my persistent home in this discussion.
    In this thread
    Fsck always gives an error when I boot up... saying the partition was not cleanly unmounted. Does anyone else have this problem with their persistent home dirs?

    I would hate to remaster a knoppix and find out that I needed to use a later version of something like aufs afterword.

  9. #9
    Senior Member registered user
    Join Date
    Sep 2006
    Posts
    148
    Quote Originally Posted by Harry Kuhman
    You guys seem to be discussing something that I asked for years ago, see this thread. Unfortunately, while many of us think that this would be the natural way that Knoppix should operate, the developers have what I consider to be rather paranoid views that prevent them from giving us this feature. Unless common sense prevails, and that hardly seems likely, yes, you will have to remaster to get this very desirable feature.
    Hey Harry,

    I actually made an iso that now has the patch above... and it works. The iso is my first one, and since I used the knoppix-remaster script I can't tell you alot about what I did right and wrong. lol.

    I did boot with the DVD when I ran it and it did not make the KNOPPIX2 cloop file, but it booted when I booted it using grub and the bootfrom= option using Gilles Ryumbeke's minirt_511a.gz.

    I made just 2 mods.
    The patch above in knoppix-image.
    I modified knoppix-halt to not exclude pump from being killed off... which means I now don't get fsck errors when I mount my persistent home... and has the side benefit of much faster shutdowns, Hooray!

    It is not really necessary to remaster to fix the later... as changing the file in your persistent home is enough to correct it.

    Harry, you are right... it is necessary to remaster to fix the problem discussed here for the topic. Damn. Well it was not so hard with the scripts and enough disk space. I will get better at this. If you'd like an iso image it is around 2Gb, but I could put it on my webspace in a few pieces. It is really just half of the DVD version.

    hey xhienne,
    Thanks again for the patch!

Similar Threads

  1. Microknoppix 6.1? USB boot w/ persistent image
    By rdcuff in forum General Support
    Replies: 6
    Last Post: 12-04-2009, 01:49 AM
  2. Persistent Image Question
    By Chris_K in forum General Support
    Replies: 2
    Last Post: 03-31-2009, 10:01 PM
  3. Auto mount persistant image on boot
    By luka in forum Hardware & Booting
    Replies: 2
    Last Post: 07-23-2008, 03:48 PM
  4. Takes a long time to image a drive with dd
    By brentokc in forum General Support
    Replies: 7
    Last Post: 06-09-2004, 06:44 PM
  5. How to mount KNOPPIX boot image?
    By yuu_shi in forum General Support
    Replies: 0
    Last Post: 01-29-2004, 01:39 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 FX2s + 8x FC430 Blades 16x E5-2630v4 160 Cores Rails No PSU/RAM picture

Dell PowerEdge FX2s + 8x FC430 Blades 16x E5-2630v4 160 Cores Rails No PSU/RAM

$699.00



Dell PowerEdge FC430 Blade Server 2x Xeon E5-2630v4 20 Cores FX2 FX2s No RAM/HDD picture

Dell PowerEdge FC430 Blade Server 2x Xeon E5-2630v4 20 Cores FX2 FX2s No RAM/HDD

$119.99



Dell PowerEdge M640 Blade Barebone Server Dell P/N: HHB006 Tested Working picture

Dell PowerEdge M640 Blade Barebone Server Dell P/N: HHB006 Tested Working

$149.99



Dell PowerEdge M620 Blade Server 2x Xeon E5-2680v2 2.8ghz 20-Cores | 128GB picture

Dell PowerEdge M620 Blade Server 2x Xeon E5-2680v2 2.8ghz 20-Cores | 128GB

$149.99



NETAPP HCI NAF-1701 SuperMicro Server 4X BLADE H410C 8X GOLD 5120 4 NODE SERVER picture

NETAPP HCI NAF-1701 SuperMicro Server 4X BLADE H410C 8X GOLD 5120 4 NODE SERVER

$1499.97



Dell Poweredge C6400 24x 2.5’’ 2x 2400W 4x C6420 Nodes H330 | 2x SFP | 8x Trays picture

Dell Poweredge C6400 24x 2.5’’ 2x 2400W 4x C6420 Nodes H330 | 2x SFP | 8x Trays

$799.99



LOT (8) Cisco UCS UCSB-B200-M5  2x6248R  24 core 3.0G   24x64g DDR4-2933 ram picture

LOT (8) Cisco UCS UCSB-B200-M5 2x6248R 24 core 3.0G 24x64g DDR4-2933 ram

$112000.00



Cisco B200 M3 2x E5-2670V2 10 Core 8x 16GB-128GB Ram Blade Server VIC1240 14900R picture

Cisco B200 M3 2x E5-2670V2 10 Core 8x 16GB-128GB Ram Blade Server VIC1240 14900R

$399.00



Dell PowerEdge M630 Blade Server 2x Xeon E5-2680 v4, 2F3MP , 4GDP5 ,R10KJ ,JVFVR picture

Dell PowerEdge M630 Blade Server 2x Xeon E5-2680 v4, 2F3MP , 4GDP5 ,R10KJ ,JVFVR

$96.60



Dell Poweredge VRTX 25Bay 2.5

Dell Poweredge VRTX 25Bay 2.5" 2x PERC 8, 2xCMC, I/O 1GB Pass Through, 4x PS

$578.08