Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] tip for the n00b
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
seneca
n00b
n00b


Joined: 10 Apr 2013
Posts: 53

PostPosted: Thu Apr 11, 2013 12:00 am    Post subject: [solved] tip for the n00b Reply with quote

Here is a small tip for those like me, who will run through the installation process several times in a virtual environment before committing the distribution to hard disk (highly recommended as Gentoo is anything but an out-of-the-box distribution...)

Make a folder "distfiles" in the shared folder of your virtual machine and copy all the distfiles from /usr/portage/distfiles to the new folder e.g. from the /usr/portage/distfiles in terminal type "cp -R * /path/to/shared/distfiles_folder". Do this with every form of install you do, like gnome 2 & 3, kde, etc.

Next, sudo su yourself and delete the distfiles folder under /usr/portage e.g. "rm -R /usr/portage/distfiles"

Finally, create a symlink to the distfiles in your shared folder from /usr/portage e.g. "ln -s /path/to/shared/distfiles_folder distfiles"

Purpose of this, twofold
1. you can do multiple runs of installing and learning the ins and outs of updating without burdening the public gentoo servers with each new install or attempt at updating
2. will reduce the size of your virtual machines significantly, which is important if you keep multiple versions

BTW, also recommended as a learning tool to really get your hands dirty with world updates, do a LiveDVD to hard disk copy. The gentoo gurus don't recommend this method for real installs, and they have good reasons, but definitely a great way to practice the multiple issues that come up when trying to update a system... conflicts to resolve all over the place and great fun.

I hope this helps someone and that a gentoo user with more experience corrects the mistakes I made above. Enjoy Gentoo


Last edited by seneca on Sat Apr 13, 2013 10:53 pm; edited 2 times in total
Back to top
View user's profile Send private message
simon_irl
Guru
Guru


Joined: 07 Oct 2004
Posts: 403
Location: New Zealand

PostPosted: Thu Apr 11, 2013 12:36 am    Post subject: Reply with quote

The separate distfiles folder is definitely a good tip. Another reason for keeping distfiles separate is that they're always available from elsewhere so it's a waste of time and disk space to back them up. When you back up your system (as you should be doing, of course), you can image the partition that actually needs to be backed up, while leaving the 4 or 5 gig of distfiles on another partition with iso's and other stuff that doesn't need to be backed up due to its availability elsewhere. So, the principle you're discussing in terms of virtual machine images also applies to live systems on hard disk partitions.
Back to top
View user's profile Send private message
khayyam
Advocate
Advocate


Joined: 07 Jun 2012
Posts: 2344

PostPosted: Thu Apr 11, 2013 7:17 am    Post subject: Re: tip for the n00b Reply with quote

seneca wrote:
[...] Gentoo is anything but an out-of-the-box distribution

seneca ... it does come in a box, but its one of those boxes with a jack-in-the-box inside ... good for parties :)

best ... khay
Back to top
View user's profile Send private message
seneca
n00b
n00b


Joined: 10 Apr 2013
Posts: 53

PostPosted: Fri Apr 12, 2013 2:50 pm    Post subject: Reply with quote

well, the tip is almost good as is, but one big issue remains: portage permissions to write to the linked distfiles folder... can read from the folder ok but can't add packages to it.

I created the link as root after deleting the original folder in /usr/portage, and subsequently the link's owner and group is root (not portage, unlike the rest of the folders in /usr/portage).

In addition, the Shared folder is in the local users home, so the owner and group of the Shared folder is the local user.

I tried a chown of the link to the portage user and group, but still get a permission denied error. I then tried to also chown the Shared and distfiles folders to portage, but that part didn't work at all, the owner and group still belonging the local user even though I did the chown as root.

In short, portage is denied permission to download new packages into the linked distfiles folder. Any thoughts on how to do this right?
Back to top
View user's profile Send private message
Jimmy Jazz
Apprentice
Apprentice


Joined: 04 Oct 2004
Posts: 274
Location: Strasbourg

PostPosted: Fri Apr 12, 2013 2:58 pm    Post subject: Reply with quote

seneca wrote:
well, the tip is almost good as is, but one big issue remains: portage permissions to write to the linked distfiles folder... can read from the folder ok but can't add packages to it.


try mount --bind olddir newdir

man mount
_________________
« La seule condition au triomphe du mal, c'est l'inaction des gens de bien » E.Burke
Code:

+----+----+----+
|    |::::|    |
|    |::::|    |
+----+----+----+

motto: WeLCRO
WritE Less Code, Repeat Often
Back to top
View user's profile Send private message
seneca
n00b
n00b


Joined: 10 Apr 2013
Posts: 53

PostPosted: Fri Apr 12, 2013 6:04 pm    Post subject: Reply with quote

thank you for the response, Jazz

the --bind mounts the folder alright, and I would guess it is needed as it is not a block device, but the permissions remain unchanged. Portage can read from the folder but it can't download new packaged into it.

Any other thoughts?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 32457
Location: 56N 3W

PostPosted: Fri Apr 12, 2013 7:30 pm    Post subject: Reply with quote

seneca,

Is Virtualbox set to allow write access to the shared folder?

Also, the permissions on symlinks are never used.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
seneca
n00b
n00b


Joined: 10 Apr 2013
Posts: 53

PostPosted: Sat Apr 13, 2013 7:16 am    Post subject: Reply with quote

Neddy!!! I can't believe I have your attention. Heard great things about you and a real pleasure it is to meet you.

Yes, the Shared folder is read/write; using the latest version of virtualbox with Linux Mint Debian Edition as the host, if that helps in any way - trying to do away with windows, the LMDE is a first step towards running Gentoo once I understand it enough to manage maintenance. Could the problem be that I was root when I made the symlink? Then again, as per your statement, symlinks might not care about that. Driving me nuts! I tried everything I could think off, which is not much, granted. Would be great if we could make this work.
Back to top
View user's profile Send private message
Jimmy Jazz
Apprentice
Apprentice


Joined: 04 Oct 2004
Posts: 274
Location: Strasbourg

PostPosted: Sat Apr 13, 2013 10:09 am    Post subject: Reply with quote

It cannot be a symlink issue. Could you test one/some of the following ?

set the sticky bit to the folder group and/or uid and make it writable and owned by portage
set chmod 1777 to the directory and try to write on it.
set the gid and uid options mount if the filesystem understands it.
the user belongs to the group portage
use xattr or acl
_________________
« La seule condition au triomphe du mal, c'est l'inaction des gens de bien » E.Burke
Code:

+----+----+----+
|    |::::|    |
|    |::::|    |
+----+----+----+

motto: WeLCRO
WritE Less Code, Repeat Often
Back to top
View user's profile Send private message
seneca
n00b
n00b


Joined: 10 Apr 2013
Posts: 53

PostPosted: Sat Apr 13, 2013 11:58 am    Post subject: Reply with quote

Hello, Jimmy Jazz (luv the name)

You speak the tongue of someone far beyond an apprentice... kudos to you :^)

I presume by sticky you mean the symlink. I chown user and group to portage already, but it didn't help with the problem. Subsequently I tried to do the same on the Shared folder it linked to, but the chown didn't stick, and remains owned by the local user. I will keep working on that, but it might be a virtualbox issue

I did a chmod 755 $(find /usr/portage/<the_symlink_distfiles> -type d) and to be complete a chmod 666 $(find /usr/portage/<the_symlink_distfiles> -type f) also, but that didn't change anything either. I will try doing that directly on the Shared folder distfiles too.

I mounted the Shared folder distfiles to /usr/portage/distfiles, after deleting the symlink and making a new distfiles folder back in /usr/portage owned by portage, using -o uid=1000,gid=1000,exec,rw, but that didn't work either. I will do it again to make sure the owner was in fact portage.

The user belongs to portage and wheel already, but I do all the emerges from root directly, not from sudo. I will gpasswd myself into both again to make sure.

I will try all the above over the weekend to make sure I did it correctly before wasting more of your time. If you see mistakes in what I did above, please correct me.

The last suggestion is over my head (a real n00b here) but I will read about xattr and acl to see what I can do with them, which is the one of the main reasons I like portage so much, you learn and learn and learn some more.
Back to top
View user's profile Send private message
krinn
Advocate
Advocate


Joined: 02 May 2003
Posts: 4433

PostPosted: Sat Apr 13, 2013 12:29 pm    Post subject: Reply with quote

test with
FEATURES="-distlocks" emerge -f somepackage
Back to top
View user's profile Send private message
seneca
n00b
n00b


Joined: 10 Apr 2013
Posts: 53

PostPosted: Sat Apr 13, 2013 10:51 pm    Post subject: Reply with quote

Fixed. I have no idea why it didn't work before but this worked:

1, added another shared folder in virtualbox, this one directly to the distfiles folder on the host (the first attempt was a subfolder)
2. added the distfiles share to fstab to mount on the user's home directory and with options rw,uid=1000,gid=1000,auto,exec. The folder in the local user's home for the mount was created by the user and is owned by the local user
3, as root deleted the /usr/portage/distfiles folder and also as root created the symlink (ln -s) to the distfiles folder in the local user's home

that was simple and case closed. works perfectly

thank you both for the help (will keep reading on the extended attribues anyway, as I guess one should know about such things)

be well
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum