Automated Restore from USB Drive


Forum: Laptops
Topic: Automated Restore from USB Drive
started by: Rapidweather

Posted by Rapidweather on Jan. 24 2004,16:04
Hello all, I am new to this board, and am working with DSL on a Toshiba 4015CDS, and use a Dell 64 MB usb drive.
Here is the procedure I now use to restore:
First, when DSL boots up, I open a terminal, and sudo su
Then I
#mount /dev/sda1 -t ext2 /mnt/usbdrive
Now I can go to the menu, and click on File Restoration > Restore.
I have Mozilla Firebird 7, and it takes a short while for all of that to
restore.
Then I go to Menu > Enhance > Icons and when the icons are on the desktop, I have one for MozillaFirebird.
I use the opened terminal that I used to mount the usbdrive (above) to connect to the internet with wvdial.
That works very well, but I wonder if anyone has a quicker or easier way to do all that.
I'm not running DSL on a Hard Drive, I
use the Live CD, as I am not permitted by the owner to partition this Drive..     :laugh:

Posted by roberts on Jan. 24 2004,16:50
I am curious as to why you usb device has an ext2 partition?
The standard is vfat. If you change the partition back to vfat, then the liveCD system will work easier for you. You will be able from the first boot prompt to use:

knoppix restore        or even better if you have the memory
knoppix restore toram

If you like the icons,  uncomment the enhance line (delete the '#' )  in .xinitrc
Once that is backed up on the usb device, then you can boot into a fully restored and enhanced desktop. As for the dial-up there are some changes in the works there too.

Posted by Rapidweather on Jan. 24 2004,20:51
I'm going to try that. As I think this thru, I have to leave this machine running with DSL on it, and remove the stick I have, and get it formatted to vfat on another machine. Before I do that, I need to save my filetool.lst to a floppy, so I can copy it back to the newly formatted vfat memory stick. That filetool.lst has the instructions I'll need to make the first .gz backup file. The other backup plan is to copy the files to /dev/hda1, and I can get them back if need be. Currently,  my .gz file  is about 11 MB, as I have MozillaFirebird. If I reboot in  this machine, to Windows 98, I can do the format to vfat, but then I lose my DSL add-on's and configurations. I have a Windows XP box, but that probably cannot do a vfat format. XP will automatically recognize the memory stick without additional drivers, but Windows 98 can't, and needs a driver. I have that on this machine, but I gotta plan carefully,  of course.
I had heard about Knoppix Restore, and tried it, but it didn't work, apparently because of the ext2 fs.  :;):

Posted by Rapidweather on Jan. 24 2004,21:33
I couldn't get it to work. I copied my usb files to the windows partition for safekeeping while I reformatted the usb drive to vfat in Windows 98. Then, while I was booted into win98, I copied the files back to the memory stick.
Then I rebooted into DSL, and tried to mount the stick with both  of these lines:
#mount /dev/sda1 /mnt/usbdrive
that didn't work, said "it's not a valid block device"
so I tried:
#mount /dev/sda1 -t vfat /mnt/usbdrive
That didn't work either. So, in a terminal I went to /sbin, and
#mkfs /dev/sda1 (That puts an ext2 fs on the stick)
Then I copied my saved backup.tar.gz and filetool.lst from /dev/hda1,
and was then able to mount the drive and restore.
No idea why it would not work, but looking over my notes, I find that
the stick was used in a windows XP machine, and that I could not mount it
the first time around, so decided to format it to ext2 fs. That worked.
I tried anyway, the possibility to use knoppix restore at the boot prompt was
worth the effort, and no harm was done.   :laugh:

Posted by roberts on Jan. 25 2004,01:01
The system was designed to have a totally automated restore from sda1 and vfat. When you buy the device it normally sda1 and vfat. I could not automate writing to a device that is sda1 and ext2 because that would be more likely a real live scsi disk. I would have to prompt for the device and then that is another boot question that I am trying to avoid. I use my usb vfat device for a hands free restore of Mozilla, bash_profile, xsetup, monkey and its files, and all that.

My question for you, is that when you formatted it in Win98 did make a partition? Some devices can be formatted with no partition. It would then be mounted as /dev/sda  That still would not allow for total automation. You would have to make a partition and then format it. Like I said when you purchase a device they usually come pre-formatted and partitioned as sda1 and vfat.

Also, be aware that you should not use the usb device as a real hard drive. They have a limited write ability same as flash devices. Using it as a live drive will shorten its life considerably and failure will occur without warning. Then it is unuseable. This has been discussed on this board. Also there is an article about such in the Decemeber Linux Journal, "Floppies for the New Millennium" which discusses the proper use of usb devices. That is the other reason why the backup restore script is the way it is. It treats usb devices like a super big floppy.

Posted by Rapidweather on Jan. 31 2004,22:56
Sorry I did not get back in here sooner, I was busy putting DSL on other machines. Also, I'll have to admit I have been wandering around in this board, posting in several locations.
The Laptop was a Toshiba 4015CDS, and it came with Window 98, in one partition, vfat.
I had no idea that the Flash Drives were so delicate. I use mine to restore Mozilla Firebird, and other files and configs such as the fluxbox menu, my .blackboxrc and my web page files that I am working on.
For some strange reason (I don't understand) I could not get the USB drive to work if formatted as vfat, so being a linux fan, I decided to use /ext2, and that worked. I have just today used the drive to restore on a new install, to a two month old Dell, with all the bells and whistles. I had to use
#knoppix vga=normal
to get the LCD screen to respond.
That install is successful, except for the modem being a winmodem.
I can boot off the cd, or a floppy, and then restore Mozilla, etc. from the USB drive, after I mount it. The little drive seems to work on all machines with USB ports that I have encountered. (As long as I mount it first).
----
I have been working to revise the restore/backup script (filetool.sh) to allow a backup from a hard drive, but have found that to need a primary partition to work in, other than the one that /knoppix is in. I have usually copied my CDROM's /knoppix folder to the hard drive and run off a boot floppy, as I do not have cdrom drives on all machines. I use a backpack drive to do the copying. The one approach that I use is found in this menu:
< http://www.angelfire.com/ms/telegram/fluxbox_menu_2 >
That works, and I use it all the time. It only restores /MozillaFirebird, however. The actual script, if I can get it working, would be stored on a floppy, and upon first bootup of DSL, I mount the floppy, and then run the filetool.sh script.
#filetool.sh restore
I find that won't work on logical partitions, so I need to set it up on a box with at least two primary partitions. The menu example shows I  can partly restore from /dev/hdb1, too if a second hard drive is installed. I just make a /DSL folder there, and copy the /MozillaFirebird directory there, and my menu takes care of getting it back each time.. Problem is, I want to not have to restore with a floppy, to get my menu, and then get the /Mozilla Directory from the hard drive. I'd like to do a complete restore from the hard drive, my menu, and Moz, too. I do have a machine here that has three partitions, Windows, SuSE, and Linux Swap. I'll see what I can do to get a floppy with a filetool.sh and a filetool.lst on it (just those two ought to do it), and restore/backup to my /dev/hda2 partition. I suppose the root "/" in the SuSE filesystem will be where the backup.tar.gz will wind up, and perhaps the filetool.lst will have to be there also.  
I work with a lot of computers that do not have USB ports, or for that matter, CDrom drives.
----
Since the USB memory sticks have some durability issues, maybe setting up the restore on the hard drive is not such a bad idea. I think I heard that SuSE live does that too., but I only have an older SuSE that isn't a live cd. (I don't know how they do it)
-----
Some of the elements of my menu's would be useful if DSL had them on first
bootup, mainly, the Floppy and USB mounts. :D

Posted by roberts on Feb. 01 2004,02:58
Menus and such can of course be personalized. The idea behind filetool.lst is to provide the user the maximum capability for backing up and restoring their system, including changing system behavior of menus and startup programs. And so, that if you do desire, like you have, to customize your DSL.  Backing up to a hard drive partition is completed and will appear in an up comming release as well as  more enhancments to the capability of filetool.lst.
Posted by Rapidweather on Feb. 01 2004,05:19
I finally modified the filetool.sh script to save to my hard drive. It's here:
< http://www.angelfire.com/ms/telegram/filetool_Storage >
---
It's kinda rough around the edges, but works well enough for me.
I put it on a floppy, by itself, and to stay with the official DSL filename,
I rename it to filetool.sh
So, once I get DSL up and running, rather than use a restore floppy or
USB, I just mount this floppy, with filetool.sh, and:
#./filetool.sh restore
---
You can use any of it that is useful, of course. I made it to get me going on
this computer, so old that it has no USB ports. Now, I can restore MozillaFirebird with all the settings, etc. and my background image, menu,
.blackboxrc, local web page for Moz to start with, and my uploaded web page
files.
---
Also, I made a menu to go with this setup, and it's here:
< http://www.angelfire.com/ms/telegram/fluxbox_menu_4 >
---
Over the years, I have done a lot of stuff like this for various linux installs,
and I am glad to be able to post these files here for anyone to use, until the
next version of Damn Small Linux is ready for purchase! I'll be first in line to
get my CD! :D

Posted by Rapidweather on Feb. 01 2004,22:25
I cleaned up my filetool.sh a bit, and it's here:
< http://www.angelfire.com/ms/telegram/filetool_Storage >
The fluxbox menu to go with that is here:
< http://www.angelfire.com/ms/telegram/fluxbox_menu_3 >
---
If you are running off a /knoppix directory on your hard drive
(I do, and use a boot floppy)
You can copy the filetool.sh script to your /cdrom directory
(use Windows or other Linux OS to do that, DSL won't let you
copy to it's read-only file system at /cdrom)
When you get it copied, it's easier to restore from the hard drives
backup.tar.gz when you first boot up Damn Small Linux. Your
/cdrom directory is already mounted, that's where DSL finds
the /knoppix folder. In a terminal, just:
#sudo su
#cd /cdrom
#./filetool.sh restore
And the filetool.sh script (shown above as filetool_Storage)
in your /cdrom directory will quickly restore your system from the
backup.tar.gz it finds.
There is a menu to go with that here:
< http://www.angelfire.com/ms/telegram/fluxbox_menu_4 >
---
The filetool.lst and backup.tar.gz go in one partition, separate from the
one where /knoppix is located, and you may place filetool.sh in the same
partition with /knoppix. If you boot off a CD, then it's easier to have the
filetool.sh on a floppy, mount the floppy, and run filetool.sh. It will find your
partition where you have placed the filetool.lst and backup.tar.gz.
In the first go-around, before you have any backup.tar.gz, just place your
own filetool.lst in the root directory of the partition where you have filetool.sh
write your backup.tar.gz. When you run filetool.sh, your backup.tar.gz will be created.
#./filetool.sh backup
:;):

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