Creating an usb-stick of the current system

Discussion in 'Linux' started by Monkey, Jul 23, 2008.

  1. Monkey

    rbil

    Joined:
    Aug 14, 2008
    Messages:
    730
    Likes Received:
    0
    Location:
    The Wet Coast, Canada
    If you want to get back to Linpus on your system, just use the regular Acer Recovery process. It will overwrite EVERYTHING on your SSD drive, including the MBR. Then you're back to running Linpus. No need for any of the stuff you're proposing.

    Cheers.
     
    rbil, Oct 10, 2008
    #61
  2. Monkey

    callaghan

    Joined:
    Sep 27, 2008
    Messages:
    18
    Likes Received:
    0
    I have tried to use the regular Acer Recovery process yet!

    Using 2 different usk stich (2Gb , FAT32) and using an external usb DVD....

    Always the same result: the setup loads fine, but when i press "next" in order to "recover data", the system crash...

    I the regular Acer process will overwrite everything (even if the actual partinining is different), why doesn't work????

    Thanks,
    A.
     
    callaghan, Oct 10, 2008
    #62
  3. Monkey

    rbil

    Joined:
    Aug 14, 2008
    Messages:
    730
    Likes Received:
    0
    Location:
    The Wet Coast, Canada
    Preparing the partitions prior to trying Acer's Recovery process won't help you. There's some other problem. More than likely, you haven't prepared the SD card properly. Maybe try a different card? I'm sorry, but I've never used the Acer Recovery system. I backup my system, so if something should go wrong, I can simply restore my backup and I'm back to where I was at the last backup.

    Cheers.
     
    rbil, Oct 10, 2008
    #63
  4. Monkey

    jamesb72

    Joined:
    Oct 3, 2008
    Messages:
    44
    Likes Received:
    0
    I created a 4Gb USB using 4gbrestoreimage.gz, however this never finishes the dd command, after 1 hour I ctr-C to interrupt, and the usb seems complete, and I have run a backup OK - could this be because my 4GB USB card is slightly too small ? I imagine they vary by a few bytes in size ??

    I ran the commands manually (mount/dd | gzip...) to create backup which came out as 1.2Gb file ? I have removed unnecessary bits, so SSD shows 3.7Gb free of 6.4Gb and I have run the dd if=/dev/zero of=zero.bin trick, but this still seems very small ?

    Last question, how do I reformat this 4Gb keydrive back to FAT32 for normal use ? My WIndows PC can only see the first KINGSTON partition, so I cannot reformat the whole drive back to 4Gb this way ??
     
    jamesb72, Oct 14, 2008
    #64
  5. Monkey

    rbil

    Joined:
    Aug 14, 2008
    Messages:
    730
    Likes Received:
    0
    Location:
    The Wet Coast, Canada
    Since dd is doing a bit-by-bit copy, I wouldn't expect a problem if the drive is a little smaller than the original the image was created from, because the second partition should still be a FAT32 partition. It's quite possible that "burning" to a smaller drive doesn't ever finish and CTRL-C needs to be used just as you've done.

    When you say you ran a backup OK, then go on to say ./backup not found when you actually try to use the system for backing up, I'm confused. Which is it? You could or couldn't backup when booting the key you made?

    Could you please do a:

    head -12 backup

    ... so I can see which version of the backup script you installed? Or, tell me whether the backup script you're using presents 3 options or 8 options?

    From a boot of the flash key or from within Linpus?

    Yes, it does look small. I've not yet zeroed out my SSD drive, so not sure what the resulting size of the backup would look like? As my system sits now, df -h shows me with 3.2GB free and my backup files total about 2.2GB. Acer could have left much non-zero bits on the drive when they created their first image that ended up on these SSD drives.

    You could use qtparted (see blog, Step 4 for how to install) to remove the larger FAT32 partition, then the smaller FAT32 partition, then create a new FAT32 partition that uses the entire drive. Or, you could zero out the whole flash key if Windows can then format a raw flash key as FAT32***. Sorry, I don't use Windows, so don't know what it's capable of doing?

    *** something like:

    dd if=/dev/zero of=/dev/sdb bs=1M

    but this will be slower than simply using qtparted as described above - and like I said, not sure how Windows will handle the drive after it is zeroed out.


    Cheers.
     
    rbil, Oct 14, 2008
    #65
  6. Monkey

    jamesb72

    Joined:
    Oct 3, 2008
    Messages:
    44
    Likes Received:
    0
    I've checked the USB drive with qtparted and there is still 76Mb free space at the end, so I'm not sure why the dd command hung - it shouldn't have run out of space - USB key is a 4Gb transcend super micro usb key, which probably isn't very fast, and has no indicator light, but the format of 2nd partition seems fine and usable, so this doesn't seem to be a problem.

    I used top to check progress of creating the keydrive from 4gbrestoreimage.gz, and even after the hour dd was still running 8% cpu, so it thought it was doing something, even though no SSD activity was shown by light

    I booted from the flash drive into systemrestorecd unix running from usb fine, but when I cd /mnt/cdrom then try ./backup I couldn't run the backup script (original version of script with only 3 options backup/restore/quit), but I ran the backup commands manually to do a backup:

    mount -t auto /dev/sdb2 /mnt/windows
    dd if=/dev/sda bs=4k | gzip > /mnt/windows/Backup/hdimage.gz

    This seemed to work perfectly, took about 10 minutes and produced the 1.2Gb hdimage.gz file.

    Thanks, I played with qtparted after posting so am happy I could do this if required.
     
    jamesb72, Oct 15, 2008
    #66
  7. Monkey

    rbil

    Joined:
    Aug 14, 2008
    Messages:
    730
    Likes Received:
    0
    Location:
    The Wet Coast, Canada
    jamesb72,

    I really can't imagine what the problem is. It should certainly see the backup script. Possibly the problems with the original creation of the flash key has something to do with this problem, as this has worked on everything from 4GB, 8GB and external hard drives.

    Did you do a md5sum on the image you downloaded?

    I'd try "burning" the flash key again and see whether that completes successfully, then try the process again. If that fails, I'd suspect some problem with the flash key you're using.

    Cheers.
     
    rbil, Oct 15, 2008
    #67
  8. Monkey

    jamesb72

    Joined:
    Oct 3, 2008
    Messages:
    44
    Likes Received:
    0
    Thanks rbil, I checked md5sum on downloaded image and it was correct, will try with another keydrive.

    UPDATE:

    I tried this again with a sandisk 4Gb keydrive, and dd completes fine, so hang was something to do with transcend mini usb flash drive.

    Also I figured out why backup script won't run - I cut/pasted the contents on my work XP PC, so the file had mangled line feeds with ^M chars.

    [user@localhost KINGSTON]$ ./backup.sh
    bash: ./backup.sh: /bin/bash^M: bad interpreter: No such file or directory

    I couldn't get vim to fix this with :%s/^V^M// so had to use sed, but end result is this works fine.

    hdimage.gz is 1.8Mb which seems about right.
     
    jamesb72, Oct 15, 2008
    #68
  9. Monkey

    jinx022

    Joined:
    Oct 2, 2008
    Messages:
    76
    Likes Received:
    0
    jinx022, Oct 16, 2008
    #69
  10. Monkey

    jamesb72

    Joined:
    Oct 3, 2008
    Messages:
    44
    Likes Received:
    0
    Another update, my recovery USB came in handy yesterday.

    I was messing about and thought it would be a good idea to have merged filesystem as my home dir, so used

    DONT TRY THIS $ sudo usermod -d /mnt/home user

    When I rebooted, desktop fails to come up, I just get blank X background with mouse cursor, but no menus, and no way to recover this !! I assume aufs doesn't create merged filesystem till later in bootup so this isn't usable as home dir ?

    I booted off the recovery USB, and mounted SSD using
    $ mount -t auto /dev/sda1 /mnt/windows

    This allowed me to edit /mnt/windows/etc/passwd to undo this and rebooted fine.
     
    jamesb72, Oct 18, 2008
    #70
  11. Monkey

    Poelsa

    Joined:
    Oct 8, 2008
    Messages:
    10
    Likes Received:
    0
    Thank you rbil, people like you makes it a lot easier coming from the mac-world to the AAO.

    I read through this thread from the beginning, so actually i first created my own usb-stick as instructed here and made a backup to it. I then found the script so now i'm trying that too just for the kicks of it(I think I might be having some geek-tendencies when i do stuff like that just for fun when i should be preparing for an exam). Right now the text from the screen has disappeared, but the ssd-led and the usb-led are blinking, so i guess it still works :)
     
    Poelsa, Oct 19, 2008
    #71
  12. Monkey

    rbil

    Joined:
    Aug 14, 2008
    Messages:
    730
    Likes Received:
    0
    Location:
    The Wet Coast, Canada
    Just screen-saver ... hit Backspace key to bring the screen back when it does this through a long backup/restore.

    Cheers.
     
    rbil, Oct 19, 2008
    #72
  13. Monkey

    rbil

    Joined:
    Aug 14, 2008
    Messages:
    730
    Likes Received:
    0
    Location:
    The Wet Coast, Canada
    Sorry, but I had to remove the original blog that contained downloads, etc. Please visit my current blog if you are interested in a backup/restore solution for the Aspire One.

    Cheers.
     
    rbil, Oct 21, 2008
    #73
  14. Monkey

    sincitylife

    Joined:
    Oct 17, 2008
    Messages:
    19
    Likes Received:
    0
    Location:
    las vegas
    ;) How I backed up my hard drive partition onto a USB stick after tweaking Linpus just right:

    :geek: I used Featherlinux Live USB. Just read the wiki to learn how to make a bootable usb key with it. Featherlinux contains a program called PartImage. I used partimage to create a backup my entire Linpus partition that's saved onto my bootable featherlinux usb key. Just download the featherlinux zip file and untar(checkmark "full path" of the directory when you untar) into the usb key...then go into your system terminal and type sudo syslinux /dev/sdb1 to make your featherlinux usb key bootable. restart your acer and hit F12; select your usb key to boot.
    :mrgreen: It takes about 45minutes to complete the process.
    :idea: Note: when using partimage...make sure to save your backup file to sda1...not sdb1 or it won't work. For some reason when i boot my featherlinux to vesa mode...it changes my usb key address from sdb1 to sda1(this is temporary-only when you live usb boot into featherlinux). I also had to sudo yum update syslinux to the latest version before I could make featherlinux bootable from my usb key....linpus's version of syslinux is obsolete.
    :geek: I backed it onto an HP 8gb usb thumbdrive...but 4gigs is all you really need. Partimage allow you to compress your backup...i compressed mine from 3.7gb down to 1.3gig backup file.
     
    sincitylife, Oct 21, 2008
    #74
  15. Monkey

    ensoph

    Joined:
    Jul 26, 2008
    Messages:
    38
    Likes Received:
    0
    hi rbil, i was trying to download the 4gbrestoreimage.gz file you created for the bootable flash key, but it seems to have been taken down or something. would it be possible for you to reupload it there or somewhere else? it'd be great! (if not, could someone else upload it to a free server?) thanks for your great work.
     
    ensoph, Oct 23, 2008
    #75
  16. Monkey

    rbil

    Joined:
    Aug 14, 2008
    Messages:
    730
    Likes Received:
    0
    Location:
    The Wet Coast, Canada
    Sorry, but trying to maintain that image file with the SLOW uploads to that free site ended up just being too much of an effort. It takes me long enough to tweak things, test both backups and restores, create a new image, etc. and to have to upload to that site ended up being too much.

    I've now got a much improved system with an image that fits on a 8GB flash key, which makes more sense, considering the possible amount of space that can be taken up when imaging a 8GB SSD drive. This new image can be accessed now through here ...

    http://aaobackup.blogspot.com/2008/10/p ... 0-cad.html

    One commandline is all that is necessary for someone on an AAO to create the 8GB flash key.

    ... or conversely, I'll sell it pre-installed on a 8GB Kingston Flash Key.

    Cheers.
     
    rbil, Oct 23, 2008
    #76
  17. Monkey

    ensoph

    Joined:
    Jul 26, 2008
    Messages:
    38
    Likes Received:
    0
    got it. will the script you put together for the 4gb flash key still work with the 8gb one? if not, what needs to be tweaked? thx!
     
    ensoph, Oct 23, 2008
    #77
  18. Monkey

    nugroho2

    Joined:
    Oct 6, 2008
    Messages:
    50
    Likes Received:
    0
    I tweaked my AA1 for the last 10 full-days. Got crashed twice and have to reinstall from scratch. Had fwbackups backup-files, but could not restore it :(. So, I am glad to read this thread.
    So, I did the various steps needed. Buy 4 GB USB, do fdisk, parted, Gparted, install MBR as advised by various posts, reclaimed disk by filling /dev/sdb with zeros, and now: my 4 GB USB has only 3.7 GB unallocated on Gparted, and not regconised by parted (Error: Unable to open /dev/sdb - unrecognised disk label.) I have not partitioned this again. Can anyone help how I could reclaim the 250 - 300 MB allotted for boot partition?
    - This lost allocated space is not recognized by Gparted.
    - But cat /proc/partitions still recogcnise this as sdb - 3928064

    In short, I could not pass further than this point for doing the backup.
     
    nugroho2, Oct 25, 2008
    #78
  19. Monkey

    nugroho2

    Joined:
    Oct 6, 2008
    Messages:
    50
    Likes Received:
    0
    Some tips for those who wants to follow rbil's method (dd ... etc):

    1. If you tweak the AA1 a lot, a lot of files will be installed. You will need more than just 4 GB USB; I need 4.2 GB. The zeroing of unused space does not help much, unless you have a code for defragmenting the disk; I don't have that. Get the 8 GB one. I myself managed to backup my files to an external hard disk, formatted as ext2.
    2. Block size of 4K or 50K or 100K only differ a few seconds in terms of time needed.
    3. It is very difficult to copy files between Linux AA1's and Windows system (my other computer with CDRW). Often the image files could not be read by the Windows system. But once you can manage to copy them, all will be easy.
    4. If you don't have the time and the stamina to try to make the USB yourself, buying rbil's USB will be much easier. :lol: I am not connected to rbil in anyway, but the process IS very difficult. At least for me.
    5. For those who want to use fwbackups, remember to save the backup set files along with the backed up files, otherwise the backup is useless. I experienced this once, and had to spend 4 days installing everything from scratch.
     
    nugroho2, Nov 1, 2008
    #79
  20. Monkey

    cbegg50

    Joined:
    Nov 27, 2008
    Messages:
    1
    Likes Received:
    0
    I tried using the dd with gzip command only to find it dropped out after 4.0Gb saying the file was too big. Do I presume dd without gzip will have no such problems as it will create individual files?

    Cheers and thanks for a wonderful forum
    Colin Begg
    A110 (Blue) Linux 512Mb RAM 8Gb SSD, trying 16Gb SD card
     
    cbegg50, Nov 28, 2008
    #80
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.