System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

how to rename a directory name while keep its contents unchanged.

SOLVED
Go to solution
hua_1
Frequent Advisor

how to rename a directory name while keep its contents unchanged.

how to rename a directory name while keep its contents unchanged.
tru64 GS160 v5.1a.
ADVFS FILE SYSTEM;
old file system mount on /ora1
new file system mount on /ora2;
the contents os /ora1 is dumped to /ora2;
then rename /ora1 to ora3, and rename /ora2 to /ora1;
how to rename the directory, keep its content unchanged.
3 REPLIES
Hein van den Heuvel
Honored Contributor
Solution

Re: how to rename a directory name while keep its contents unchanged.


Stop thinking renaming directories, start thinking mountpoints.

mkdir /old_ora1
umount /ora1
umount /ora2
mount old_domain#ora1 /old_ora1
mount new_domain#ora1 /ora1

or maybe

mount old_domain#ora2 /ora1

If thse suggestions make no sense, please reply with output from df /ora1 /ora2

hth,
Hein.
hua_1
Frequent Advisor

Re: how to rename a directory name while keep its contents unchanged.

can i use mv

mv ora1 ora3
mv ora2 ora1

is that ok?
Michael Schulte zur Sur
Honored Contributor

Re: how to rename a directory name while keep its contents unchanged.

Hi,

as Hein said, start thinking mountpoints. There is no need to rename a directory.
umount /ora1
mount old filesystem /ora3
umount /ora2
mount new filesystem /ora1
no content is changed.

greetings,

Michael