LinuxQuestions.org
Have you listened to LQ Radio?
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Newbie
User Name
Password
Linux - Newbie This 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

Tags used in this thread
Popular LQ Tags , ,

Reply
 
Thread Tools
Old 08-24-2009, 09:53 AM   #1
Jeff91
Member
 
Registered: Jan 2009
Location: Alsip, IL
Distribution: Ubuntu
Posts: 126
Thanked: 0
A few Questions about Data Partitions


[Log in to get rid of this advertisement]
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
linux Jeff91 is offline  
Tag This Post , ,
Reply With Quote
Old 08-24-2009, 10:31 AM   #2
firewiz87
Member
 
Registered: Jan 2006
Distribution: OpenSUSE 11.1
Posts: 183
Thanked: 10
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
windows_xp_2003 firewiz87 is offline     Reply With Quote
Thanked by:
Old 08-24-2009, 10:32 AM   #3
kbp
Member
 
Registered: Aug 2009
Posts: 482
Thanked: 43
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
linuxfedora kbp is offline     Reply With Quote
Old 08-24-2009, 10:47 AM   #4
Jeff91
Member
 
Registered: Jan 2009
Location: Alsip, IL
Distribution: Ubuntu
Posts: 126
Thanked: 0

Original Poster
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
linux Jeff91 is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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 02:10 AM
Does resising partitions erase data? Jorophose Linux - General 5 01-08-2007 01:57 AM
Moving data between Partitions crofty13 Linux - Software 3 07-14-2006 09:43 PM
Join Partitions Without losing data aeruzcar Linux - General 0 06-29-2004 12:54 AM
How to recover data on lost partitions Red Squirrel General 12 03-20-2004 01:37 PM


All times are GMT -5. The time now is 04:16 AM.

Main Menu
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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration