Renaming the partition. Is it posible ?

Hi all,

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 ...

Thanks in advance.

Ravi :confused:

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....

  • make sure that no one is using /usr3 files. Might be good to do this in single user mode if you have lots of users.

-unmount /usr3 and mount the new, big partition as /usr3

-mount the old /usr3 partition (anywhere)

-copy the files from the old /usr3 (you just mounted) to the new /usr3 (make sure you copy and preserve permissions and ownership).

Thats about it :slight_smile:

yea, sorry forgot to mention that little bit...

If users are on a filesystem, use fuser to find out who is on them and see if they can get out of it.

I agree that single user mode is the best way.. but if you can do it online that is much quicker if you can get users off for a 30 mins.

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.

Toiday

cp -a preserves file system permissions.

(we later found out NOT on SCO... see below)

Neo

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.

OK, in that case, tar would be a better choice. I would have guessed that SCO supported cp -a .

Thanks for checking. Neo