LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Distro-hopping blowback (https://www.linuxquestions.org/questions/linux-general-1/distro-hopping-blowback-655266/)

ibkoxls 07-12-2008 04:26 AM

Distro-hopping blowback
 
Hello,

I have installed a number of distros on my laptop and I've encountered a difficulty which I'd like to find a way around.

I've found that I have to create a new user everytime I install a new distro; I want a situation whereby I can re-use users (no pun intended:D)I created earlier since all the relevant files are on a dedicated /home
partition.

I always use the KDE desktop for uniformity's sake. So, please how do I get round this?

Thanks.

pinniped 07-12-2008 05:20 AM

Well, there's no easy way. The best you can do is write a small script which edits the /etc/passwd, /etc/group, and /etc/shadow files to create all the users using the same UIDs and GIDs. This actually takes a bit of thought because different distros use different UID and GIDs for the common 'system' users (disk, dip, audio, etc ...) and use a different range for normal users (for example, I think with Debian the users start with UID=1000).

Larry Webb 07-12-2008 05:50 AM

The simplest work around I have found is to make a separate data only partition and keep all shared files in it. Even if you do write a script and change one distro you would have to edit it. If you make a separate data partition say to put all your documents folder in and keep your desktop clean you can get by with a 12 gig home and this will let you download dvds. I use a fat 32 file system on the data partition because my wife still uses windows for her photos and the printer. Linux and windows will read the fat 32 without adding any programs.

PingFloyd 07-13-2008 11:01 AM

useradd -u is going to be you friend here. For instance you may have /home/joe. If there isn't any user joe yet in the newer distro, you should be able to see it's /home/$uid when you ls -l. so when you recreate joe on the other system you'll use useradd -u $uid. So if joe is uid 1000, it would be useradd -u 1000. Joe in this case already had a homedir so there isn't much point in using the -d option. It's probably a good idea not to.

If, when you ls -l /home, you don't see the user directory named as the uid, then look in /etc/passwd of the distro that already has that user set up to see what the uid should be.

Anyway, bring up man useradd so you can see the options you'll need to use.

Su-Shee 07-13-2008 11:08 AM

I simply put /home on a partition I never touch but just mount into all the different Linuxes I have.

Same goes for /var/data with all data stuff I don't want to loose.

After that, I just useradd with all the same gid/uid.

ibkoxls 07-18-2008 06:39 AM

Thanks to everyone that replied.

I chose to adopt Larry's suggestion (I like simple:)) and now I've run into a snafu.

I copied the files on an existing home partition with ext3 filesystem into a folder on a USB stick, then transferred that folder to a new system. I copied the files to a fat32 data partition, installed a couple of distros, and created a soft link user desktop to the folder on the data partition.

The snafu is that the files open as read-only, so I can't modify them. I even tried to save them with a different name but that hasn't worked out either. I know the issue must be with file/directory permissions.
I've run chmod 777 as root but still, no dice. I even edited fstab as follows:
/dev/hdb1 /mnt/win vfat auto,rw 0 0

How do I get out of this scenario? How do I prevent a re-occurence?

Thank you.

Larry Webb 07-18-2008 11:02 AM

I never have tried a folder at a time, my guess is bring the folder back into an ext3 file system and check all your files and get the permissions then move the entire folder back to fat 32.

ibkoxls 08-09-2008 03:42 AM

Solved!
 
Hi Larry,

I'm sorry it took this long for me to reply. I finally found a solution.

I use the chmod command to grant a user permissions on a file or directory.

In summary, in order to solve the distro-hopping blowback issue, do the following:

1. Store all your files in a separate folder on your home partition. (for example, if my user name was ibkoxls for instance, all my documents, mp3's etc. will be stored in /home/Files, not /home/ibkoxls/ Note that 'Files' is not a user account, just a directory, you should use your root account to create it.)

2. In your user accounts across the distros on your box, just make a link to /home/Files and run the following command as root:

chmod a+rwxs path to Files

That does the trick (in my experience). Let me know if it works for you.

Thanks to everyone who contributed or viewed this thread.


All times are GMT -5. The time now is 02:38 PM.