Results 1 to 9 of 9

Thread: problem with updating usb drive

  1. #1
    Junior Member
    Join Date
    May 2007
    Posts
    40

    Default problem with updating usb drive

    Hi I got bt4 pf on my usb key and want to update the filesystem.sqashfs file.

    I do it this way>

    Boot up a systemrescue linux live cd.
    copy the filesytem.sqashfs to my hd name it filesytem_orginal.sqashfs
    Code:
    ./unsquashfs filesystem_orginal.squashfs
    
    rm -rf squashfs-root/etc/resolv.conf
    rm -rf squashfs-root/etc/hosts
    
    cp /etc/resolv.conf squashfs-root/etc/
    cp /etc/hosts squashfs-root/etc/
    cp /etc/fstab squashfs-root/etc/
    cp /etc/mtab squashfs-root/etc/
    
    mount --bind /dev/ squashfs-root/dev
    mount -t proc /proc squashfs-root/proc
    
    chroot squashfs-root
    
    apt-get update && apt-get install mc -y && apt-get dist-upgrade -y && apt-get clean -y && apt-get autoremove -y && cd pentest/exploits/fasttrack/ && ./fast-track.py -c 1 1 && ./fast-track.py -c 1 2
    exit
    
    rm -rf squashfs-root/etc/mtab
    rm -rf squashfs-root/etc/fstab
    
    umount squashfs-root/dev
    umount squashfs-root/proc
    I get a error that /dev is in use what to do?

    Then I do the following

    Code:
    chroot squashfs-root dpkg-query -W --showformat='${Package} ${Version}n' > filesystem.manifest
    
    for service in $services;do
    chroot squashfs-root update-rc.d -f $service remove
    done
    
    REMOVE='ubiquity casper live-initramfs user-setup discover xresprobe os-prober libdebian-installer4'
    for i in $REMOVE
    do
    sed -i "/${i}/d" filesystem.manifest-desktop
    done
    
    sed -i '/ubiquity/d' filesystem.manifest-desktop
    
    
    ./mksquashfs squashfs-root filesystem.squashfs
    
    cp filesystem.squashfs /root/2/casper/ && cp filesystem.manifest /root/2/casper && poweroff
    /root/2 is my penndrive and /root/1 my hdd

    When I boot my USB key I get errors reading block i/o and so on... I can start X and FF but it chashes somme times.

    Any hints how to update my usb key?

  2. #2
    Senior Member orange's Avatar
    Join Date
    Jan 2010
    Posts
    134

    Default

    Please read this OffSec blogpost by muts BackTrack Information Security Distribution » Customising BackTrack Live CD the Easy Way
    He explains how to update the ISO image using a chroot environment.

  3. #3
    Junior Member
    Join Date
    May 2007
    Posts
    40

    Default

    my file system in my booted BT is 1011M big so not big enough to copy the ISO to /root

    How do I make / biger? I got a 3,5gb Stick.

  4. #4
    Senior Member orange's Avatar
    Join Date
    Jan 2010
    Posts
    134

    Default

    You won't be able to do the chroot tutorial alone with the 3,5 GB stick (btw 3,5 GB? - never heard about such a stick size, just wondering). You'll definitely need external storage to follow the tutorial. Make the / bigger? I'm not sure if we're talking about the same thing as / is r/o without persistance anyway. Please setup a persistent casper-rw ext2 partition to gain r/w support to the filesystem.

  5. #5
    Junior Member
    Join Date
    May 2007
    Posts
    40

    Default

    Its a 4gb but only 3,75 to access. My /root home folder is 1gb and a bit big I want to make it biger. It is rw but by rebooting the data gone.

  6. #6
    Senior Member orange's Avatar
    Join Date
    Jan 2010
    Posts
    134

    Default

    Quote Originally Posted by *YAPP* View Post
    Its a 4gb but only 3,75 to access. My /root home folder is 1gb and a bit big I want to make it biger. It is rw but by rebooting the data gone.
    Sure, the FAT32 partition is generally r/w but the / filesystem is not - you wrote it on your own "all data gone upon reboot". For a persistent setup with r/w ext2/3 casper-rw partition, follow this video Backtrack 4 USB Install - Offensive Security

  7. #7
    Junior Member
    Join Date
    May 2007
    Posts
    40

    Default

    But I want to update my system. Thats all. And the system is rw even when the data do not stay.

  8. #8
    Senior Member orange's Avatar
    Join Date
    Jan 2010
    Posts
    134

    Default

    But I want to update my system. Thats all. And the system is rw even when the data do not stay.
    Ok, please listen carefully. 1st, your filesystem ISN'T r/w in its current state. it's a r/o mirror of the LiveCD and behaves just like that.

    That said you have two options:
    Either you build an updated ISO image that includes all the updates within a chroot and setup a new r/o LiveCD mirror on your USB flash device OR you setup a r/w aufs casper-rw persistent LiveUSB setup and update that one on-the-fly like an installed system with apt-get update && apt-get upgrade followed by apt-get dist-upgrade.

    To understand this better, please do some research what aufs actually is and you'll see it clearer - you need to understand: your current system is r/o by design and thus you're not able to update, i.e. the update won't survive a reboot.

  9. #9
    Junior Member
    Join Date
    May 2007
    Posts
    40

    Default

    I know that the the update won't survive a reboot. And I know the to options I just had the problem that it dont work for me to make a new filesystem.sqashfs but I try it again now with more space and a iso.

    I booted the iso and get a lot of errors>


    Buffer I/O error on device sr0, logical Block ######

    replace ##### with numbers

    Wich device is damaged the stick or my hdd?

Posting Permissions

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