Operating System - Linux
1827807 Members
2882 Online
109969 Solutions
New Discussion

Re: change mounted points

 
SOLVED
Go to solution
file system
Frequent Advisor

change mounted points

Hi
after changed mounted point
I cannot reboot the system
I have mounted points like this.
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/ida/c0d0p6 2064160 123576 1835732 7% /
/dev/ida/c0d0p1 98747 14918 78730 16% /boot
/dev/ida/c0d0p8 22730156 32888 21542632 1% /data
/dev/ida/c0d0p7 991864 16636 924844 2% /home
none 1950968 0 1950968 0% /dev/shm
/dev/ida/c0d0p3 2923548 1407244 1367792 51% /usr
/dev/ida/c0d0p5 2064160 68624 1890684 4% /var

I want to change mount point /data to /data5.
after modifying /etc/fstab, /data to /data5

it can not reboot.
help
what should I modify other files?
9 REPLIES 9
Sivakumar TS
Honored Contributor

Re: change mounted points


Hi,


No other files need to modified for changing mount point.

Make sure the /data5 directory exists ( the ne mount point)

reboot the server using
#shutdown -y 0
#reboot

It should work.

With Regards,

Siva.
Nothing is Impossible !
Ivan Ferreira
Honored Contributor

Re: change mounted points

Where do you have the problem? What is the error when you reboot?

Ensure that no extra characters, space, returns are in the /etc/fstab file.

Do don't have to modify any other file.

Ensure that the new mount point exists.

Can you post your fstab configuration?
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Delrish
Trusted Contributor

Re: change mounted points

You forgot to creat /data5 directory.
fstab can mount a device in an exsited directory. It cannot create /data5. you have to create it with "mkdir /data5" and after that you can mount a device in it.Now if you reboot your server (after creating directory by yourself), you will not get any error.


Alireza
file system
Frequent Advisor

Re: change mounted points

I did as you notice me that do not edit any other files except /etc/fstab
so. I did but Some error loged like this when it boots.

'Could not find matching file system :LABEL=/data5'

what is it? what other problem?

I post fstab file first before changing mount point

Before
[root@ecfarm2 root]# cat /etc/fstab
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
LABEL=/data /data ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
LABEL=/home /home ext3 defaults 1 2
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
LABEL=/usr /usr ext3 defaults 1 2
LABEL=/var /var ext3 defaults 1 2
/dev/ida/c0d0p2 swap swap defaults 0 0
/dev/cdrom /mnt/cdrom udf,iso9660 noauto,owner,kudzu,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0

=================
After changed mounted point /data to /data5.
[root@ecfarm2 root]# cat /etc/fstab
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
LABEL=/data5 /data5 ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
LABEL=/home /home ext3 defaults 1 2
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
LABEL=/usr /usr ext3 defaults 1 2
LABEL=/var /var ext3 defaults 1 2
/dev/ida/c0d0p2 swap swap defaults 0 0
/dev/cdrom /mnt/cdrom udf,iso9660 noauto,owner,kudzu,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0

I only edit line LABEL=/data /data ext3 defaults 1 2
to
LABEL=/data5 /data5 ext3 defaults 1 2

what's the problem
file system
Frequent Advisor

Re: change mounted points

and I made /data5 dir.

please.

Re: change mounted points

restart the nfs service...
you can do this by using the following command

Service nfs restart

or

enable this service in the setup and then restart the computer.
Andrew Bruce
Valued Contributor
Solution

Re: change mounted points

Hi,

You have made a simple mistake (I did it once in another life!).

There are a couple of ways of refering to a disk partition in fstab.

One way is to use the partition label, the other way is to use the partition device file.

The label is a property of the partition on the disk, and, unless you relabel the partition, it will never change.

On the other hand, the partition device file will always be the device file unless you reparition the disk (e.g. /dev/ida/c0d0p8).

In your case, your disk is mounted using labels (you can do either if you have labels defined), and your /data partition has the *label* 'data'.

In your fstab, you originally had:

[...]
LABEL=/data /data ext3 defaults 1 2
[...]

The change you made was:

[...]
LABEL=/data5 /data5 ext3 defaults 1 2
[...]

The problem is, the label (i.e. the name of the partition you are talking about) has not changed, so if you try to refer to a partition labeled 'data5' the system doesn't know what you are talking about!

You can do one of several things to fix the problem...

Change the line to read:

LABEL=/data /data5 ext3 defaults 1 2

This tells the system to mount the partition labelled as 'data' into the mount point '/data5'

This will work.

Alternatively, keep the changes you made, and relabel the partition to 'data5' instead.

What filesystem are you running?

For example, if you're running an ext2 or ext3 filesystem, you can relabel the partition with the command:

# e2label device [ new-label ]

So in your case:

# e2label /dev/ida/c0d0p8 data5

Will change the partition label to match what you have in your fstab.

The third way of fixing it (it's a bit like perl - more than one way to do it!), is to avoid using the label altogether, and to use the partitions device file - edit the fstab to read:

/dev/ida/c0d0p8 /data5 ext3 defaults 1 2

this will work too!

Regards,

Andy Bruce

I Love it when a plan comes together!
Delrish
Trusted Contributor

Re: change mounted points

You should change the line as the below. One of your disks labled with â dataâ you cannot change the label to â data5â manualy. You can just change the mount point. If you want to change diskâ s label you have to use e2lable command. However, if you change your fstab as below, your problem will be solved.

LABEL=/data /data5 ext3 defaults 1 2

Also you can use the disk's direct address in fstab instead of using label.

/dev/ida/c0d0p8 /data5 ext3 defaults 1 2

Alireza
file system
Frequent Advisor

Re: change mounted points

thank you Andy Bruce and Alireza !

I did what you tell me what i've done wrong.
So I did altertives what you gave solution.

first I edit line LABEL=/data /data5 ext3 defaults 1 2
that's my mistake I edit wrong LABEL=/data5.
thank you for your help.

second I did new label using e2label.
e2label device [ new-label ]

I did sencond solution.
I examined each of alternatives. thanks
have a nice day.


and I give you poins to Bruce 10, 8 Alireza.

Because Bruce gave me the solution faster than Alireza.
I'm sorry Alireza. Good luck
Anyway, Thank you all