Results 1 to 3 of 3
  1. #1
    1337/PWNR
    Programmer
    Emu's Avatar
    Join Date
    Aug 2010
    Location
    Virginia
    Posts
    161
    Points
    292
         User Info     Contact     Gamer ID
    Join Date
    Aug 2010
    Location
    Virginia
    Posts
    161
    Points
    292
    Gamer IDs

    Gamertag: SpidermaN EaT PSN ID: Shaq23Jordan

    Contact info:

    Youtube Channel: www.youtube.com/eemuohg Kik Username: ShaqGlizzy

    Default Readyboost linux equivalent

    So you all notice that windows has a fancy feature called ReadyBoost, to help speed up your computer through a usb. Well all readyboost is, is a swap partition that the computer uses for extra hardware space. Today I am going to show you how to create a readyboost equivalent pendrive.

    Copy this into an empty file and name it swapboost.sh (I take no credit for the code):
    Code:
    #!/bin/bash
    ###########
    # This is a bash version of Windows Vista's "ReadyBoost".  This doesn't have a
    # limitation on the hardware, or a minimum size requirement either.  I wrote
    # this kind of as a proof of concept that, yes, we could do this too.
    # Someone remind me again why in the *hell* anyone would want to pay for Vista?
    ###########
    
    if [[ $EUID -ne "0" ]]
    then
    	echo
    	echo "###########################################################"
    	echo "# You must be root / sudo(ubuntu) or su to run SwapBoost! #"
    	echo "###########################################################"
    	echo
    exit 1
    fi
    
    device=$(mount | tail -n1 | awk '{ print $1 }')
    mount=$(mount | tail -n1 | awk '{ print $3; }')
    freespace=$(df | tail -n1 | awk '{ print $4; }')
    
    function usage 
    {
    	echo "usage: $0 [OPTION] [DEVICE]"
    	echo "Create (or destroy) additional swap space on removable USB media"
    	echo
    	echo "-n, --new			create a new swap file a USB device"
    	echo
    	echo "-d, --delete			delete a USB swap file"
    	echo
    	echo "-h, --help			display this help information"
    	echo
    	echo "Example:"
    	echo " $0 -n"
    	echo "	The above will create a swap file on the latest USB"
    	echo " $0 -d"
    	echo "	The above will delete a swap file on the latest USB"
    	echo
    	echo "Originally created by Christer Edwards <[email protected]>"
    	echo "Released into the public domain"
    	echo
    }
    
    function destroy 
    {
    if [[ -f $mount/swap ]]
    then
    	swapoff $mount/swap
    	sleep 5
    	rm $mount/swap
    	sleep 5
    	umount $mount
    	echo
    	echo "swap file cleaned up. ($freespace) available for use."
    
    	else
    
    	echo
    	echo "You don't seem to have a swap file created on that device"
    	exit 1
    fi
    }
    
    function create 
    {
    if [[ -f $mount/swap ]]
    then
    	echo
    	echo "You already have swap created on that device."
    	echo
    	swapon $mount/swap
    	exit 1
    fi
    
    read -p "Would you like to create additional swap space on $device? ($mount) (y/n) " CREATE
    CREATE=$(echo $CREATE | tr 'A-Z' 'a-z')
    if [[ $CREATE == 'y' ]] || [[ $CREATE == 'yes' ]]
    then
    
    read -p "Would you like to use the maximum available space? ($freespace) (y/n)" SPACE
    	if [[ $SPACE == 'y' ]] || [[ $SPACE == 'yes' ]]
    	then
    	
    	dd if=/dev/zero of=$mount/swap bs=1K count=$freespace
    	sleep 5
    	mkswap $mount/swap
    	sleep 5
    	swapon $mount/swap
    	sleep 5
    
    	echo
    	echo "You now have $freespace additional space available as swap"
    
    	else
    
    	echo
    	echo "Planned for upcoming release.  Currently only full size accepted"
    
    	fi
    	exit 1
    
    else
    	echo
    	echo "Exiting SwapBoost"
    	exit 1
    fi
    }
    
    while getopts ":ndh" OPTS ; do
    	case $OPTS in
    		n)	create 	;;
    		d)	destroy	;;
    		\? | h)	usage	;;
    	esac
    done
    Next open terminal and navigate to the location where you saved the "swapboost.sh" file, and once in the directory type "./swapboost.sh -n" and input y for both of the next options to come.

    This will take sometime and will also speed computer up drastically, I also still suggest you get ram over doing this.
    If you want to create multiple pendrive's as a swapboost, just simply do one at a time, and then put them all back into the computer.

    0 Not allowed! Not allowed!

  2. #2
    Damn Daniel JesusLover666's Avatar
    Join Date
    Dec 2009
    Location
    /bin/laden
    Posts
    1,114
    Points
    2,360
         User Info     Contact     Gamer ID
    Join Date
    Dec 2009
    Location
    /bin/laden
    Posts
    1,114
    Points
    2,360

    Default

    Swap is a glorious thing.

    0 Not allowed! Not allowed!

  3. #3
    1337/PWNR
    Programmer
    Emu's Avatar
    Join Date
    Aug 2010
    Location
    Virginia
    Posts
    161
    Points
    292
         User Info     Contact     Gamer ID
    Join Date
    Aug 2010
    Location
    Virginia
    Posts
    161
    Points
    292
    Gamer IDs

    Gamertag: SpidermaN EaT PSN ID: Shaq23Jordan

    Contact info:

    Youtube Channel: www.youtube.com/eemuohg Kik Username: ShaqGlizzy

    Default

    Quote Originally Posted by JesusLover666 View Post
    Swap is a glorious thing.
    Tell me about it :P, use it all the time. Linux Mint and Ubuntu ftw on d drive and win7 on my c drive

    0 Not allowed! Not allowed!

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -10. The time now is 05:36 PM.
Powered by vBulletin®
Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.