Accessing the user space of one OS from within another.


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Accessing the user space of one OS from within another.
# 1  
Old 02-04-2019
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.

Last edited by Circuits; 02-04-2019 at 05:24 PM..
# 2  
Old 02-04-2019
Isn't the target directory visible under


Code:
/<mount point>/home/username

? What do you see in the mount point's directory?
# 3  
Old 02-04-2019
@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.
# 4  
Old 02-04-2019
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":

Code:
---- directory +- file1
               +- file2
               +- directory1 ----- file
               +- directory2 ---+- file1
               +- file3         +- file2
               +- file4         +- directory --+- directory
                                +- file3       +- ...

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):

Code:
/---- dev/....
 ---- usr/....
 ---- bin/....
 ---- mnt/ +- file1
           +- file2
           +- directory1/ ----- file
           +- directory2/ ---+- file1
           +- file3          +- file2
           +- file4          +- directory/ --+- directory/
                             +- file3       +- ...
 ---- home/....
....

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:

Code:
/dev/mapper/rootvg-rootlv /               ext4    noatime,errors=remount-ro 0       1
/dev/mapper/rootvg-altrootlv /altroot     ext4    noatime,defaults          0       2
# /dev/sda1
UUID=4d628014-85e7-48d0-a2ad-8dde00f17748 /boot  ext4    defaults        0       2
/dev/mapper/rootvg-homelv /home           ext4    noatime,defaults        0       2
/dev/mapper/rootvg-optlv /opt              ext4    noatime,defaults        0       2
/dev/mapper/rootvg-swaplv none            swap    sw              0       0


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):

Code:
mount <your new home-fs, i.e. "/dev/sda3"> /mnt
cd /home
tar cf - * | (cd /home ; tar xf -)

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:

Code:
umount <your new home-fs, i.e. "/dev/sda3">

and edit your file /etc/fstab by adding this line (replace "/dev/sda3" with the real device name):
Code:
/dev/sda3 /home           ext4    noatime,defaults        0       2

Then try to mount it:

Code:
mount /dev/sda3 /home

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:
# 5  
Old 02-05-2019
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?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

Problems creating and accessing with user

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)
Discussion started by: anaigini45
5 Replies

2. Solaris

Accessing Solaris PCI Config Space extended properties

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)
Discussion started by: vijayrajen
0 Replies

3. Shell Programming and Scripting

[SSH] Accessing remote directory with user-passed path

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)
Discussion started by: lgb3
2 Replies

4. Shell Programming and Scripting

HOW: Shell script accessing files located in individual logged in user.

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)
Discussion started by: shekharjchandra
1 Replies

5. Programming

Signalling interrupts to user space

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)
Discussion started by: dragonpoint
0 Replies

6. Programming

Getting notified in user-space on interrupts

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)
Discussion started by: mylinuxforums
2 Replies

7. Solaris

Create user with Restricted Space usage

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)
Discussion started by: vino_hymi
3 Replies

8. UNIX for Advanced & Expert Users

wake up user space thread from kernel space ISR

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)
Discussion started by: aaronwong
0 Replies

9. AIX

Can we restrict an user to use only certain disk space

Hi, In Ibm Aix can we restrict the user to use only 50% or 60% of disk space. Thanks, Chris (1 Reply)
Discussion started by: pramod10
1 Replies

10. UNIX for Dummies Questions & Answers

Limit number of user accessing to SCO UNIX System

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)
Discussion started by: trinhnguyen
1 Replies
Login or Register to Ask a Question