Operating System - HP-UX
1819998 Members
3759 Online
109608 Solutions
New Discussion юеВ

Re: Is it possible to mount file system on users home directory

 
chandregowda
Advisor

Is it possible to mount file system on users home directory

Hi,

I have created one user abc.

User home directory is /home/abc
and
I have created one filesystem /dev/../abc
Is it possible to give mount point for above filesystem as /home/abc(User home directory).

If yes please tell me the steps to follow.

Appriciated early reply.
12 REPLIES 12
Gokul Chandola
Trusted Contributor

Re: Is it possible to mount file system on users home directory

Hi,
At the time of User creation you can define desired home path for that user through SAM easily and other parameter.
Please use this its very easy

Regards,
Gokul Chandola
There is always some scope for improvment.
Venkatesh BL
Honored Contributor

Re: Is it possible to mount file system on users home directory

It is possible. But, what exactly is your intension? Is that directory the user's home directory or something? Or is it needed only for that user or something?
chandregowda
Advisor

Re: Is it possible to mount file system on users home directory

Hi Venkatesh,

/home/abc is the home directory for user abc only.

how can i give this home directory as mount point for file system /dev/../***

Thanks,
chandra
Suraj K Sankari
Honored Contributor

Re: Is it possible to mount file system on users home directory

Hi,

It is possible but the question is why the user need /dev directory, because /dev is for devices and drivers, so normal users home directory should not be there.
If still you want then edit the /etc/passwd file and change the path or user├в s home directory into /home/abc to /dev/../abc
And go to /dev/.. and give the full permission to abc with ├в R option and change the owner and group also with ├в R option.
Or all this you can do with SAM.

Suraj
Sandeep_Chaudhary
Trusted Contributor

Re: Is it possible to mount file system on users home directory

yes u can do that

mostly this is used want to store user home directory at centralized location(NFS filer)

I am using thi sfor some of my servers.

/etc/auto_home

+auto_home

rau de-lbc-fs02:/vol/group/CGEY/home/sun/rau
neumannl de-lbc-fs02:/vol/group/CGEY/home/sun/neumannl
arpdh de-lbc-fs02:/vol/group/CGEY/home/sun/arpdh
rojahn
Vishu
Trusted Contributor

Re: Is it possible to mount file system on users home directory

Hi,
yes, you can do so. your user will have the access to that mounted file system.

1. filesystem you created will be on the raw device. so you can mount it on /home/abc. and also use it as a user home directory.

sreekanthtm
Trusted Contributor

Re: Is it possible to mount file system on users home directory


Yes You can do it.

Steps...

Copy the content of /home/abc to any temp dir
#copy -R /home/abc/ /tmp/abc.tmp/

mount the filesystem in /home/abc
#mount /dev/../*** /home/abc

Put entry in /etc/fstab for making the mount point permanent.

restore the content to the new file system.
# cp -R /tmp/abc.tmp/abc/* /home/abc

Done......
Cheers

chandregowda
Advisor

Re: Is it possible to mount file system on users home directory

Hi sreekanth,

/home/abc contains only .sh_history file.

If i try to mount file system then i got file system /dev/../*** hass structural damage

I know how to create user and filesystems.
Can u tell me which one we need to create first either user or filesystem.
Venkatesh BL
Honored Contributor

Re: Is it possible to mount file system on users home directory

You create the file system first. When you create the user, you specify this file system as the home directory.

You can modify the home directory of an existing user also.
V. Nyga
Honored Contributor

Re: Is it possible to mount file system on users home directory

Hi,

you don't need a mount - just do a link:
'ln -s /dev/.../abc /home/abc'

/home/abc may not exist before that command.
Also, as said before, /dev is not intended for holding an user's home dir.

HTH
Volkmar
*** Say 'Thanks' with Kudos ***
sreekanthtm
Trusted Contributor

Re: Is it possible to mount file system on users home directory

Ok.... Start frm the scrach.
Delete the existing user.
#userdel -r abc

Create the filesystem and mount it in /home/abc
# mkdir /home/abc
# mount /dev/.../lvolxx /home/abc

Now create the user again using follwing option.
#useradd -m -d /home/abc -r yes

-d -- means /home/abc will be home directory for the new login
-r yes -- to regain the ownwership of /home/abc directory.

Vishu
Trusted Contributor

Re: Is it possible to mount file system on users home directory

Hi,
First you complete /dev/..../abc. It is so confusing.
and now, you better first create the filesystem and then follows the user creation process by specifying the mounted directory as user's home directory.

useradd -m -d /home/abc abc

What is normally happen is when you mount a filesystem to a directory, it overlap the directory's previous contents and when you unmount it, you will regain those files again. so, if you already have /home/abc as your home directory, so take backup of your files before mounting. and restore them back after mounting the filesystem.