LinuxQuestions.org
Visit the LQ Articles and Editorials section
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-21-2006, 01:05 AM   #1
windycity_linux
Member
 
Registered: Mar 2006
Distribution: rhel 5
Posts: 74

Rep: Reputation: 15
Question moving file between partitions


how can i move files between partitions without impacting path associated with applications?

For example, lets say I have partition "x" which is full, I add another HD and want to move all files from partition "x" to partition "y". so how can this be done without changing the file path name in all applications.

I hope my question is clear. Many thanks for your help.
 
Old 08-21-2006, 01:24 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,986
Blog Entries: 11

Rep: Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880
Clear enough. Has been asked (and done) lots of times.

All you need to do is to create a temporary mount-point.
Mount the empty partition to that. Copy the directory
structure you want to move there. Umount it. Create an
/etc/fstab entry for the partition with the directory-name
of where the files live. Mount it. If it all works, umount
it again, delete the directories content on the old file-system
(leave the directory as such alone). Re-mount the directory/partition.


Cheers,
Tink
 
Old 08-21-2006, 01:31 AM   #3
zhangmaike
Member
 
Registered: Oct 2004
Distribution: Slackware
Posts: 376

Rep: Reputation: 31
A warning: if copying files from one partition to another, be sure to tell cp to preserve the permissions and ownership with the -a option.

I've been helping someone else fix the permissions of a copy-gone-wrong (he only specified -R, so all files and directories had default permissions and were owned by root).

It's much easier to remember -a than it is to fix the problems which result from forgetting it.
 
Old 08-21-2006, 01:11 PM   #4
windycity_linux
Member
 
Registered: Mar 2006
Distribution: rhel 5
Posts: 74

Original Poster
Rep: Reputation: 15
thanks all for your help
 
Old 08-21-2006, 02:32 PM   #5
ramram29
Member
 
Registered: Jul 2003
Location: Miami, Florida, USA
Distribution: Debian
Posts: 848
Blog Entries: 1

Rep: Reputation: 47
I would recommend using LVM logical volume manager. With it you can add several disks to one logical partition. It's also a very good alternative for adding space to an already filled disk. If you have hot-swappable disks you can do this without even restarting Linux.
 
Old 08-22-2006, 01:33 AM   #6
windycity_linux
Member
 
Registered: Mar 2006
Distribution: rhel 5
Posts: 74

Original Poster
Rep: Reputation: 15
I may be naive to say this but theoritically is it possible to do this with a soft link (ln -s) between the partition? Lets say I move the files to a new partition but create soft link between directories (old & new).
 
Old 08-22-2006, 01:43 AM   #7
zhangmaike
Member
 
Registered: Oct 2004
Distribution: Slackware
Posts: 376

Rep: Reputation: 31
Sure, it's possible. But it's WAY easier and more elegant to simply change the fstab entry. All you have to do is edit one line. Plus, if you ever move the files again, you won't have a handful of soft links to change. Just edit the same line.

Last edited by zhangmaike; 08-22-2006 at 01:45 AM.
 
Old 08-22-2006, 01:53 AM   #8
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,986
Blog Entries: 11

Rep: Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880
You'll need to have a mount-point for the new partition somewhere...

It *should* be possible, but it's "unclean" :}



Cheers,
Tink
 
  


Reply

Tags
file, partitions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
moving partitions toaster.waffle Linux - General 5 06-09-2005 12:15 AM
Resizing and moving partitions linmix Linux - Software 16 04-09-2005 09:08 AM
Moving Partitions. firedance Linux - General 1 01-08-2005 04:07 AM
moving partitions around Rocker Linux - General 7 02-02-2004 11:21 AM
Moving partitions nabil Linux - Software 5 07-17-2001 03:55 AM


All times are GMT -5. The time now is 12:32 PM.

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
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration