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

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 #60 on: July 18, 2018, 09:59:19 am »
Quote
To test this, please run these 4 commands
Code: [Select]

touch ~/Documents/pcnetspec-test.txt
touch ~/Music/pcnetspec-test.txt
touch ~/Pictures/pcnetspec-test.txt
touch ~/Videos/pcnetspec-test.txt

Now I'm assuming there is a copy of a file called "pcnetspec-test.txt" in the 4 folders in your home directory, but NOT in the same 4 directories in /mnt/DATA .. am I right ?

and.....
Quote
I'm betting the first 4 of those return something, but the last 4 throw a "doesn't exist" error .. am I right ?

Yes, you are correct to both

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26452
  • 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 #61 on: July 18, 2018, 10:50:48 am »
Okay run these 4 commands in sequence
Code: [Select]
mv -v ~/Documents ~/Documents-old && ln -s /mnt/DATA/Documents ~/Documentsthen
Code: [Select]
mv -v ~/Music ~/Music-old && ln -s /mnt/DATA/Music ~/Musicthen
Code: [Select]
mv -v ~/Pictures ~/Pictures-old && ln -s /mnt/DATA/Pictures ~/Picturesthen
Code: [Select]
mv -v ~/Videos ~/Videos-old && ln -s /mnt/DATA/Videos ~/Videosif you get any errors, post them here

If you get no errors, post the output from:
Code: [Select]
ls -al ~/ | grep "\->"and confirm those 4 folders in your home folder now have an arrow on them AND CONTAIN ALL YOUR STUFF .. be 100% positive of this because the next step is going to be to delete the folder copies that now end with "-old".
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 #62 on: July 18, 2018, 11:23:44 am »
Quote
If you get no errors, post the output from:
Code: [Select]
ls -al ~/ | grep "\->"
lrwxrwxrwx  1 gerry gerry      17 Jul 17 18:23 Desktop -> /mnt/DATA/Desktop
lrwxrwxrwx  1 gerry gerry      19 Jul 18 11:13 Documents -> /mnt/DATA/Documents
lrwxrwxrwx  1 gerry gerry      17 Jun 14 08:37 .face.icon -> /home/gerry/.face
lrwxrwxrwx  1 gerry gerry      15 Jul 18 11:14 Music -> /mnt/DATA/Music
lrwxrwxrwx  1 gerry gerry      18 Jul 18 11:14 Pictures -> /mnt/DATA/Pictures
lrwxrwxrwx  1 gerry gerry      16 Jul 18 11:14 Videos -> /mnt/DATA/Videos

All folders (on right only) have little arrows and DO contain all my stuff.... I have made a backup on a separate drive just in case

 

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26452
  • 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 #63 on: July 18, 2018, 01:29:39 pm »
Okay feel free to delete the directories
~/Desktop-old
~/Documents-old
~/Music-old
~/Pictures-old
~/Videos-old




You appear to be missing one "Downloads"

If you want that one too...

a) Create a directory at:-
/mnt/DATA/Downloads

b) Copy anything in
~/Downloads
into it.

c) Run:
Code: [Select]
mv -v ~/Downloads ~/Downloads-old && ln -s /mnt/DATA/Downloads ~/Downloadsd) When you're sure the symlink is working, feel free to delete
~/Downloads-old
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 #64 on: July 18, 2018, 05:44:56 pm »
Old directories deleted.  I never use Downloads folder, I always have anything I download go to the desktop, but thanks for the catch.

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26452
  • 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 #65 on: July 19, 2018, 07:03:09 am »
Okay, all done :)

Next time you reinstall, make sure you keep the DATA partition .. then it'll simply be a case of mounting it in your fresh install, then recreating the symlinks.



In fact it'd be possible to share the DATA partition and folders across more than one distro if you multi boot.
(though unless the UUID's are the same you may need to make it read/writeable by anyone)
« Last Edit: July 19, 2018, 07:07:33 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 #66 on: July 19, 2018, 09:10:36 pm »
Thank you PCNetSpec for the baby steps tutorial.

Offline AndyInMokum

  • Global Moderator
  • Hero
  • *****
  • Posts: 4889
  • Karma: 1058
  • "Keep on Rockin' in the Free World"
    • View Profile
  • Peppermint version(s): PM 9 & PM 10 (64-bit)
Re: How To: Use symlinks to a DATA partition
« Reply #67 on: July 19, 2018, 10:41:20 pm »
That's great.  After PCNetSpec has sorted out the issue with your symlinks, you'll need to change the Block Device Method of mounting devices, to the far safer, UUID Method.  This done by making some small edits to the /etc/fstab file  ;).

Run, (Copy & Paste) the following command into a terminal window:
Code: [Select]
sudo xed /etc/fstabAt the bottom of file that opens, you'll find the lines:
Code: [Select]
# DATA partition /dev/sda4 is at /mnt/DATA ...
/dev/sda4   /mnt/DATA   ext4   noatime,defaults   0  0
replaced (Copy & Paste) them with:
Code: [Select]
# User defined DATA partition. Created by "ogopogo".  Mount point is at /mnt/DATA ...
UUID=0bf84ff1-6444-4549-8d0c-8e23295d477b /mnt/DATA ext4 defaults 0 2
To minimize any errors, please Copy & Paste the amendment to the file.  Save and exit the xed text editor.  That should set the content /etc/fstab to remain stable.

For extra credit, here are a couple of links that explain adding items to /etc/fstab.  It's a really handy thing to learn about: How To Add Items To The Fstab File In Linux and Introduction to fstab  ;).

Now PCNetSpec has sorted your symlink tangle out  :).  Remember to make the above edit to your /etc/fstab file.  It'll ensure your /DATA partition mounts smoothly every time you boot up ;)

What you've done to your system, is a very simple, very sensible and very slick modification - congratulations  ;).  It'll save you so much time when it comes to installing the next version of Peppermint.  Plus you could do some distro hopping, (if you can tear yourself away from Peppermint :)) ) with the confidence you're not going to run into conflicts, or more importantly, loss of data.   If you need any further help, or simply some advice, don't hesitate in letting us know  ;).

If you're happy with the solution.  Could you please remember to mark the topic as [SOLVED] in the subject line of the original post?   Many thanks  ;).
« Last Edit: July 19, 2018, 10:50:49 pm by AndyInMokum »
Backup! Backup! Backup! If you're missing any of these -  you ain't Backed Up!
For my system info please L/click HERE.

Offline murraymint

  • Trusted User
  • Veteran
  • *****
  • Posts: 2170
  • Karma: 455
  • 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 #68 on: July 20, 2018, 05:34:16 am »
I'm asking if you use an SSD because you're applying noatime to the /DATA partition.

That's because he followed Slim's tutorial to the letter.

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26452
  • 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 #69 on: July 20, 2018, 09:07:29 am »
Thank you PCNetSpec

You're most welcome ogopogo :)
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 #70 on: July 20, 2018, 05:44:01 pm »
AndyInMokum      Thank you for the reminder.... all done.

Quote
If you're happy with the solution.  Could you please remember to mark the topic as [SOLVED] in the subject line of the original post?   Many thanks  ;).

Being that I didn't start the post and just adding to SlimFat's post, do I mark my first  post or his at  the beginning of the tutorial?

Offline murraymint

  • Trusted User
  • Veteran
  • *****
  • Posts: 2170
  • Karma: 455
  • 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 #71 on: July 20, 2018, 06:03:48 pm »
No, don't worry about it for a tutorial.

Offline AndyInMokum

  • Global Moderator
  • Hero
  • *****
  • Posts: 4889
  • Karma: 1058
  • "Keep on Rockin' in the Free World"
    • View Profile
  • Peppermint version(s): PM 9 & PM 10 (64-bit)
Re: How To: Use symlinks to a DATA partition
« Reply #72 on: July 20, 2018, 06:10:29 pm »
AndyInMokum      Thank you for the reminder.... all done.

Quote
If you're happy with the solution.  Could you please remember to mark the topic as [SOLVED] in the subject line of the original post?   Many thanks  ;).

Being that I didn't start the post and just adding to SlimFat's post, do I mark my first  post or his at  the beginning of the tutorial?

My bad, it's as murraymint says.  Doh  :-X!
« Last Edit: July 20, 2018, 06:12:05 pm by AndyInMokum »
Backup! Backup! Backup! If you're missing any of these -  you ain't Backed Up!
For my system info please L/click HERE.

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 #73 on: September 20, 2018, 06:10:35 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?   

Offline Brotherred

  • Member
  • ***
  • Posts: 349
  • Karma: 11
  • No0b
    • View Profile
  • Peppermint version(s): Pep 8 on 386, Pep 10 on AMD 64
Re: How To: Use symlinks to a DATA partition
« Reply #74 on: September 20, 2018, 06:15:27 pm »
It just me perhaps. But I would tell VirtualBox to store the VM folder/ image  in your data partition, if /home  storage is that limited.

Sent from my SM-N920V using Tapatalk
« Last Edit: September 20, 2018, 06:21:31 pm by Brotherred »
"Those that don't know pay for it. My currency is pride"