LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   rename filesystem (https://www.linuxquestions.org/questions/linux-newbie-8/rename-filesystem-820150/)

shibu_sp 07-16-2010 04:38 AM

rename filesystem
 
Hi

We are using RHEL 4 with following mount points.

Quote:

[root@localhost ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hdd3 4.9G 183M 4.4G 4% /
/dev/hdd1 289M 14M 261M 5% /boot
none 502M 0 502M 0% /dev/shm
/dev/hda2 7.7G 5.5G 1.9G 75% /home
/dev/hdd5 4.7G 43M 4.4G 1% /opt
/dev/hda1 20G 8.9G 9.5G 49% /oracle
/dev/hda3 4.9G 523M 4.1G 12% /tmp
/dev/hdd2 8.7G 6.2G 2.1G 75% /usr
/dev/hda6 1.2G 258M 864M 23% /var
[root@localhost ~]#

I want to change /oracle to /data.


Is it possible

Thanks in Advance

Shibu

druuna 07-16-2010 04:54 AM

Hi,

Check your /etc/fstab file for an entry that mounts /dev/hda1 on /oracle.

If it is there, do the following (as root):

1) stop any application(s) that uses /oracle
2) unmount /dev/hda1 (umount /dev/hda1)
3) rename your mountpoint to data (cd / ; mv oracle data
4) change the entry in the /etc/fstab file (change /oracle to /data)
5) mount the entry again (mount /dev/hda1)
- change hardcoded entries that point to /oracle to the new situation (/data)
6) start the stopped application(s) and check the logfiles.

If all went well hda1 is mounted on /data. Check with df -h

BTW: Are you sure there aren't any hardcoded entries that still point to /oracle?? You do need to make sure those are changed too!! If these changes need to be made do that between steps 5 and 6. Do check all the relevant logfiles after restarting the application(s) that use /data.

Make sure you have a working backup before you start doing this.

Hope this helps.

shibu_sp 07-16-2010 05:35 AM

Quote:

Originally Posted by druuna (Post 4035103)
Hi,

Check your /etc/fstab file for an entry that mounts /dev/hda1 on /oracle.

If it is there, do the following (as root):

1) stop any application(s) that uses /oracle
2) unmount /dev/hda1 (umount /dev/hda1)
3) rename your mountpoint to data (cd / ; mv oracle data
4) change the entry in the /etc/fstab file (change /oracle to /data)
5) mount the entry again (mount /dev/hda1)
- change hardcoded entries that point to /oracle to the new situation (/data)
6) start the stopped application(s) and check the logfiles.

If all went well hda1 is mounted on /data. Check with df -h

BTW: Are you sure there aren't any hardcoded entries that still point to /oracle?? You do need to make sure those are changed too!! If these changes need to be made do that between steps 5 and 6. Do check all the relevant logfiles after restarting the application(s) that use /data.

Make sure you have a working backup before you start doing this.

Hope this helps.


Hi

Thanks for UR reply


i can't mount the same point because the /dev/hda1 is missing. The error as follows...

1) stop any application(s) that uses /oracle


2) unmount /dev/hda1 (umount /dev/hda1)

[root@localhost /]# umount /dev/hda1


3) rename your mountpoint to data (cd / ; mv oracle data

[root@localhost /]# mv oracle data


4) change the entry in the /etc/fstab file (change /oracle to /data)

[root@localhost /]# vi /etc/fstab

Quote:

5) mount the entry again (mount /dev/hda1)

mount: can't find /dev/hda1 in /etc/fstab or /etc/mtab

[root@localhost /]# ls
bin dev initrd media opt sbin sys u01
boot etc lib misc proc selinux tftpboot usr
data home lost+found mnt root srv tmp var

[root@localhost data]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hdd3 4.9G 183M 4.4G 4% /
/dev/hdd1 289M 14M 261M 5% /boot
none 502M 0 502M 0% /dev/shm
/dev/hda2 7.7G 5.5G 1.9G 75% /home
/dev/hdd5 4.7G 43M 4.4G 1% /opt
/dev/hda3 4.9G 523M 4.1G 12% /tmp
/dev/hdd2 8.7G 6.2G 2.1G 75% /usr
/dev/hda6 1.2G 258M 864M 23% /var
[root@localhost data]#


--

Shibu

druuna 07-16-2010 05:40 AM

Hi,

Can you post the output of the following commands:

ls -l /dev/hda1
and
grep hda1 /etc/fstab

shibu_sp 07-16-2010 05:42 AM

Quote:

Originally Posted by druuna (Post 4035134)
Hi,

Can you post the output of the following commands:

ls -l /dev/hda1
and
grep hda1 /etc/fstab


hi

Quote:

[root@localhost oracle]# ls -l /dev/hda1
brw-rw---- 1 root disk 3, 1 Jul 16 2010 /dev/hda1
[root@localhost oracle]# grep hda1 /etc/fstab
[root@localhost oracle]#

Shibu

druuna 07-16-2010 05:52 AM

Hi,

You probably changed the fstab line wrongly (the grep command should have returned 1 line containing /dev/hda1). The ls command gives the correct/expected output.

Check the line you edited it should look like this (roughly): /dev/hda1 /data <more options> (the first 2 being relevant).

If that doesn't help: Please post your /etc/fstab file so we can have a look.

PS: I'm about to go home, so my next answer could take a while.

Hope this helps.

shibu_sp 07-16-2010 05:59 AM

Hi


Now Its Working


Used command

Quote:

mount -a
Thanks a Lot

Shibu

druuna 07-16-2010 08:37 AM

You're welcome :)


All times are GMT -5. The time now is 05:14 PM.