Media\Storage Drive

It is literally the same location. So, yes, if you delete a file from one place it will be gone from the other.

1 Like

Okay that answers the question. Why would you want to have it this way then? :thinking:

Because then you can have a single partition in multiple places. You can link /data/Videos to /home/ricklinux/Videos and /data/Pictures to /home/ricklinux/Pictures.

It lets you effectively use the storage in that partition/drive wherever you need it without having to carve it up into separate partitions.

1 Like

Thanks I understand that and it makes sense but i just wanted to be aware of the pitfalls. If i delete a file it’s not going to be in either place so i need to know that. I"m pretty sure it’s working right now just adding it to the fstab and setting it up. So i could have used media instead of data or some other name too.

Yes, you could have put it anywhere. You could have put it at /opt/monkey/pants if you really wanted to.

So one final answer. :grinning_face_with_smiling_eyes: I promise. :crossed_fingers: I noticed when i reboot that dolphin automatically opened because it mounted the drive. Can i set that to not auto mount?

Making the link does not move anything - that is why the first thing is to move the directory and all its data over to the new location. A soft link (which this is) is basically a file telling the system “for access to this directory, look over here”. Assuming you have mounted the drive in fstab, and the directory (ie Music) is now ON the drive, then doing the ln -s command will create the redirect file, and it will seem (and act in anything) to be local, despite it being on another drive.

For a further example - I use a data drive that I call, and mount, as /mnt/data. On that drive are various data items, such as Documents, Downloads, Music, Pictures and Videos. They are all* symlinked (soft linked) by the ln -s command. When I set up a new build - something like this is in fstab:

fstab from EnOS
┌01:17:17 WD= [~]
└───freebird@nest ─▶$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a device; this may
# be used with UUID= as a more robust way to name devices that works even if
# disks are added and removed. See fstab(5).
#
# <file system>             <mount point>  <type>  <options>  <dump>  <pass>
UUID=9CC1-182A                            /boot/efi      vfat    umask=0022 0 2
UUID=538b9f7d-c154-49af-be53-6f2e88747d6a /              ext4    defaults,noatime 0 1
#UUID=45dc179b-b738-46a5-92c5-aa888f9d0e03 /mnt/data      ext4    defaults,noatime 0 2
UUID=185941c4-f3d0-4e48-a621-5a7457f83e00 none           swap    defaults         0 0

and I run a script like this:

Summary
#!/bin/bash
# This script ASSUMES that the data drive is mount in fstab as /mnt/data
# and that the directory structure exists on the drive. If not - then make it so!

# remove empty directory - if it has contents, move them to data drive beforehand!
echo "To run this script, hit <ENTER> - CTRL-C to quit"
read
cd ~
rmdir Documents
ln -s /mnt/data/Documents Documents
rmdir Downloads
ln -s /mnt/data/Downloads Downloads
rmdir Music
ln -s /mnt/data/Musical/Music Music
rmdir Pictures
ln -s /mnt/data/Pictures Pictures
rmdir Public
ln -s /mnt/data/Public Public
rmdir Videos
ln -s /mnt/data/Videos Videos
# This is a throw-in where I keep all my epubs - does not
# have a pre-existing dir on ~
ln -s /mnt/data/Books Books

to create all the links. I don’t move the data around, because it is already there, having been set up on that drive long ago. The contents of /mnt/data are:

Dirs on /mnt/data
┌16:40:54 WD= [~]
└───freebird@nest ─▶$ lld /mnt/data
drwxr-xr-x - freebird  6 Jul  2020 backup
drwxrwxrwx - freebird 18 Jan 17:42 Books
drwxrwxrwx - freebird 27 Dec  2020 Documents
drwxrwxr-x - freebird 21 Mar 12:13 Downloads
drwxrwxr-x - freebird 27 Dec  2020 Music
drwxrwxr-x - freebird 18 Jan 14:26 Pictures
drwxrwxr-x - freebird  9 Feb  2014 Public
drwxr-xr-x - freebird 26 May 22:57 Telegram Desktop
drwxr-xr-x - freebird  6 Apr  2020 Templates
drwxrwxrwx - freebird 24 Apr 03:19 Videos
drwxr-xr-x - freebird 15 Jul  2020 VirtualBox VMs
drwxr-xr-x - freebird 16 Jul  2020 Workzone

Hopefully this makes it clearer! Just move all the data from 1 build to the data drive (after setting it up in /etc/fstab) - then modify the script to match your needs, and run it - or even do it command-by-command so you learn it better.

Afterwards, if you want - you can do the same thing on other builds, and all will see the same data without further effort. You can even drop things in a ‘Reminder’ directory for keeping useful instructions around for later (I use Downloads/Useful) - accessible from wherever on that machine.

Having it permanently mounted shouldn’t cause dolphin to automatically open. It is no different than someone who uses a seperate /home

You shouldn’t do that if you have it symlinked into your home directory.

Just to be utterly clear for people reading the in the future, that script is for a cleanly installed /home. If you run that on existing /home, it will delete your data.

You could set it not to automount - but then it would mess up the soft link system you’re making. All the symlink files would be just files with nothing to point to, and the data would be inaccessible until mounted. If that is what you want (having to mount before accessing the data) I can step you through the ways to make that happen…

I’m not sure what i want. I’m just trying to understand all the different angles. I’m not sure i want the symlinks but i might. I gotta think about it a bit.

Well - I can tell you that as a ‘system’ it works particularly with multi-boot - as all the systems have the same /etc/fstab entry, and the same symlinks - which means they all have a consistent view of the data. I even have had it extended across Fedora, Ubuntu, Mx, Rolling Rhino etc, as well as all the Arch-based setups. It means easier backup of the data is easy as well.

Thanks @dalto for all the answers and all the help. This will get me started until i figure out exactly what i want to do with it. I have never been a big saver of any data, or files or anything. I just have this large extra drive so i need to put it to some use. Also thanks to @jonathon and @freebird54. Sorry for the 50 questions. :pleading_face:

2 Likes

An easy way for you to create those symlinks in Dolphin:

  • hit F3 to split-screen Dolphin and point one pane to your home directory and the other to the root of the system
  • drag the folder you mounted that extra disc on (/data or whatever you called it) to your home directory, this should pop up a context menu with the options to move, copy, or link
  • choose Link here

That’s exactly what I did on my main machine: I have the system and my data on two separate discs, with the latter split in two partitions, mounted on /entertainment and /personal. /entertainment is owned by my user and grouped to users, a group to which I can add other accounts if I want to give them (read-only) access to my music and films; /personal is owned and grouped under my own user and group only, so only I have access to those files. Both are symlinked into my home directory, so to me it looks as if they are just subdirectories within my homedir. I don’t save anything in the homedir itself, I keep that clean and for configs only.

This way, I don’t have to have / and /home on separate partitions and I can simply reinstall (or hop distros, or add one) without having to worry about my data. All I need to do in the new install is mkdir the two directories /entertainment and /personal and add them to /etc/fstab (and check permissions, to make sure, but that’s just me being paranoid and a double-checker by nature :wink: )

Another tip, to easily find out the UUID of your partitions without all sorts of other extra information you don’t need for this purpose: lsblk -o name,uuid

1 Like

@dalto
On my other computer i have the Btrfs setup with luks encryption and snapshots with timeshift as per the wiki. It also has a 4TB extra drive on it. Am i able to do the same setup on it or not?

Edit:
I also just updated to the 5.12.8 kernel and on eos xfce and also cinnamon i am able to browse and use the 4TB drive without adding it to fstab. Strange? This is on the same computer with kde all on separate drives. It’s running rEFInd and each has their own grub.

Yes, none of that should make much difference with adding a drive. You can do it the same if you wish. Just keep in mind that if you using btrfs snapshots in timeshift, the new drive won’t be part of the snapshots.

No, that makes sense. Your UID on all three installs is probably the same(1000) so the ownership change we made impacts all three. I would still mount it in /etc/fstab so it has a permanent mount location that is the same on all 3 installs.

I’m not sure as these are all on separate drives. How would the command affect the other two? Also of note i just tried my other Intel computer which also has a 4TB drive in it and it automatically works also on eos xfce. That is the one that has the btrfs setup on it as a dual boot with Windows which is also on a separate drive. :thinking:

I am assuming that the ‘extra’ drive is in ext4. If it is formatted there is no reason it shouldn’t ‘just work’ - it just won’t have the links active to make it easy to use, apparently within /home. It will just be mounted, probably as /run/media something…

Once you decide what you want, it will be little trouble to make it so!

But the thing is it wouldn’t work on Kde. I couldn’t access it and i have another system with xfce and same issue. I can’t access it. But on this system xfce and cinnamon i can access it and on my other Intel system with xfce i can access it. I didn’t have to set it up in fstab. It’s just weird. I don’t get it. Every system is exactly the same set up.

That is a matter of the defaults of the different DEs as far as auto-mounting what can be found. If you put it in /etc/fstab, it will be the same in ALL DEs, and will appear exactly the same. If you use the symlinks, it will appear in your /home/username directory - while still being accessible by the ‘mount name’ in fstab - for instance as /mnt/data if you set it up like mine. Your choice - your builds! :grin: