Author Topic: How To: Use symlinks to a DATA partition  (Read 21335 times)

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26437
  • Karma: 65531
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: How To: Use symlinks to a DATA partition
« Reply #75 on: September 20, 2018, 07:19:10 pm »
Not sure if I should start another thread but it has to do with symlinks.

I just installed Oracle VM Virtualbox and created a Windows 7 VM with the help of PCNetSpec.

What I didn't realize at the time was that it was installed to my Home partition which is only 18 GB and as I copied some large files to the desktop it gave me an error saying that it was full.

Seeing as how I have my files all saved in a separate DATA partition (776 GB remaining) , can I also do this  (symlink) the Virtualbox VMs folder that contains the Windows 7 OS  .vbox and .vmdk files to the DATA partition as well?

You certainly can :)

Move the Virtualbox VMs folder to your DATA partition .. then create a symlink to it in your home folder

Be sure to do this with Virtualbox NOT RUNNING



If you have any problems creating the symlink, let us know the full path to the Virtualbox VMs folder that's now on your DATA partition (this will depend on where you mounted the DATA partition).

If you're unsure, post the output from
Code: [Select]
mount
« Last Edit: September 20, 2018, 07:22:58 pm by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline ogopogo

  • Member
  • ***
  • Posts: 54
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 9
Re: How To: Use symlinks to a DATA partition
« Reply #76 on: September 20, 2018, 08:49:43 pm »
Quote
You certainly can :)

Move the Virtualbox VMs folder to your DATA partition .. then create a symlink to it in your home folder

Be sure to do this with Virtualbox NOT RUNNING

No problem moving the folder but having trouble with the symlink.

When I go to step #4 of this tutorial  (page #1) under the heading "CREATE SYMLINKS TO YOUR DATA PARTITION" it says:

Code: [Select]
ln -s /mnt/DATA/Documents Documents
Now my folder is called "VirtualBox VMs" so I substituted "Documents" as follows:

Code: [Select]
ln -s /mnt/DATA/VirtualBox VMs VirtualBox VMs
But what I got was:
Code: [Select]
ln: target 'VMs' is not a directory
If I leave out the space and call it:

Code: [Select]
ln -s /mnt/DATA/VirtualBoxVMs VirtualBoxVMs
The symlink file made in my home folder is "broken" as it doesn't exist.

So, seems like I need for you to spell it out for me....the output of mount is:

Code: [Select]
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=3768108k,nr_inodes=942027,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=766572k,mode=755)
/dev/sda3 on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,rdma)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=24,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=14262)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
mqueue on /dev/mqueue type mqueue (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
sunrpc on /run/rpc_pipefs type rpc_pipefs (rw,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
configfs on /sys/kernel/config type configfs (rw,relatime)
/dev/sda4 on /mnt/DATA type ext4 (rw,relatime,data=ordered)
/dev/sda2 on /home type ext4 (rw,relatime,stripe=32750,data=ordered)
/dev/sda1 on /boot/efi type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=766568k,mode=700,uid=1000,gid=1000)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
/dev/fuse on /run/user/1000/doc type fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)

« Last Edit: September 20, 2018, 08:56:43 pm by ogopogo »

Offline murraymint

  • Trusted User
  • Veteran
  • *****
  • Posts: 2200
  • Karma: 458
  • soft boiled with a yolk of gold
    • View Profile
  • Peppermint version(s): 7, 8, 9
Re: How To: Use symlinks to a DATA partition
« Reply #77 on: September 21, 2018, 01:22:02 am »
Precede spaces in a path with a backslash

Code: [Select]
ln -s /mnt/DATA/VirtualBox\ VMs VirtualBox\ VMs

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26437
  • Karma: 65531
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: How To: Use symlinks to a DATA partition
« Reply #78 on: September 21, 2018, 07:00:12 am »
it's the whitespace in the filename that's giving you problems .. you can escape the whitespace as in murraymints command above.

or

just make sure the paths are surrounded by quotation marks .. as in:
Code: [Select]
ln -s "/mnt/DATA/VirtualBox VMs" "VirtualBox VMs"
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline ogopogo

  • Member
  • ***
  • Posts: 54
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 9
Re: How To: Use symlinks to a DATA partition
« Reply #79 on: September 21, 2018, 09:01:15 am »
Thanks guys, it worked!

Offline ogopogo

  • Member
  • ***
  • Posts: 54
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 9
Re: How To: Use symlinks to a DATA partition
« Reply #80 on: January 02, 2019, 09:59:00 am »
Hello!    I've just downloaded the latest version of "Peppermint-9-20181222-amd64" and am ready to do a fresh install. I've been running the previous version of Peppermint 9 now with no problems and have all my files in a DATA partition..... thanks to the wonderful help I received from here.   :)

Before I continue with following the symlinks tutorial, I was just wondering if there is anything updated or special I might need to do before I continue?
Thank you in advance.

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26437
  • Karma: 65531
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: How To: Use symlinks to a DATA partition
« Reply #81 on: January 03, 2019, 09:19:07 am »
Nope, the instructions should still remain the same .. in fact they should always remain the same and are not specific to Peppermint, they should be applicable to all Linux distros :)

Although, there's a new "Respin-2" of Peppermint 9 out dated (20190102), you can read about why here:
https://peppermintos.com/2019/01/peppermint-9-respin-2-released/
If you've already installed (20181222) there is absolutely no need to reinstall .. there are no changes other than some fixes for the installation routine
« Last Edit: January 03, 2019, 09:21:05 am by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline ogopogo

  • Member
  • ***
  • Posts: 54
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 9
Re: How To: Use symlinks to a DATA partition
« Reply #82 on: January 03, 2019, 11:12:10 am »
Thank you for your reply PCNetSpec.
None of the fixes apply to me and I'm limited with my bandwidth so I'll go ahead with the .iso I already have.  8)

Offline Slim.Fatz

  • Global Moderator
  • Veteran
  • *****
  • Posts: 2395
  • Karma: 633
  • Where's the mouse?
    • View Profile
  • Peppermint version(s): Peppermint 7, 8.5 & 10 - 64bit
Re: How To: Use symlinks to a DATA partition
« Reply #83 on: July 21, 2020, 01:02:29 am »
Hi everyone,

Although not stated specifically in the tutorial, it also applies to all released "respins" of previous PeppermintOS versions.

Regards,

-- Slim
Respect science, respect nature, respect each other.

Tread lightly: Fluxbox, JWM, i3, Openbox, awesome

Offline Sgt_Pepper

  • Newly Subscribed
  • *
  • Posts: 18
  • Karma: 6
  • It was twenty years ago today
    • View Profile
  • Peppermint version(s): Peppermint 10 respin
Re: How To: Use symlinks to a DATA partition
« Reply #84 on: November 14, 2020, 10:56:51 am »
Hello everyone and a very special thank you to Slim for creating this great tutorial.  It's definitely stood the test of time over the last five years and using symlinks has me intrigued.  I've been using Peppermint since February and am new to the forum and am a bit confused about the best backup strategy and protecting data from hard drive failure or an experiment gone wrong.  What are the main advantages of using symlinks to a data partition rather than creating a separate home partition?

I created a separate home partition during the installation of Peppermint 10 respin to keep the system and my data separate from the beginning. I've been using Deja dup to back up data but a few things such as whether I should be just backing up the "data files" rather than the entire home partition aren't clear to me in case I have to restore the system--could I just reinstall/upgrade Peppermint and use my old home partition with the fresh installation or is this asking for trouble?  For this very reason, I started a thread on the "new users" section on the Peppermint forum:

https://forum.peppermintos.com/index.php/topic,10097.0.html

I would be really grateful if someone could share their thoughts on this or if using symlinks is the better way to go. I'm sure there's more than one way to achieve this but my biggest concern is whether backing up my entire home partition would be recognized with a new installation/version of Peppermint or if it's going to mess up things because of some old configuration files...

Thank you for your help!



 

Offline Slim.Fatz

  • Global Moderator
  • Veteran
  • *****
  • Posts: 2395
  • Karma: 633
  • Where's the mouse?
    • View Profile
  • Peppermint version(s): Peppermint 7, 8.5 & 10 - 64bit
Re: How To: Use symlinks to a DATA partition
« Reply #85 on: November 15, 2020, 08:27:59 am »
Hi Sgt_Pepper,

I'm very happy to read your appreciation of the tutorial. Thank you very much for the kind words!  :)

While there is no really best way to set up your partitions, the way I describe in the tutorial is very good and has stood the test of time. The main improvement that one might consider making (as a private home user -- web server users or users with large data base applications usually have different requirements that this tutorial was not intended to solve) is to create a separate /home partition and then put the symlinks to the data partition files in that /home partition. The /home partition is primarily then your repository for the configuration files for most programs and can be backed up itself -- but I advise strongly that you do not use these configuration files (i.e. this /home partition) with any other linux distros or even any other versions of PeppermintOS. The reason is that different distros and even different versions of the same distro can use different program versions that frequently have different configuration files or different config file syntax. This can and has resulted in sometimes very difficult to solve issues. Therefore, other linux distros or other versions of PeppermintOS should get and use their own /home partition.

Regards,

-- Slim
Respect science, respect nature, respect each other.

Tread lightly: Fluxbox, JWM, i3, Openbox, awesome

Offline Sgt_Pepper

  • Newly Subscribed
  • *
  • Posts: 18
  • Karma: 6
  • It was twenty years ago today
    • View Profile
  • Peppermint version(s): Peppermint 10 respin
Re: How To: Use symlinks to a DATA partition
« Reply #86 on: November 15, 2020, 12:47:56 pm »
Hi Slim,

Thank you for your clear explanation on the reasoning behind using symlinks.  :)   It seems like a very elegant solution and how one could avoid problems down the road.  I'm a home user and don't generate massive amounts of data, nor do I have multiple distros sharing the same partition but it makes a lot of sense to me to separate data from the root partition.  This has saved me numerous times since the days of XP.   :D

One thing that still has me a bit puzzled is under what circumstances I could restore my entire home partition.  :-\ From my understanding, in order to restore one's home partition, it would have to be the exact same version of Peppermint (in my case, PM 10 respin) or whatever distro one is using.  However, it seems that one's root partition is much more likely to become unbootable or seriously borked than the home partition getting trashed and that brings to mind, my next question.  If I re-install a sparkling fresh version of PM 10 respin, could I keep using my old home partition or would I need to have cloned the latest "image" of my root partition?

Sorry for all the questions and if I've strayed too far from symlinks but this has got me more than a bit confused.

Thanks again for any suggestions or wisdom that you could pass on.   ;D

   

Offline alynur

  • Trusted User
  • Veteran
  • *****
  • Posts: 1289
  • Karma: 151
  • Habitual Forum Browser
    • View Profile
  • Peppermint version(s): P 9R (64bit), P 10
Re: How To: Use symlinks to a DATA partition
« Reply #87 on: November 27, 2020, 10:16:43 am »
Hi Slim,

Thank you for your clear explanation on the reasoning behind using symlinks.  :)   It seems like a very elegant solution and how one could avoid problems down the road.  I'm a home user and don't generate massive amounts of data, nor do I have multiple distros sharing the same partition but it makes a lot of sense to me to separate data from the root partition.  This has saved me numerous times since the days of XP.   :D

One thing that still has me a bit puzzled is under what circumstances I could restore my entire home partition.  :-\ From my understanding, in order to restore one's home partition, it would have to be the exact same version of Peppermint (in my case, PM 10 respin) or whatever distro one is using.  However, it seems that one's root partition is much more likely to become unbootable or seriously borked than the home partition getting trashed and that brings to mind, my next question.  If I re-install a sparkling fresh version of PM 10 respin, could I keep using my old home partition or would I need to have cloned the latest "image" of my root partition?

Sorry for all the questions and if I've strayed too far from symlinks but this has got me more than a bit confused.

Thanks again for any suggestions or wisdom that you could pass on.   ;D

   

Hi Sgt_Pepper, so as not to clutter this tutorial with unessensual discussions in reguards to the tutorial, could you open a related topic in a different section like General Discussions, or something like that?
What was I thinking?

Offline straybit

  • Member
  • ***
  • Posts: 53
  • Karma: 9
  • New To PeppermintOS
    • View Profile
    • Middleton Post 39
  • Peppermint version(s): 10
Re: How To: Use symlinks to a DATA partition
« Reply #88 on: November 29, 2020, 09:59:48 am »
Hi, Slim,

I have used your wonderful How To to create a Data partition and it works great with a minor difficulty:  I have found one office suite that doesn't recognize/use symlinks.  WPS Office requires that I save to ~/Documents and, after I close that file in WPS, copy the file to the Data directory.  For me, that is a minor inconvenience.

If I click on the file in Data, modify it, and save - it will be saved in the Data directory. 

Bruce

Offline Slim.Fatz

  • Global Moderator
  • Veteran
  • *****
  • Posts: 2395
  • Karma: 633
  • Where's the mouse?
    • View Profile
  • Peppermint version(s): Peppermint 7, 8.5 & 10 - 64bit
Re: How To: Use symlinks to a DATA partition
« Reply #89 on: November 29, 2020, 01:19:41 pm »
Hi straybit,

Thanks for the update. That's interesting, to say the least.  :o Since I never have used (and have no plans to ever use) WPS, I can only say that your solution is perhaps the best one.

But one question: if you have created a symlink in your home directory called Documents (which means that you actually no longer have a real Documents directory in your home, but only the symlink that carries that name) and it  points to the directory Documents (that you created in your data partiltion) then how are you managing to save any WPS docs at all?  :-\

Regards,

-- Slim
Respect science, respect nature, respect each other.

Tread lightly: Fluxbox, JWM, i3, Openbox, awesome