- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- how to create the softlink two mount points
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2013 02:27 AM
02-08-2013 02:27 AM
how to create the softlink two mount points
example
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda5 19840892 2189396 16627356 12% /
/dev/sda6 980308 17652 912056 2% /swap
/dev/sda1 101086 11342 84525 12% /boot
tmpfs 253588 0 253588 0% /dev/shm
/dev/sda3 19840924 176220 18640564 1% /data2
/dev/sda2 19840924 176204 18640580 1% /scratch
[root@testlinux ~]#
i want to create the softlink betweeb /stage directory to /scratch mount point
Requirment
when user upload the data in /stage directory that time data it will reflect to /scratch mount point.how to create the soft link.
- Tags:
- symlink
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2013 02:40 AM
02-08-2013 02:40 AM
Re: how to create the softlink two mount points
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2013 03:06 AM
02-08-2013 03:06 AM
Re: how to create the softlink two mount points
one more input in my production server /stage and /scratch different vg.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2013 07:55 AM - edited 02-08-2013 07:58 AM
02-08-2013 07:55 AM - edited 02-08-2013 07:58 AM
Re: how to create the softlink two mount points
If the uploaded filename is not known in advance, you must softlink the entire directory. To do that, you must move away (or unmount if necessary) the current /stage directory. With soft links, it does not matter if the link and target are in different filesystems or VGs.
# umount /stage #(if necessary) # mv /stage /stage.old # ln -s /scratch /stage
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2013 08:50 AM
02-08-2013 08:50 AM
Re: how to create the softlink two mount points
Hi Matti,
Thnaks for your reply.
#mv /stage /stage.oldf -what is the requirment of this command
#ln -s /scratch /stage - this will create the link file under the /stage or /scratch
one more doubt,
if i change any mount point name in fstab entry ,the same need to update /etc/mtab this is required or automatically update happen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2013 01:30 AM
02-09-2013 01:30 AM
Re: how to create the softlink two mount points
> #mv /stage /stage.oldf -what is the requirment of this command
You cannot have two things with the same name in the same directory, i.e. if there is a directory/mountpoint named /stage, there cannot be a softlink named /stage, and vice versa.
Filesystems can only be mounted on top of directories, so if /stage was a mountpoint, there will be a directory named /stage left after the "umount /stage" command. Before creating the softlink, this directory needs to be moved away or deleted.
If you run the "ln -s /scratch /stage" command while /stage already exists, one of two things happens:
- if /stage is a file, you'll get an error, telling you that /stage already exists.
- if /stage is a directory, the ln command assumes you meant "link /scratch into directory /stage using its original name", and so you'll get your softlink as /stage/scratch, which is not what you wanted.
The "ln" command works much like "cp", but without actually copying the data.
> if i change any mount point name in fstab entry ,the same need to update /etc/mtab
No, you should not normally edit /etc/mtab at all.
/etc/mtab is updated by the mount/umount commands: its purpose is to describe what is currently mounted.
In Linux, /proc/mounts offers much the same thing and it can even be used as a replacement of /etc/mtab, but in some situations the mount command stores some extra data in /etc/mtab which is not available through /proc/mounts (mainly when you're using the "user" mount option to allow non-root users to mount/unmount things).
The only times you might want to edit or replace /etc/mtab are:
- when you've accidentally overwritten the current /etc/mtab, e.g. by restoring an old full backup of /etc that had a different configuration of mountpoints than what the system currently has, or
- when you have manually mounted/unmounted other filesystems while the root filesystem has been in read-only mode, so the mount/umount commands failed to update /etc/mtab accordingly (e.g. because of a disk failure affecting the root filesystem), or
- you are preparing to shut down the system that has a mounted filesystem that you know cannot be unmounted cleanly (e.g. because it is on a disk that has failed in a bad way, or on a NFS server that has been permanently shut down) and you want the system to just ignore the problem and shut down as quickly as possible.