Accessing the user space of one OS from within another.
Recently, I setup a dual boot on this PC. I can currently jump from Ubuntu 12.04 and 16.04. What I would like to be able to do is access the home directory of my 16.04 OS from within the 12.04, is that possible? I can mount the partition of the hard drive where 16.04 lives from within 12.04 but it seems like it's only allowing me access to the kernel space.
note: I believe this question fits under the unix.com umbrella but if not let me know.
EDIT: I may have pulled the trigger on asking this question a bit to early. This could be my own fault for how I setup my 16.04 system.
@RudiC Here in lies my problems. This is my work PC so we have an SSO active directory. I vaguely remember setting this PC up 8 months ago when i started working here and I seem to remember mucking things up a bit back then. Well I know I did because inside my 16.04 home directory there exists three folders: rob@ourdomain.com, ourdomain.com and sysadmin. The Home directory I want to access from the 12.04 OS lives inside of the ourdomain.com directory and its called 'rob'. I just don't know enough about SSO, PBIS, SSSD and all these networking protocals/tools atm to make any definitive statements about how my computer is setup. I need to spend some time figuring out how this PC is setup.
It seems you need to understand a few basics about UNIX/Linux filesystems before we can tackle your problem:
A "filesystem" in UNIX is a space where files can be stored. It is organised in a way so that it has a "top" directory in which other directories and files can be stored. The other directories can itself again contan directories and files, and so on, so that it resembles a "tree structure":
Every UNIX system has a "main" filesystem, which is located at /. Into this all the other filesystems are "mounted". To mount a filesystem you need a directory, either the "main" filesystem or in one that has already been mounted before. The mounted filesystem then shows up with its top directory being this directory.
I.e take the above example: you probably have a directory /mnt, which should be (by default) empty. If not you could create it (as root). Would you now mount the example above it would look like this (i leave out a few details):
In the end you end with a uniform tree-like system which consists of one or more sub-trees mounted together. This means a user does not have to care about which disk or partition a file is (physically) located on because he operates in a homogenous environment (unlike in Windows where you have to discern between directories and drive letters).
Try the command mount and the system will show you which filesystems are mounted and at which "mountpoint" (the directory they are plugged into the main tree). There is also a file describing which filesystems are mounted at system start. In Linux systems this is /etc/fstab. (Other systems have similar files which may be named differently.) For reference, here is the one of the laptop i am writing this:
Now to your problem: you will have to have a separate filesystem for your home. Usually you do not create a separate filesystem for your home alone but for all users. This would contain all users homes and would be mounted at /home, like you see in my fstab above. If you don't have it, log in as root, create it, mount it temorarily under /mnt and then do the following (all this has to be done as root, preferably while no other user is logged on):
The last command will, depending on how much data you have in your home, take some time. It will copy all the data from your home to your newly created FS. When finished unmount the new filesystem:
and edit your file /etc/fstab by adding this line (replace "/dev/sda3" with the real device name):
Then try to mount it:
Log in now with your user and make sure all your data is there and nothing is missing. If satisfied, log out again.
You now need to re-login as root, unmount the mounted FS again and then (after you unmounted the FS!!) delete everything in /home. This is to preserve space because by mounting over the directory /home everything in there will be invisible as long as the new FS is mounted. This is why we copied everything to the new FS. You can also postpone a few days deleting the old home just to be sure.
You can now reboot and your system will come up with the new /home FS mounted automatically. Repeat the process of adding the new FS to /etc/fstab with your other OS. Notice that your user account needs to have the same user ID and group ID for that to work smoothly. If the user accounts happen to have different IDs you can correct this in /etc/passwd and /etc/groups
I hope this helps.
bakunin
These 2 Users Gave Thanks to bakunin For This Post:
Alright great, thanks for that guys I appreciate it. Everything seems to be in working order now. There is one thing though, for some reason, when I start up my 12.04 machine I am getting a few error reports briefly printing in the top left corner of the screen. Usually, they something about a broken pipe or an inability to communicate with this or that. Should I worry about it?
Hi,
I have created the user 'mastersa' in several servers.
I need to change the user ID to '0'. However, after doing this, I am not able to login (Access denied).
Even after I change the password, I still get this error.
Why is this?
Also, when I attempt to delete the user account, I get... (5 Replies)
Hi all,
Am working on an enhancement to access Solaris PCI Config Space. I got basic pci config space properties like vendor-id using di_node system calls. But i am not able to access the extended configuration space. Can you please suggest an approach to access the pci extended configuration... (0 Replies)
Hi everybody,
Currently, I have a script which access a remote computer via SSH, go to a folder already defined in the code and then executes a program in it, just like that:
ssh user@host << EOI
cd path
./file
EOI
It executes fine, but now I want to pass an argument in the command... (2 Replies)
Hi
I have below scenario, I hope this could be possible, but as of now no idea how to implement this.
Mount point in this location /abc/mp, and there will different users who will be executing one the file shell1.sh file located in /abs/mp, but every user will execute this shell1.sh file from... (1 Reply)
What is the simplest function I can use to signal an interrupt from kernel module to user space. I knw the usr app pid in my module.
Also can someone explain the parameters in kill_fasync and send_sig (0 Replies)
Hi,
I'm working on an AMD opteron running Linux 2.6.28.6
I want to preload a module specific register (MSR) with a value to have it overflow after a number of a specific event counts. As I understand, when the counter in the register overflows, an interrupt will be generated and handled by the... (2 Replies)
Hi,
What is the command or how to create a user with the restricted usage of space on a disk.
Also let me know how to change the limit of the space size allotted in future for the same user.
~Vinodh Kumar V M (3 Replies)
Hello, I'm searching for a proper way to let the kernel space ISR(implemented in a kernel module) wake up a user space thread on a hardware interrupt.
Except for sending a real-time signal, is it possible to use a semaphore?
I've searched it on google, but it seems impossible to share a... (0 Replies)
Hi,
In my company, we are using SCO UNIX system and Informix database. Recently, there have been a lot of users accessing to server and sometimes it has made server run very slow. So, I intend to limit number of users of 30 only. Although I have tried to search on the Internet for several days,... (1 Reply)