1833325 Members
2731 Online
110051 Solutions
New Discussion

Re: Regarding mounting

 
nandam
Frequent Advisor

Regarding mounting

if we are changing the mount point of a FS from one to another what are all the different ways to achieve it?
for eg. FS XYZ is mounted on root. but since its NOT a best practice to have more FS on root, I am creating a new mount point and moving the XYZ to it.

what are all the possible/available ways?
5 REPLIES 5
Jaime Bolanos Rojas.
Honored Contributor

Re: Regarding mounting

nandam,

Do you just want to change the mount point location on the local server, or we are talking about mount points in a NFS server?

Regards,

Jaime.
Work hard when the need comes out.
James R. Ferguson
Acclaimed Contributor

Re: Regarding mounting

Hi:

You can simply unmount your old filesystem and copy from its data to a new one. Modify your 'etc/fstab' to reflect the new mountpoint and mount the filesystem on that new mountpoint.

You can use 'cpio' to perform the data copy, thusly:

# cd srcdir && find . -depth -print | cpio -pudlmv dstdir

Regards!

...JRF...

DCE
Honored Contributor

Re: Regarding mounting

if you want to change where a local FS is mounted:

One way is to
*Create the new mount point name with mkdir
*Unmount the FS to be relocated
*modify /etc/fstab (vi) and change the mount point for the lvol to the new location
*mount the fs to the new mount point (mount -a)

The FS needs to be quiet, i.e. no one logged in for this to work
MarkSyder
Honored Contributor

Re: Regarding mounting

Create a new filesystem, e.g. /new_fs
cd /old_fs
find . -xdev -depth -print|cpio -pmd /new_fs

cd /etc
cp fstab fstab.old
vi fstab

Swap /old_fs with /new_fs

Reboot the server. Your "old" filesystem will now be in the new place.

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
nandam
Frequent Advisor

Re: Regarding mounting

Just move on local only.