LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-12-2008, 04:26 AM   #1
ibkoxls
Member
 
Registered: Jun 2007
Posts: 34

Rep: Reputation: 15
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)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.
 
Old 07-12-2008, 05:20 AM   #2
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
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).
 
Old 07-12-2008, 05:50 AM   #3
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
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.

Last edited by Larry Webb; 07-12-2008 at 05:53 AM.
 
Old 07-13-2008, 11:01 AM   #4
PingFloyd
Member
 
Registered: Jun 2006
Posts: 94

Rep: Reputation: 16
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.
 
Old 07-13-2008, 11:08 AM   #5
Su-Shee
Member
 
Registered: Sep 2007
Location: Berlin
Distribution: Slackware
Posts: 510

Rep: Reputation: 53
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.
 
Old 07-18-2008, 06:39 AM   #6
ibkoxls
Member
 
Registered: Jun 2007
Posts: 34

Original Poster
Rep: Reputation: 15
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.
 
Old 07-18-2008, 11:02 AM   #7
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
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.
 
Old 08-09-2008, 03:42 AM   #8
ibkoxls
Member
 
Registered: Jun 2007
Posts: 34

Original Poster
Rep: Reputation: 15
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: BRM Blowback LXer Syndicated Linux News 0 04-02-2008 08:42 PM
Cure for distro-hopping phantom_cyph General 60 12-29-2007 10:08 PM
LXer: DistroWatch Weekly: Distro hopping, Linux Format's distro mega-test LXer Syndicated Linux News 0 06-11-2007 04:47 AM
Easiest way of distro hopping? varaonaid Linux - Distributions 4 04-18-2007 06:04 AM
Distro Hopping.... bestmehr Linux - General 3 12-12-2003 07:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration