LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-04-2004, 03:04 PM   #1
chris8myshoe
LQ Newbie
 
Registered: Jan 2004
Location: Mountain View, CA
Distribution: SuSE and FreeBSD
Posts: 10

Rep: Reputation: 0
Moving existing directory to new partition?


I have a terrific SuSE Pro 9.0 system up and running with the following partitions (note: this question is not specific to SuSE):

/boot
/
/home
/usr/local

Assume this is "hda" for sake of argument.

I recently acquired a new 80G hard drive (hdb) that I will be using for shared data through Samba, httpd, ftpd, etc (each on their own partition hopefully). After plugging in the hardware and booting up, SuSE has come up with a nice configuration tool. I can use it or do things manually, depending on the answers to the more general questions I have here

Q1:
If I designate the mount point for a partition on the new drive as a directory that already exists on the old drive (/tmp for example), what will happen? I understand that /tmp currently lives in the / partition on my old drive.

Maybe this won't even be allowed.

Q2:
Maybe I could:
1. back up the data
2. remove the directory
3. add the mount point on the new drive/partition using SuSE's tool or modifying fstab.
4. Copy data back in.

Is this completely irrational? Is there an easier or better way?

Thanks for any help,
Chris
 
Old 02-04-2004, 03:23 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Just after you have created the partitions give them temporary mount points so that you can move the data - then once it has been moved you can change the mount points to the real locations.
 
Old 02-04-2004, 05:46 PM   #3
chris8myshoe
LQ Newbie
 
Registered: Jan 2004
Location: Mountain View, CA
Distribution: SuSE and FreeBSD
Posts: 10

Original Poster
Rep: Reputation: 0
Thank you. That worked great!

Note to others attempting this: I 'copied' the files over instead of 'moving' them (as root) which has left me with the tedious task of changing all the file owners and permissions back to what they were previously.

Also, this technique has proven more difficult with the /tmp directory. I used it as an example above but I actually did want to move /tmp to its own partition. I thinking I'm going to have to use Knoppix to do a Live CD boot, mount the drives, move the files over and modify fstab. Otherwise I can't move all the files, Linux doesn't like to run without a /tmp directory.
**
If anyone thinks this is a horribly bad idea please let me know. I'll try it out later.

Thanks,
Chris

Last edited by chris8myshoe; 02-04-2004 at 06:22 PM.
 
Old 02-04-2004, 08:48 PM   #4
chris8myshoe
LQ Newbie
 
Registered: Jan 2004
Location: Mountain View, CA
Distribution: SuSE and FreeBSD
Posts: 10

Original Poster
Rep: Reputation: 0
Success!

While "Live booted" from a Knoppix CD I moved everything from the old /tmp to the new partition (which had a temporary mount point) and then modified /etc/fstab so that the new partition would now be mounted as /tmp. Everything came back up perfectly.

I suppose I didn't need to boot up Knoppix, but I was too scared to move everything from the /tmp directory while linux was up and running and using it.

That's it.
 
  


Reply


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
moving files from windows partition to linux partition M O L8ingN2dust Linux - Newbie 11 01-08-2006 09:11 PM
how to check existing directory? izza_azhar Programming 1 04-15-2005 05:09 AM
moving hard drive with existing data to FC3 supra92 Linux - General 6 12-28-2004 03:09 PM
Moving existing users from one Linux server to... xmdms Linux - General 7 03-04-2004 05:41 PM
Mounting existing directory Mikhail_16 Linux - Newbie 2 11-17-2003 05:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:00 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