Renaming the partition. Is it posible ?


 
Thread Tools Search this Thread
Operating Systems SCO Renaming the partition. Is it posible ?
# 1  
Old 09-06-2003
Data 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 Smilie
# 2  
Old 09-08-2003
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....
# 3  
Old 09-08-2003
- 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 Smilie
# 4  
Old 09-08-2003
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.
# 5  
Old 09-09-2003
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
# 6  
Old 09-09-2003
cp -a preserves file system permissions.

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

Neo

Quote:
-a, --archive
Preserve as much as possible of the structure and attributes of the original files in
the copy (but do not preserve directory structure). Equivalent to -dpR.

-d, --no-dereference
Copy symbolic links as symbolic links rather than copying the files that they point
to, and preserve hard links between source files in the copies.

-f, --force
Remove existing destination files, and never prompt before doing so.

-i, --interactive
Prompt whether to overwrite existing regular destination files.

-l, --link
Make hard links instead of copies of non-directories.

-p, --preserve
Preserve the original files' owner, group, permissions, and timestamps.

-P, --parents
Form the name of each destination file by appending to the target directory a slash
and the specified name of the source file. The last argument given to cp must be the
name of an existing directory. For example, the command:
cp --parents a/b/c existing_dir
copies the file `a/b/c' to `existing_dir/a/b/c', creating any missing intermediate
directories.

-r Copy directories recursively, copying any non-directories and non-symbolic links
(that is, FIFOs and special files) as if they were regular files. This means trying
to read the data in each source file and writing it to the destination. Thus, with
this option, `cp' may well hang indefinitely reading a FIFO or /dev/tty. (This is a
bug. It means that you have to avoid -r and use -R if you don't know what is in the
tree you are copying. Opening an unknown device file, say a scanner, has unknown
effects on the hardware.)

-R, --recursive
Copy directories recursively, preserving non-directories (see -r just above).
# 7  
Old 09-09-2003
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Red Hat

Shrink LVM partition & create new Linux Primary partition

Hello All, I have a Red Hat Linux 5.9 Server installed with one hard disk & 2 Partitions created on it as follows, /boot - Linux Partition & another is LVM - One VG & under that 5-6 Logical volumes(var,opt,home etc). Here my requirement is to take out 1GB of space from LVM ( Any logical... (5 Replies)
Discussion started by: gr8_usk
5 Replies

2. Filesystems, Disks and Memory

Ask concept soft partition vs hard partition

Hi Experts I would like to know different between soft partition concept and hard partition concept on solaris. Here is little explanation between soft partition concept and hard partition concept on solaris. Soft Partition: 1TB total space available in storage in all mapped to the OS to... (2 Replies)
Discussion started by: edydsuranta
2 Replies

3. Shell Programming and Scripting

Renaming files

Hi i have to achieve the following i have files as xyz001.csv, xyz002.csv.......xyz0025.csv in a folder, i need to keep xyz001.csv as it is but want to remove the extra zero on filename from 10 say xyz0010 should be renamed to xyz010 xyz0025 should be renamed as xyz025 Note xyz... (8 Replies)
Discussion started by: mad_man12
8 Replies

4. Solaris

Partition overlaps another partition while creating new parition in solaris

hi all while formatting hard disk i am getting following error. Partition 1 ends at 266338338 It must be between 34 and 143374704. label error: EFI Labels do not support overlapping partitions Partition 8 overlaps partition 1. Warning: error writing EFI. Label failed. I have formatted the... (2 Replies)
Discussion started by: nikhil kasar
2 Replies

5. Shell Programming and Scripting

rsync from partition to partition fastest

Gentleman, Please move if I have chose the incorrect forum section. I am trying to move data that is not backed up from partition 1 to partition 2 on a SAN that has a GFS2 filesystem. Since the data is not backed up I am rsyncing this data and once verified I will delete from the source... (6 Replies)
Discussion started by: jaysunn
6 Replies

6. UNIX for Dummies Questions & Answers

renaming

Hi, I wrote a script to rename all files in a directory from uppercase to lowercase and changing spaces to underscores: #!/bin/sh echo "rename" read pathname cd $pathname for f in `ls "$pathname"` ; # listing directory for all files do echo... (1 Reply)
Discussion started by: the.noob
1 Replies

7. Solaris

Is clustring posible with OS zoning ?

Hi Gurus, Is it possible to create cluster environment with OS zoning ? If yes your further assistance will be highly appreciated. Thanks (1 Reply)
Discussion started by: kumarmani
1 Replies

8. UNIX for Dummies Questions & Answers

I've created a partition with GNU Parted, how do I mount the partition?

I've created a partition with GNU Parted, how do I mount the partition? The manual information at http://www.gnu.org/software/parted/manual/parted.html is good, but I am sure about how I mount the partition afterwards. Thanks, --Todd (1 Reply)
Discussion started by: jtp51
1 Replies

9. UNIX for Dummies Questions & Answers

understanding logical partition, physical partition

hi, 1) is logical partition the same as physical partition except that one is physical and the other is logical? 2) then it must a one to one ratio? (3 Replies)
Discussion started by: yls177
3 Replies
Login or Register to Ask a Question