Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mounting a directory as a filesystem

Status
Not open for further replies.
Apr 13, 2004
316
US
Say I have a filesystem /home that is mounted. Under /home I have a directory dduck with a number of files in it.

In AIX I count do a mount looney /home/dduck and it will mount the directory dduck as a filesystem and the files within the directory are usable.

Is this possible in Solaris 9?
 
I am a little confused. You said that if you cd to home there is a directory with multiple files in it. You should be able to cd to dduck to list the files. If the directory was not mounted then you would not see the files.

As far as mounting goes you can hard or soft mount.
Hard mounts are found in your /etc/vfstab file.

Soft mount;
I have two drives, target 0 which is the boot drive and target 1 slice 0 which will be our other mount point( make sure to partition and newfs target 1 slice 0 .
I will make a directory under root which is under target 0.
I will call this directory jumpstart.

we can then softmount the directory

mount /dev/dsk/c0t1d0s0 /jumpstart

When the system is rebooted you will need to remount manually.

Hard mounting example;
I have two drives, target 0 which is the boot drive and target 1 slice 0 which will be our other mount point.
I make a directory under root which is under target 0 slice 0(remember to partition and newfs.
I will call this directory jumpstart.

cd /
mkdir jumpstart
vi /etc/vfstab (add hard mount entry) example below mounting jumpstart to target 1 slice 0;

/dev/dsk/c0t1d0s0 /dev/rdsk/c0t1d0s0 /jumpstart ufs 1 no -

write and quit.

to softmount run mount /dev/dsk/c0t1d0s0 /jumpstart
When the system is rebooted it will see the mount in /etc/vfstab and mount the directory.

Hope this helps, keep asking questions if needed.

Thanks

CA






 
if your /home is from server1 then you can mount your dduck in server2 as
# mount server1:/home/dduck /dduck(or any directory).

Generally there shoudldnt be any necessity for mounting /home and /home/dduck in different mount points in the same machine (here server2) as said by cndcadams in previous reply.

But if you need that for some reason or other, then there shouldnt be any problem mounting them this way except for performance issues.
 
if /home-Filesystem is on your local machine automounter will just overmount /home

If you just want to use /home on this host edit /etc/auto_master and #-out the line starting "/home ..."; reboot after that

If you want to use this host as a homeserver I suggest
to change the mountpoint of the filesystem in /etc/vfstab to eg: /export/home and change /etc/auto_home to
* localhost:/export/home/&

again do a reboot

Regards
-- Franz
Sorry I'm not a native spaeker, I'm from Munich, Germany - "Home of the Whopper", oh no, "Home of the Oktoberfest" ;-)
Solaris System Manager; I used to work for Sun Microsystems Support (EMEA) for 5 years
 
Thanks for the replies. Let me try and clarify what I am trying to do.

Say my filesystem structure is like the following:

#ls -F /home
lost+found/ dduck/ ysam/ bbunny/ mmartian/ k9/ fleghorn/

#ls -F /home/dduck
.dt/ junk textfile report freeps* search.f* yest.sh*

Now I want to mount /home/dduck as a filesystem. In AIX I can issue the command: 'mount anyname /home/dduck' and when I do a 'df .' from within /home/dduck it would show:

#df .Filesystem 512-blocks Free %Used Iused %Iused Mounted on
/dev/hd1 65536 56304 15% 839 11% /home/dduck

and the filesystem is not listed in /etc/filesystems (which on Solaris would be /etc/vfstab) because it is mounted ad-hoc.

Normally, if you did a 'mount /home/dduck' it would mount a filesystem over /home/dduck and if you did an 'ls' inside the dduck directory, it would be empty, however, in AIX, I can do the method listed above, and /home/dduck (the directory) is mounted /home/dduck (the filesystem) and having the files in /home/dduck seen and usable.

Thanks.

 
>>Now I want to mount /home/dduck as a filesystem.
I do not understand what you need and mean...?
In your example /home is _one_ UFS-Filesystem (there is lost+found, in dduck is no lost+found ->this tells you this is the top [root] of the filesystem)
In Solaris you can do a 'df -kl /home/dduck' ang get info about the filesystem without mounting it; if automountd is not running just change to /home/dduck and go on...

Can you tell me what you want to know about the filesystem, maybe I'm not picking up what you are asking...? What's the goal?


Regards
-- Franz
Sorry I'm not a native spaeker, I'm from Munich, Germany - "Home of the Whopper", oh no, "Home of the Oktoberfest" ;-)
Solaris System Manager; I used to work for Sun Microsystems Support (EMEA) for 5 years
 
/home is the top filesystem and dduck (an example) is just a directory (hence, no lost+found).

What I want to do is to convert /home/dduck to a filesystem. But in doing so it will mount over the dduck directory and the files that are in dduck will not be able to be used.

In AIX, I can mount dduck as a filesystem (/home/dduck) and the files that are in dduck are able to be used just as they are in the directory.

So what I am looking to do is mount the directory (dduck) as a filesystem (/home/dduck) and /home would still be the root.

Thanks.
 
The safest way is to back up /home/dduck (maybe move everything in there to /tmp or some other filesystem temporarily), create the filesystem /home/dduck, mount it, and then restore your backup of /home/dduck. This is how I've always done it (even with AIX). It may be slower, but it is safer.
 
I was afraid of that. It seems there are so many tools that I use in AIX that are not available for Solaris. Really, after having been exposed to Solaris for around 6 months (versus 10 years of AIX) I can honestly say I am NOT impressed with the Solaris OS at all.

It seems it is just like FreeBSD that I have installed at home on an Intel machine. Why doesn't Sun spend more money and create an OS that is easier (and more pleasing) to administer? From patch & package administration to upgrading the OS to LVM management, and other things, Solaris takes a back seat to AIX. (this is not a flame against Solaris so please don't take it that way - just my frustration with it after being on AIX for so long)

bi - in AIX you can do a 'smitty fs' and under 'Mount a File System', as an example: in /tmp I have a directory called junk with the following files:
dailystatspag.21622 dailystatspag.27262 dailystatspag.29836 dailystatspag.29852 dailystatspag.31158
dailystatspag.27248 dailystatspag.29798 dailystatspag.29850 dailystatspag.30384

and going into smitty fs I use: junk at the 'FILE SYSTEM name' field and put /tmp/junk in the 'DIRECTORY over which to mount' field. :
Mount a File System

Type or select values in entry fields.
Press Enter AFTER making all desired changes.

[Entry Fields]
FILE SYSTEM name [junk] +
DIRECTORY over which to mount [/tmp/junk] +
TYPE of file system +
FORCE the mount? no +
REMOTE NODE containing the file system []
to mount
Mount as a REMOVABLE file system? no +
Mount as a READ-ONLY system? no +
Disallow DEVICE access via this mount? no +
Disallow execution of SUID and sgid programs no +
in this file system?

Which then mounts directory /tmp/junk as a filesystem /tmp/junk:
/tmp/junk 98304 77096 22% 393 4% /tmp/junk

and still allows the use of files:
>ls /tmp/junk
dailystatspag.21622 dailystatspag.27262 dailystatspag.29836 dailystatspag.29852 dailystatspag.31158
dailystatspag.27248 dailystatspag.29798 dailystatspag.29850 dailystatspag.30384

 
Yes, they are two very different OSes. You should have seen the admintool for Solaris a few years ago! And I agree that AIX makes things so much easier for the admin. Just look at it as a learning experience! And, keep in mind, there are a ton of Solaris shops out there, so it is a good skill to have.

 
hi screwloose,

Whats your intention behind mounting a directory (/home/dduck) as a filesystem in the same machine ?

But am surprised whether aix can mount a directory as a filesystem. In your example do you get a lost+found directory ? btw what do you achieve out of this exercise.

If you can elaborate may be some1 can help you.

Ram
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top