On Wed, Jan 6, 2010 at 9:04 AM, Dale Slaughter wrote:
>> Question 2.  I then want to rename the /usr directory to /usrold , and
>> then rename /usrnew to /usr, and then I will update fstab and reboot. 
>> What is the correct way to do the two renames above - is it the "mv"
>> command, and if so what switches would I want to use so I copy all files
>> types and preserve dates, permissions, etc.?

and on Wed, Jan 6, 2010 at 11:20, Scott Rohling replied:
>2)  Just use 'mv' ..    mv /usr /usrold          mv /usrnew /usr   ..
>it's just a rename..

I don't think that quite does what Dale wants, because it will move the files 
within /usr to /usrold on the root filesystem.  What really needs to be done 
here is to remount the filesystems on the correct mount-points, not to rename 
file paths.  So the right way to do it is with mount:

        mkdir /usrold
        mount --move /usr /usrold && mount --move /usrnew /usr

The --move option atomically moves the filesystem, so there is no point at 
which it is unmounted.  Open files on that filesystem will remain open, so it 
is OK to do the above when the filesystem is "busy" and is not unmountable.  
However, there is still a small window between the two mount commands in which 
a process might try to access a file within /usr and fail because it does not 
exist.  If you have a lot of programs starting frequently, this is likely to 
be a problem.  If you have a set of stable apps running but not execing new 
programs, you should be OK.  On a production system, it would be best to 
bring it down to single-user mode first.
        - MacK.
-----
Edmund R. MacKenty
Software Architect
Rocket Software
275 Grove Street · Newton, MA 02466-2272 · USA
Tel: +1.617.614.4321
Email: [email protected]
Web: www.rocketsoftware.com  

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

Reply via email to