FROM RAM to USB (configurations)


Forum: Other Help Topics
Topic: FROM RAM to USB (configurations)
started by: Patrick

Posted by Patrick on Sep. 07 2004,11:57
Hello folks,

I managed to get my usb-stick bootable but now i want to save my changes/configuration to the stick! I know about: filetool.lst but that file is located in RAM so any changes i make will go lost when i reboot! (won't they?)

I had trouble making the stick bootable, in the end i copied evrything from the boot-floppy to the usb stick (after a syslinux /dev/sda1) and then it finnaly worked. I had to do it this way because of the error messages i got with frugal. (see they how to-section)...

Anybody any ideas?

Posted by ke4nt1 on Sep. 07 2004,12:31
When you run a backup , backup to sda1..
Make sure the line " /home/dsl/filetool.lst "  is in your " /home/dsl/filetool.lst " ..
As well as any other areas you want in your backup..  
Then add the restore command to your bootup, for example..
" dsl dma toram mydsl=sda2 restore=sda1 "
( I have a second partition on my USBkey for extensions and junk )
Here's my filetool.lst ..
---------------------------------------------------------
opt/ppp
opt/bootlocal.sh
opt/powerdown.sh
opt/.firefox_plugins
home/dsl/filetool.lst
home/dsl/.fluxbox/backgrounds
home/dsl/.fluxbox/styles
home/dsl/.fluxbox/init
home/dsl/.xinitrc
home/dsl/.xserverrc
home/dsl/.phoenix
home/dsl/Mail
home/dsl/.sylpheed
home/dsl/.axyftp
home/dsl/.xmms
home/dsl/.opera
etc/apt/sources.list
home/dsl/.ssh
home/dsl/.xtdeskrc
home/dsl/.barrage.hscr
home/dsl/.dillo
------------------------------------------------------------

73
ke4nt

Posted by henk1955 on Sep. 07 2004,12:56
if you do a backup, all files and directories named in the file: /home/dsl/filetool.lst will be put in the backup-file.
so if you want to save i.e. firefox settings
add
/home/dsl/.phoenix
/home/dsl/.mozilla
to this file

if you look into the filetool.lst you will see the first line is:
/home/dsl/filetool.lst

that means that it the file itself is backed up to.

a little problem may be if you run DSL from the stick (that is jou do not use toram)
if you want to backup to /dev/sda1 you get mount errors

i solved it this way:
i backup to /cdrom ( that is NOT the real cdrom, but the root of your bootdevice )
first i make /cdrom writeable ( sudo mount /cdrom -o remount,rw)
then make a /opt/.backup_device file ( echo "/cdrom" >/opt/.backup_device.
then do a backup (filetool.sh backup noprompt noprompt)

this can easy be automated.
1. create an  S49dsl_restore.dsl ( its is a q&d patched replacement of /etc/rc5.d/S49dsl_restore, the only modyfication is
Code Sample

# Aw schucks, sorry I couldn't mount any drive that I know...
 BACKUP_DEVICE="/cdrom"
 echo "$BACKUP_DEVICE" > /opt/.backup_device
return

)

2 add to bootlocal.sh: mount /cdrom -o remount,rw

3 uncomment in powerdown.sh : filetool.sh backup noprompt noprompt

done.

this way i can have /KNOPPIX/knoppix.img AND dsl extensions AND backup-file in the same diskpartion

maybe someone knows a better way?

Posted by roberts on Sep. 07 2004,14:59
henk1955, using the remount command has been posted here before. It is the correct way to allow backups on the usb pendrive single partition.
In 0.8.1 we have made this capability of saving to a single partition on the pendrive  transparent.

Posted by henk1955 on Sep. 08 2004,07:31
i kown aboubt the remounting of /cdrom.
BUT that is only half of the sollution of my problem.

if i type at the boot pompt:
dsl fromhd=/dev/hda2 restore=/dev/hda2
i get mount errors, and no restore has taken place.

therfore i have made a small dsl extension that replaces S49dsl-restore.

now if i type:
dsl fromhd=/dev/hda2 restore
every thing goes well

Posted by roberts on Sep. 08 2004,17:04
Both halves will be transparent in 0.8.1  :)
Posted by henk1955 on Sep. 09 2004,09:24
The new filetool now enables me to backup and restore to the bootpartition .
You made a nice simple gui for it.( so this is why flua is introduced.)

my knoppix_dir and backup.tar.gz is on /dev/hda7

if i use device /cdrom restore works
if i use device /hda7 restore works

what boot paramter do a use to have the restore a boottime?

i have tried
restore=cdrom
restore=/cdrom
restore=/hda7

none of these work.

<edit>
restore=/dev/hda7 doesnt work.

if i do a very quick & dirty patch replace all of /etc/rc5.d/S49dsl_restore with:
Code Sample

#!/bin/bash

# Aw schucks, sorry I couldn't mount any drive that I know...
 BACKUP_DEVICE="/dev/hda7"
 echo "$BACKUP_DEVICE" > /opt/.backup_device

/usr/sbin/filetool.sh restore noprompt

exit 0


and make a patch.tar.gz place it in mydsl extesions
it works perfect.

i hope you dont think any of my posts is to critize your work.
you do a very good job.

Posted by ke4nt1 on Sep. 09 2004,12:23
Try this ..
" restore=hda7 "

You don't need a leading / in this option.
from the cdrom, try " restore=cdrom2 "

and the new DSL 0.8.1 should handle this much better than before.

73
ke4nt

Posted by henk1955 on Sep. 09 2004,12:54
sorry: restore=hda7 doesnt work.
Posted by roberts on Sep. 09 2004,14:16
henk1955, please post your /etc/fstab, so I may see where might be a problem. Off the top of my head, I suspect that the device is not detected at boot time and must not be in /etc/fstab. The logic is quite simple the target is searched for in /etc/fstab and the mount point is returned from there. I have an aversion to using cdrom and use sda1, but really either should work. We did do alot of testing backiing and restore to many paritions both from the boot option as well as the filetool gui. Your input is appreciated.
Posted by henk1955 on Sep. 09 2004,15:21
Code Sample

/proc      /proc       proc   defaults            0 0
/sys       /sys        sysfs  noauto              0 0
/dev/pts   /dev/pts    devpts mode=0622           0 0
/dev/fd0   /mnt/auto/floppy auto   user,noauto,exec,umask=000    0 0
/dev/cdrom /mnt/auto/cdrom  auto   user,noauto,exec,ro 0 0
# Added by KNOPPIX
/dev/hde1 /mnt/hde1 vfat noauto,users,exec,umask=000,uid=1001,gid=500 0 0
# Added by KNOPPIX
/dev/hda1 /mnt/hda1 vfat noauto,users,exec,umask=000,uid=1001,gid=500 0 0
# Added by KNOPPIX
/dev/hda2 /mnt/hda2 ext2 noauto,users,exec 0 0
# Added by KNOPPIX
/dev/hda5 none swap defaults 0 0
# Added by KNOPPIX
/dev/hda6 /mnt/hda6 vfat noauto,users,exec,umask=000,uid=1001,gid=500 0 0
# Added by KNOPPIX
/dev/hda7 /mnt/hda7 ext2 noauto,users,exec 0 0

Posted by henk1955 on Sep. 09 2004,15:40
wat puzels me the most is that if i replace the original /etc/rc5/S49dsl-restore by my simpler variant( it set /opt/.backup_device and than call /usr/sbin/filetool.sh
every thing goes well

following the COMPLETE code of my /etc/rc5/S49dsl-restore :
Code Sample

!/bin/bash

. /etc/init.d/dsl-functions

 CMDLINE=$(cat /proc/cmdline)
#  DEVICE="$(getbootparam 'restore')"
 BACKUP_DEVICE="$(getbootparam 'restore')"
#  BACKUP_DEVICE="/dev/hda7"
 echo "$BACKUP_DEVICE" > /opt/.backup_device

/usr/sbin/filetool.sh restore noprompt
exit 0



my car /proc/cmdline
Code Sample

ramdisk_size=100000 init=/etc/init lang=us apm=power-off hda=scsi hdb=scsi hdc=scsi hdd=scsi hde=scsi vga=791 nomce fromhd=/dev/hda7 knoppix_dir=dsl-0.8.1 frugal lpd restore=/dev/hda7 mydsl_dir=(/dsl-0.8.0/base /dsl-0.8.0/henk)


filetool.lst
Code Sample

/home/dsl/filetool.lst
/opt/ppp
/opt/bootlocal.sh
/opt/powerdown.sh
/opt/phome.sh
/usr/share/icewm/themes/BlueCurve/default.theme
/opt/mysql
/opt/openoffice
/opt/openoffice1.1.2
/home/dsl/OpenOffice.org1.1.0
/home/dsl/OpenOffice.org1.1.2
/home/dsl/.sversionrc
/home/dsl/.mime.types
/home/dsl/mailcap
/home/dsl/bewaar
/home/dsl/.mplayer
/home/dsl/.sylpheed
/home/dsl/Mail
/home/dsl/.amsn
/home/dsl/.amsn_received
/home/dsl/.mozilla
/home/dsl/.phoenix
/opt/.firefox_plugins
/home/dsl/.icewm
/home/dsl/GNUstep
/home/dsl/Choices
/home/dsl/.xinitrc
/home/dsl/.xserverrc
/home/dsl/.axyftp


<edit>
btw
at startup it says
Restoring backup files from /cdrom
at shutdown
... to /cdrom
</edit

Posted by roberts on Sep. 09 2004,17:09
Quote
fromhd=/dev/hda7 knoppix_dir=dsl-0.8.1 frugal lpd restore=/dev/hda7


Since I don't run fromhd, it may be a timing issue.

You mod is just really delaying things by storing from cmdline to /opt/.backup_device then reparsing and starting another script that would allow more time to pass.

I will have to setup a test environment to see if I can reproduce this. I will also check with beta testers to see if anyone tested such an environment. But it seems that you have a work-around for your needs for now.

It is indeed interesting to see the many various ways users deploy the system It does make it challenging to test the system in so many ways.

Posted by henk1955 on Sep. 09 2004,18:25
i hardy think its a timing problem
i autoload:
icewm.dsl
spool_lpd_ld.tar.gz = printer settings
amsn.dsl
dsl-aterm.tar.gz
firefox.uci
ImageMagic.dsl
j2re1.4.2.uci
rkhunter.dsl
rox.dsl
tcktk8.3.dsl

this should give more then enough delay.

@Roberts:
please dont waste to many time on this.
i dont give this high priority.
i am happy with the way i have solved it.

Posted by roberts on Sep. 09 2004,19:46
No. I like the challenge. I have setup a test machine. Their is an issue with the combination of using fromhd and restore from the same hard drive, same is true  for frugal, your mod is specific only to those two combinations. Is it not a timing issue but one of the boot device not represented in /etc/fstab, it is correct in the /etc/mtab which represents devices that have been mounted. That is why your mod works with the fromhd. Your hda7 from /etc/fstab would indicate a mount point of /mnt/hda7 and not /cdrom, whereas using /etc/mtab yields the correct response. To me this indicates a problem inside the knoppix-autconfig whereas the boot device should be represented in /etc/fstab correctly which it is not. It is there I must look for a complete solution.
Posted by henk1955 on Sep. 09 2004,20:24
there is something diferent in S49dsl-restore and filetool.sh

S49dsl-restore
Code Sample

   BACKUP_DEVICE="$(grep $DEVICE /etc/fstab | awk '{print $2'})"
   sudo mount "$BACKUP_DEVICE"
   echo "$DEVICE" > /opt/.backup_device


filetool.sh
Code Sample

 BACKUP_DEVICE="$(grep $2 /etc/mtab|awk '{print $2}')"
 if [ -n "$BACKUP_DEVICE" ]; then
   return



note first one fstab next one mtab

maybe that explains my "problem"

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.