LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 07-07-2003, 10:42 PM   #1
rparkes
LQ Newbie
 
Registered: May 2003
Posts: 22

Rep: Reputation: 15
How to remount /usr/local


I wanted to put /usr/local on its own partition, so I can preserve it during re-installs.

I tried to do this the last time I installed RH9, but for some reason, it didn't work. I generally pre-partition the drives using PartitionMagic, allocate them during setup, but allow Disk Druid to then reformat the partitions.

I'd like to move /usr/local onto a new partition, but am not sure exactly how to go about this. I think I could mount the new partiton manually, move everything under /usr/local onto it, and then set a mount point in fstab, leaving the /usr/local folder itself on /usr as the mount point.

I'd appreciate any advice.
 
Old 07-07-2003, 10:51 PM   #2
rch
Member
 
Registered: Feb 2003
Location: Santa Clara,CA
Distribution: Mandriva
Posts: 909

Rep: Reputation: 48
Re: How to remount /usr/local

Quote:
Originally posted by rparkes
I wanted to put /usr/local on its own partition, so I can preserve it during re-installs.

I tried to do this the last time I installed RH9, but for some reason, it didn't work. I generally pre-partition the drives using PartitionMagic, allocate them during setup, but allow Disk Druid to then reformat the partitions.

I'd like to move /usr/local onto a new partition, but am not sure exactly how to go about this. I think I could mount the new partiton manually, move everything under /usr/local onto it, and then set a mount point in fstab, leaving the /usr/local folder itself on /usr as the mount point.

I'd appreciate any advice.
First find which partition it is
This can be done by
cat /proc/partitions
or
fdisk -l /dev/hda
I think you can find which partition it is and mount it.
Now for your query about /usr/local create a new partition through partition magic or fdisk whichever you prefer
Find the partition number of the partition through
fdisk -l /dev/hda
mount the partition and copy the content of /usr/local
now do
rm -rf /usr/local/*
now modify your fstab and mount the created partition on /usr/local
 
Old 07-08-2003, 02:20 AM   #3
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 50
My suggestion would be to do this a little more safely than rm -rf /usr/local/*. . .

If you are moving /usr/local to a new partition, mount that partition on /mnt (or wherever you want to, but it should not be /usr/local). do a:
Code:
tar cf - /usr/local | (cd /mnt; tar xvf -)
This copies all of your data under /usr/local to /mnt, preserving symlinks, etc.
Edit your fstab and change the /usr/local mount line so that the partition you have mounted under /mnt will mount under /usr/local.
reboot.
If this doesn't work, you have not lost any of your data. The rm command will cause a loss of data. If it does work, you can then remove that data from the old partition and go on. . .
It should work just fine, I do it all the time. =-}
 
Old 07-08-2003, 03:05 AM   #4
rparkes
LQ Newbie
 
Registered: May 2003
Posts: 22

Original Poster
Rep: Reputation: 15
Thanks to both of you. I followed the first answer (which was basically what I had in mind), because I didn't see the second one in time. Anyway, it all worked.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Starting httpd: /usr/sbin/httpd: symbol lookup error: /usr/local/lib/libaprutil-0.so. bijuhpd Linux - Newbie 1 10-30-2005 05:07 PM
/usr vs /usr/local on linuxpackages.net merchtemeagle Slackware 4 10-18-2005 03:09 PM
path in services wrong for clamav updated frm 0.75 to 0.80 usr/bin vs usr/local/bin Emmanuel_uk Linux - Newbie 3 04-22-2005 01:02 AM
Installing software, /usr/lib directory and /usr/local millertime Linux - Software 2 07-10-2004 09:21 AM
Difference between /usr/ and /usr/local/ ? MDesigner Linux - Newbie 7 07-04-2004 09:37 AM

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

All times are GMT -5. The time now is 04:46 PM.

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