LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-24-2009, 08:53 AM   #1
Jeff91
Bodhi Developer
 
Registered: Jan 2009
Location: Bloomington, IL
Distribution: Bodhi
Posts: 379

Rep: Reputation: 68
A few Questions about Data Partitions


I have a 190gig data partition on my hard drive and I was wondering a few things.

First off when it mounted it auto mounted to the point /media/disk - from this point forward will it continue to mount to that same point or do I have to do something special for it to do this?

Second, can I install applications to a data partition instead of /home? My Cedega folder gets rather large when I have all my games in it and I would much prefer them to reside on the larger partition.

Lastly, I have a Desktop, Documents, Videos, Pictures, ect folders on my data partition. How would I go about creating a 'symlink' between these folders and the corresponding folder in my /home directory?

Thanks for taking the time to read this, any help/pointers would be great

~Jeff
 
Old 08-24-2009, 09:31 AM   #2
firewiz87
Member
 
Registered: Jan 2006
Distribution: OpenSUSE 11.2, OpenSUSE 11.3,Arch
Posts: 240

Rep: Reputation: 37
Quote:
Originally Posted by Jeff91 View Post
First off when it mounted it auto mounted to the point /media/disk - from this point forward will it continue to mount to that same point or do I have to do something special for it to do this?
Mounting using the mount command is temporary.... to make it automount on boot make an entry in /etc/fstab

Quote:
Originally Posted by Jeff91 View Post
Second, can I install applications to a data partition instead of /home? My Cedega folder gets rather large when I have all my games in it and I would much prefer them to reside on the larger partition.
Yes you can.... just mount the data partition somewhere n then change the settings during install to point there.... instruction to change the installation path can be found in the application's readme (usually)

Quote:
Originally Posted by Jeff91 View Post
Lastly, I have a Desktop, Documents, Videos, Pictures, ect folders on my data partition. How would I go about creating a 'symlink' between these folders and the corresponding folder in my /home directory?
Code:
ln -s /path/to/docs /home/jeff/link
 
Old 08-24-2009, 09:32 AM   #3
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
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
 
Old 08-24-2009, 09:47 AM   #4
Jeff91
Bodhi Developer
 
Registered: Jan 2009
Location: Bloomington, IL
Distribution: Bodhi
Posts: 379

Original Poster
Rep: Reputation: 68
Actually the 190gig drive is an internal drive - I am multi booting my laptop so I want to share it between the different distros (Same docs and files ect) So it will always be "attached"

I'll give setting up fstab a go and will post back if I have any issues with it.

~Jeff
 
  


Reply

Tags
data, multiboot, partition



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
will 2 /home partitions mirror data? len Linux - Software 19 06-18-2007 01:10 AM
Does resising partitions erase data? Jorophose Linux - General 5 01-08-2007 12:57 AM
Moving data between Partitions crofty13 Linux - Software 3 07-14-2006 08:43 PM
Join Partitions Without losing data aeruzcar Linux - General 0 06-28-2004 11:54 PM
How to recover data on lost partitions Red Squirrel General 12 03-20-2004 12:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration