LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 02-01-2003, 02:13 PM   #1
billkris
LQ Newbie
 
Registered: Jan 2003
Location: Burlington, ON Canada
Distribution: RH8
Posts: 26

Rep: Reputation: 15
Question How to move /usr????


I have installed a new larger 40 gig drive in my system. I now wish to move /usr, which currently resides on its own drive and almost full, to the new 40 gig drive so it will be a directory under /.

Bill
 
Old 02-01-2003, 02:52 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
this has been asked a number of times, one thread i found from searching is http://www.linuxquestions.org/questi...threadid=10636 should have everythign you need to know, if not just search again.
 
Old 02-01-2003, 03:06 PM   #3
billkris
LQ Newbie
 
Registered: Jan 2003
Location: Burlington, ON Canada
Distribution: RH8
Posts: 26

Original Poster
Rep: Reputation: 15
I guess I wasn't clear. in my first post. :-( /usr is currently residing on hdb. It is of course mounted as /usr. Now that I have a larger hda I want all the data from hdb moved to a directory called /usr on hda. I do not want to create another partition on hda. I have already run parted and enlarged / to take up the whole drive.

I want to eliminate the mount point /usr on hdb and remove the drive.

I'm new to this thing called linux so please excuse me if my terminology isn't exactly on.

Bill
 
Old 02-01-2003, 03:50 PM   #4
billkris
LQ Newbie
 
Registered: Jan 2003
Location: Burlington, ON Canada
Distribution: RH8
Posts: 26

Original Poster
Rep: Reputation: 15
I am assuming that I need to copy the contents of /usr to a temp directory, umount /usr and rename the temp dir to /usr. Only thing is I can't umount /usr, probably because files are in use -- it figures.

Any help is appreciated.

Bill
 
Old 02-01-2003, 11:31 PM   #5
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,800

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally posted by billkris
I am assuming that I need to copy the contents of /usr to a temp directory, umount /usr and rename the temp dir to /usr. Only thing is I can't umount /usr, probably because files are in use -- it figures.

Any help is appreciated.

Bill
You won't be able to do this while you're running at level 3 or 5. There are too many processes that fire up and have open files when you're running in multiuser mode to allow this. (Crimeny, lsof tells me that I have nearly 3000 resources in use under /usr!) You're going to have to take the system into single user mode to do this. Then the process that you described will work. Take a look at the info page for cpio, specifically the section on copying directory structures. You can practice the directory copy a few times (/usr -> /scratch) until you're comfortable with how it works. Then you can go to single user and do the real thing. Don't forget to tweak /etc/fstab after you're certain that /usr has been successfully copied, prevent any mounting of old partition back onto it's original mount point.

Good luck,

Rick
 
Old 02-02-2003, 01:50 PM   #6
billkris
LQ Newbie
 
Registered: Jan 2003
Location: Burlington, ON Canada
Distribution: RH8
Posts: 26

Original Poster
Rep: Reputation: 15
Thanks to everyone who replied.

For the record here's what I ended up doing...

telinit 1
umount /usr
mount /dev/hdb1 /mnt/usrtemp -- I created usrtemp first
cd /mnt /usrtemp
cp * -ar /usr -- this copies the symbolic links too

delete the /usr mount line from fstab
reboot

Easy when you know how.

Thanks again

Regards,
Bill Kristjanson
 
  


Reply



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
cannot using FTP move command to move files adrianmak Linux - Networking 4 04-21-2009 12:01 PM
can I move the /usr directory to another partition? walterbyrd Linux - Newbie 4 07-10-2005 07:24 PM
denied access to move files into /usr/src directory Larry O Linux - Newbie 4 01-17-2005 11:14 PM
Can't move program files to /usr/local/bin/ asburyguy Linux - Newbie 4 04-03-2004 11:53 AM
deleting old /usr directory after a move... jimieee Linux - General 2 12-26-2003 05:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

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