cleandrive8 as part of script

Help
2012-02-15
2012-09-10
  • hipsterdoofus
    hipsterdoofus
    2012-02-15

    Dumb question here as usual :-) I have made lots of submenus for particular
    images I have. In my backup menu script, I'd like to automatically run the
    clean drive script. I saw you had that script under /bin - but how would I
    call it with the appropriate drive info? For instance, I already know I want
    to clear /dev/sda2.

     
  • The partition needs to be mounted and one then makes that the current
    directory.

    Example 1: Clear the /boot partition on my running systems.

    cd /boot

    /cleandrive8

    cd /

    cleandrive8 script is in the root of system.

    Example 2: Clear unmount partition using g4l cd or disk.

    mount /dev/sda2 /mnt/local

    cd /mnt/local

    cleandrive8

    cd /

    umount /mnt/local

    Finally, there is a clendrive8.dialog script that lets one select the
    partition to be cleaned, and then does the mounting and cleaning and
    unmounting. It also will support Fat32 partitions. Not for partitions that are
    already mounted thou.

     
  • hipsterdoofus
    hipsterdoofus
    2012-02-16

    Thanks, had previously been doing this process using CCleaner in Windows, but
    much easier to use the cleandrive8 script to do it as part of my image backup
    process.

     
  • If you do a disk image, one must clear out the space to reduce the image size.

    I have a script on my systems that clears out all the partitions.

    Even have it turn off the swap partition, and zero it out, and rebuild it
    after.

    With windows one can do an ntfsclone backup, that doesn't backup unused space,
    and is thus much faster.

    Sometime ago, I had done testing and a 40GB windows partition that was about
    25% used would take about 40 minutes to do a raw image, but only about 10
    minutes to do an ntfsclone image. Raw image was a tiny bit larger.

    In my classroom, I have a ntfsclone image of the windows partition stored on
    an extra partition, and have a restore option as part of the boot process, so
    one can restore the windows in about 12 minutes. About a 12GB image file for
    the 40GB partition.

    Note. The ntfsclone partition image only contains the partition, so one needs
    to backup the mbr and partition table as well.

    Also, note with windows. I usually mount the windows partition before doing a
    backup, and remove the pagefile to make the backup smaller as well.