I am using SCO unix, 9GB SCSI disk with three partition, usr1, usr2 & usr3. Now I am adding one more 9GB disk and partiotioned as usr4. My data files are in usr3. I want more space @ usr3 and tried to move all data to usr4. but the paths have been hard-cored in the program which i run. So date will be written only in usr3.
Now can I rename usr4 as usr3? If yes how can I do it. Please help ...
Im gonna take a wild leap that usr1, usr2 et al... are mount points...
If that is the case yes you can .... The mount point is only a pointer to the data...
You can umount usr3 and usr4 and then remount them as each other... Not sure of the exact syntax since I never used SCO, but it should be something like this:
umount /usr3
umount /usr4
mount <volume name> /usr4 ### old /usr3
mount <volume name> /usr3 ### old /usr4
Make sure that you modify your /etc/fstab, /etc/vfstab, or whatever it is called that contains your mount points and options, so your changes will be permanent and not revert back upon a reboot....
If you are doing this while the machine is online, you need to make sure no one is accessing the file system you're moving. My suggest would be you create 2 (secret) mount points, say /m1 and /m2. Unmount /usr3 and mount to /m1. Mount the new drive to /m2. You should already be superuser to do that. Now you need to move the data. My preference is tar. Don't use cp because it changes file permission.
# cd /m1
# tar cvf - . | ( cd /m2 ; tar xf - )
after that, umount /m2 and mount that to /usr3. Unmount /m1 and you can do whatever you want to do which that. Remove /m1 and /m2. Make the appropreate changes in /etc/vfstab (or equivelent on SCO) so /usr3 would mount to the new drive at startup.
But most of those options are not available on the SCO version of cp. The SCO version of cp does support -p as is required by posix. However it has no option that will preserve a symbolic link as a symbolic link during the copy. The command suggested by Toiday will preserve symbolic links.
The version of SCO that I tested on is an older version. uname -a reports:
SCO_SV scobox 3.2 2 i386
I don't have access to a more recent version of SCO, but I doubt that they have switched to the GNU cp.