how to create permanent access to folders on other disk?

Kernels & Hardware, configuring network, installing services

Re: how to create permanent access to folders on other disk?

Postby debiman » 2018-10-30 07:20

canti wrote:Trying the reverse, i.e.
Code: Select all
ln -s /media/familie/testmedia /home/testhome
leads to the error that no symbolic link "/home/testhome" can be created: the access is denied.

this is the correct way, and the error is also correct.
try the same with sudo or su, then, before you mount anything:
Code: Select all
chown canti:canti /home/testhome
User avatar
debiman
 
Posts: 3064
Joined: 2013-03-12 07:18

Re: how to create permanent access to folders on other disk?

Postby p.H » 2018-11-02 08:48

canti wrote:/home -> should be /home/<my username>?

You mount a partition on /home if you want ALL normal user home directories to be stored in that partition.
You mount a partition on /home/<username> if you want <username> home directory contents to be stored in that partition.
You mount a partition on /home/<username>/<somedirectory> if you want <somedirectory> contents in <username> home directory to be stored in that partition.
Alternatively, you can mount a partition on any suitable empty directory (not /media, /mnt or their subdirectories) and create a symlink /home/<username>/<somelink> pointing to the mount point or any of its subdirectories.

canti wrote:noauto -> I took that from https://wiki.archlinux.org/index.php/fs ... _partition. I thought this fits my situation because my sdb is large (1 TB). But I can have understand it wrongly.

"noauto" has nothing to do with the filesystem size. It means "do no try to automatically mount the filesystem at boot or when running mount -a". You can use it when the filesystem is not always present at boot, or when you want to mount it manually.
p.H
 
Posts: 645
Joined: 2017-09-17 07:12

Re: how to create permanent access to folders on other disk?

Postby canti » 2018-11-11 22:26

On sdb I have the following path /media/familie/data (when mounted manually to sdb without fstab, I did not choose the name "media", by the way; "familie" is my username). The directories containing data are in the directory "data" .
On sda the corresponding directories are in path /home/familie.

On advise of NFT5 and p.H. I have to create the /home directory on sdb. Probably the best way to do this is to rename "media/familie/data" into "/home/familie/data". But I'm afraid the command
Code: Select all
mv /media /home
will arise conflict with the existing /home/familie (on sda2 where pwd = /home/familie). Or should I use an other, better, way to execute that advise?
HP Pavilion Entertainment PC d7 4GB 64bits, containing Debian Jessie (Gnome 3), Ubuntu 15.10 (xfce) and Windows Vista
HP Envy 17 n120nd containing Debian Stretch (Gnome 3)
canti
 
Posts: 69
Joined: 2011-01-31 12:57
Location: The Netherlands

Re: how to create permanent access to folders on other disk?

Postby GarryRicketson » 2018-11-12 00:03

When I have that kind of concern,
Code: Select all
will arise conflict with the existing /home/familie
I use a different name
IE: /home/familie/familie-1/
If a sub directory is ok, or create another user and have it's own directory :
IE: /home/familie-1
Maybe familie-data ? to be more descriptive.
I do not know if what you are doing would cause a conflict or not, but adding a number or letter would insure there is none. ( I think)
User avatar
GarryRicketson
 
Posts: 5192
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: how to create permanent access to folders on other disk?

Postby p.H » 2018-11-12 08:14

canti wrote:
Code: Select all
mv /media /home

You don't want to do that. Really. You want to :
- unmount the filesystem from /media/familie/data
- create a directory /home/familie/data (if you want to access the contents of the filesystem under this path)
- add a line in /etc/fstab to mount the filesystem on /home/familie/data
- mount the filesystem

Note : the filesystem being mounted on /media/familie/data normally means its label is "data" and it was mounted in the GUI session opened by user "familie".
p.H
 
Posts: 645
Joined: 2017-09-17 07:12

Re: how to create permanent access to folders on other disk?

Postby canti » 2018-11-12 21:19

p.H wrote:You don't want to do that.
Here I had my strong suspicion...

p.H wrote:- create a directory /home/familie/data (if you want to access the contents of the filesystem under this path)
I'm struggling to create the directory /home/familie/data on the filesystem sdb1 using the mkdir command, this seems not possible when this filesystem is unmounted

p.H wrote:Note : the filesystem being mounted on /media/familie/data normally means its label is "data" and it was mounted in the GUI session opened by user "familie".
Ah, interesting. So this probably means I only have to create /home/familie on sdb1 as this is already labeled as "data"?

Yes, I know I'm a long time Linux user, but still with limited knowledge of commands and basic principles of files structure. I'm a bit lazy thanks to the beautiful GUI Gnome and the good Debian installer. But I'm absolutely not averse to use Linux commands and like to learn them!
HP Pavilion Entertainment PC d7 4GB 64bits, containing Debian Jessie (Gnome 3), Ubuntu 15.10 (xfce) and Windows Vista
HP Envy 17 n120nd containing Debian Stretch (Gnome 3)
canti
 
Posts: 69
Joined: 2011-01-31 12:57
Location: The Netherlands

Re: how to create permanent access to folders on other disk?

Postby Dai_trying » 2018-11-13 09:02

I thought I would just put down here what I do to achieve this in case it might be useful to OP.

First I create an fstab entry to mount my "DATA" partition to /media/<username>/DATA/

Next (on a fresh installation) I remove (delete) any Documents/Downloads/Pictures/Videos folders from my $HOME.

After this I simply create a symlink to the relevant directories of my DATA partition. For simplicity I have them named Documents, Downloads, Pictures etc etc...

If you are in the "target" directory (where you want the symlink placed) and the folder name is the same in your DATA partition as you want to use in the filesystem you can use this simple command (replace "dai" with your own username)
sudo ln -s /media/dai/DATA/Documents

If your DATA folder names are different to what you want in your filesystem you can use this command to give your custom folder (sym-link) name.
sudo ln -s /media/dai/DATA/random_folder_name My_custom_folder

The reason I do this is to make easy use of all my data from different OS's (I usually have a multi-boot system with between 4 and 6 different OS's).

Note 1 I use the /media/<user>/ folder to place my mount which I have read on this forum is not good practice but I had been doing it this way for years without issue before reading that and so keep it this way, you may prefer to use a more "recommended" location for your mount point.

Note 2 I use sudo here but the same results can be achieved if you run the command as root another way.
Dai_trying
 
Posts: 567
Joined: 2016-01-07 12:25

Previous

Return to System configuration

Who is online

Users browsing this forum: No registered users and 1 guest

fashionable