LINUX LITE 7.2 FINAL RELEASED - SEE RELEASE ANNOUNCEMENTS SECTION FOR DETAILS


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem creating symlinks to shared data partition
#1
With help from gold_finger and others I have successfully installed Linux Lite and Linux Mint, each in its own partition, alongside Windows 7 on my laptop - using EasyBCD to keep the original Windows MBR intact and with each Linux distro's Grub in the same partition as its OS.  It all works fine.

Again with the help of gold_finger's guidance in this thread,  I also set up a shared DATA partition which Lite, Mint, and any other distros could use.  It is located at /mnt/DATA.  I used "chown" to ensure that my username was the owner.  Then in each of both Linux Lite and Linux Mint I deleted the Docs/Pics/etc folders which were in the /home area, created folders with those names in the DATA partition, went into the terminal and used the command

Code:
ln - s /mnt/DATA/Documents /home/username
 

to create a symlink for each of the folders which I wanted to have shared by both distros.  All worked fine, and in the /home of both Lite and Mint I now have symlinks which point to the relevant folder in the DATA partition, and i am able to save files into them.

All that is background...... to the problem I have now run into.

I have just installed PCLinuxOS into its partition and set it up to boot just like the others via EasyBCD.  It works well.  So I thought it would be simple to do the same symlinking so that any files I create or save in PCLinuxOS can also be stored in the same, shared, DATA partition.

Well, so far it hasn't quite worked.  I decided to do the links one at a time.  So I followed the same steps:

- I deleted the Documents folder in the PCLinuxOS /home;
- as there is already a Documents folder in the shared DATA partition, I then simply did the
Code:
ln - s/
command in the terminal.

Didn't work.  Some kind of a link appeared in the PCLOS /home.  But the icon was for a "text" (not the usual folder icon), and it had a red "X", and under Properties it said the link was broken.  And the link didn't work.

In trying to figure this out, I noticed two things:

1) Although I had set up the DATA partition, and both Lite and Linux see it, as being at /mnt/DATA/....,  in the PCLOS file manager its location shows up as /media/DATA/....

2) In both Lite and Mint file managers the Properties>Permissions of both the DATA partition and the folders in it are shown as being owned by me (my username).  But in the PCLOS file manager the owner is shown as
Quote:1000 - user #1000
, and the Group (whatever that is!) as 1000.

In an attempt to experiment and troubleshoot, I then did the same
Code:
ln - s
command but this time with the different path indicated by PCLOS (/media/DATA... instead of /mnt/DATA).  This appeared to create a proper symlink with the proper icon in /home.  But under Properties> Permissions, the owner is shown again as
Quote:1000 - user#1000
.  And when I tried to save a test file into that symlinked folder, a popup said that I could not do so because I (under my own username) do not have the permissions necessary.

So..... I'm faced with two challenges.

First, if I want when using PCLOS to be able to access and save documents etc into the shared DATA partition folders, do I have to somehow change the ownership of those folders?  But (big if....) if I do so, how do I do so - in PCLOS only?  And will that render them inaccessible or invisible when I'm in Lite or Mint?  I should say that I have the same username, which is /brian, in all three distros). 

Second (although this is really a question for the PCLOS forum) is there another way to create symlinks using the GUI rather than the command line?  I have noticed that if I right click on a folder in my PCLOS /home, it offers me the option to "Make Link".  But if I go to the folders in the DATA partition while working in PCLOS and right click, the "Make Link" option is greyed out.

The questions seem a bit complicated.  Perhaps the answers are nice and simple.  I live in hope!
Reply
#2
Hi br1nstorm,

User name is not the important parameter when it comes to permissions etc. It's the UID (user ID) and GID (group ID).

So, the first step for me would be to check the UID/GID on your PCLinuxOS installation and compare it with the other installations.
You can do so by typing into a terminal
Code:
id

Hope that helps as a first step Smile
Reply
#3
Thanks LL-user, I'm ready to try any steps which will explain and untangle my situation.

I ran the "id" command in the PCLOS terminal and this is what I got (you'll obviously see that my username is "brian"):

Code:
uid=500(brian) gid=500(brian) groups=500(brian),
7(lp),19(floppy),22(cdrom),80(cdwriter),81(audio),82(video),83(dialout),100(users),496(polkituser),501(fuse)

Same command in my Mint terminal gives the following:
Code:
uid=1000(brian) gid=1000(brian)
groups=1000(brian),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),107(lpadmin),110(sambashare)

And in Linux Lite, exactly the same as Mint except for "...109(lpadmin)" where Mint has 107.

So while this doesn't mean a whole lot to me, I can of course see that the UID and GID in PCLOS are different from those in my Mint and Lite setups.

The question is, what should I now do?  The logical conclusion would seem to be that I ought to change the UID and GID in my PCLOS installation.  Is this possible, and not too difficult?  I don't want to break anything.  And I suppose I should change the "groups" number or ID too?  How easy or complicated is such action?

I don't want to do anything that will mess up my Mint and Lite setups, both of which work well.  PCLOS is a third option as OS which I will use much less often.  So while it would be nice to set up working symlinks to enable it to access and share the existing DATA partition used by Mint and Lite, this isn't absolutely vital. I'd just like to tidy things up, if I can do so without too much complicated work....
Reply
#4
As long as you don't touch you LL and Mint configuration or run some wild permission/ownership commands on your data files you won't mess up LL and Mint Smile

There are many ways to skin a cat...

Here are a few:

1. on the UID/GID level - three ways with increasing intrusive changes on your current PCLOS installation:

a) You change the UID/GID of your user brian in PCLOS. This would require you to also change UID/GID for all his files on PCLOS outside of his home folder.

b) You create a new user with the desired UID/GID (1000/1000) and you're good to go.

c) You re-install the system and add the user brian with the desired UID/GID straight away. According to http://www.pclinuxos.com/forum/index.php?topic=135248.0
"You can specify the GID on the first boot of a new install while adding a user, there is a box near the bottom to tick and you can enter a custom GID"

So it depends on how much time your already spent on customization of the current installation and how comfortable you are to work through a few steps on the command line. Your choice Smile

2. on the mount level

With a bit of work on your /etc/fstab file you could mount the desired folders via bindfs so that brian can read/write to them.


Feel free to ask more questions if you want to know more respectively I'm talking French.
If you're not afraid of CLI then I'd suggest to go with 1a).
But, it's your choice ... all ways above will skin the cat Smile
Reply
#5
Thanks, LL-user, I have been skinning the cat!  I'm pleased to say I have succeeded without too much fur flying around, and with no lasting claw-marks.

On the K.I.S.S principle, I went for what seemed to be the easiest option - your 1 (a).  Not too demanding, as I had only just installed PCLOS and so had not customised the installation nor (as user "brian") generated any files and certainly stored nothing outside the /home folder.

On the detail of exactly how to change the UID and GID I sought a little bit of advice from colleagues in the PCLOS forum (as I had never done this before...).  Apparently Ubuntu-based distros' default setting is 1000, while PCLOS' default is 500.  As you noted (your 1.©), if I had I known I could have set, or changed, the default "500" to 1000 during the initial process of PCLOS installation.

Anyway, all I had to do was login as root and edit two files in the /etc/ directory to change the UID and GID numbers, and then do a "chown" command.  Details (for anyone else who needs to do something similar) are at http://www.pclinuxos.com/forum/index.php...237.0.html.  (Old Polack is an absolute fount of good advice on the PCLOS forum). I logged back in as user (brian) and that was it, job done!  Less confusing than creating a new user, and less hassle than reinstalling.

So all is now sorted, cat is skinned, and we're good to go.  Thanks very much for pointing me in the right direction - much appreciated.  I'll mark this thread solved....
Reply
#6
Great you got it sorted! Well done Smile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)