Hi Jeff,
Firstly, I'm guessing the data drive is portable due to the fact that it mounted under /media. I think the name 'disk' is given to unlabelled media so it could possibly be mounted under a different mount point if you had something else plugged in first. To avoid this possibility you could label it and it would then get mounted under /media/'label'. (man e2label)
As far as installing applications goes, it depends on how they're packaged, eg. an rpm will have its install paths already defined
If it comes as a tarball (tar.gz, .tgz) and has a make file it may support the '--prefix' option which will allow you to install it wherever you like.
Replacing dirs with symlinks
*Please note that you may get some 'unexpected' results if the drive is not available at login, going the symlink route is possible but personally I wouldn't do it
Copy existing data in the Desktop, Documents, Videos, Pictures directories under your /home... directory, ensure the permissions match then delete the ones under /home... and replace with symlinks to /media/'label'/Desktop etc.
This is not tested but should give you an idea of the process:
Code:
#!/bin/bash
NAME=$(id -un)
if [ -z $NAME ]
then
echo "Could not obtain user name, exiting"
exit
fi
for dir in Desktop, Documents, Videos, Pictures
do
echo "Moving $dir"
# Copy existing data
rsync -avz /home/${NAME}/$dir /media/disk/$dir
if [ $? -eq 0 ]
then
# Remove directory
rm -rf /home/${NAME}/$dir
# Replace with symlink
ln -s /media/disk/$dir /home/${NAME}/$dir
else
echo "Move of $dir failed"
fi
done
cheers,
kbp