Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
mini-HOWTO: Installing Gentoo on slow machines
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Sheepdogj15
Guru
Guru


Joined: 07 Jan 2005
Posts: 430
Location: Backyard

PostPosted: Fri Oct 28, 2005 4:30 am    Post subject: Reply with quote

for a general NFS howto, i recommend this: http://gentoo-wiki.com/HOWTO_Share_Directories_via_NFS

also, my old proxy method used NFS... the general principle is the same:
https://forums.gentoo.org/viewtopic-t-319841.html


the LiveCD comes with NFS and needed kernel modules, you just have to make sure you configure /etc/exports and start the daemons before you chroot in (i figure it should go without saying, but some people just don't know better :? )

make sure you start portmap on the client computer, as it's a prerequisite to mounting nfs shares.
_________________
Sheepdog
Why Risk It? | Samba Howto
Back to top
View user's profile Send private message
struhs
n00b
n00b


Joined: 14 Jun 2005
Posts: 44

PostPosted: Fri Oct 28, 2005 6:41 am    Post subject: Reply with quote

Sheepdogj15 wrote:
for a general NFS howto, i recommend this: http://gentoo-wiki.com/HOWTO_Share_Directories_via_NFS
the LiveCD comes with NFS and needed kernel modules,


So, I don't have to install a base system on the notebook and can do e.g. "emerge -e system" from my (powerful) desktop PC? Everything I have to do is to chroot from desktop PC to notebook?

Sheepdogj15 wrote:
for a general NFS howto, i recommend this: http://gentoo-wiki.com/HOWTO_Share_Directories_via_NFS
you just have to make sure you configure /etc/exports and start the daemons before you chroot in (i figure it should go without saying, but some people just don't know better :? )


Is /etc/exports located on a ramfs (because I can't change a CD-file)? Or are you talking about /mnt/gentoo/etc/exports (but this would not help with the live CD - NFS, right?)?
Back to top
View user's profile Send private message
Sheepdogj15
Guru
Guru


Joined: 07 Jan 2005
Posts: 430
Location: Backyard

PostPosted: Sat Oct 29, 2005 9:35 pm    Post subject: Reply with quote

struhs wrote:
So, I don't have to install a base system on the notebook and can do e.g. "emerge -e system" from my (powerful) desktop PC? Everything I have to do is to chroot from desktop PC to notebook?


if i understand what you mean, it depends on what method you use.

Quote:
Is /etc/exports located on a ramfs (because I can't change a CD-file)? Or are you talking about /mnt/gentoo/etc/exports (but this would not help with the live CD - NFS, right?)?


hmmm. i could have sworn the version in RAM was writable. (fyi, it's ramdisk, not ramfs)

what you may have to do is install a basic (stage3?) install of Gentoo, chroot in, emerge nfs-utils, then setup the nfs exports.

i could have sworn that last time i did this, it wasn't so convolutied :?
_________________
Sheepdog
Why Risk It? | Samba Howto
Back to top
View user's profile Send private message
struhs
n00b
n00b


Joined: 14 Jun 2005
Posts: 44

PostPosted: Tue Nov 01, 2005 6:01 pm    Post subject: Reply with quote

I have managed the connection, but I always get errors if I am using emerge (some read error). Will post error messages on saturday if possible.
Back to top
View user's profile Send private message
Sheepdogj15
Guru
Guru


Joined: 07 Jan 2005
Posts: 430
Location: Backyard

PostPosted: Tue Nov 01, 2005 8:02 pm    Post subject: Reply with quote

not to preempt you, but root will need write access to the remote computer. in your /etc/exports, make sure you have no_root_squash and rw as options for the share(s)


and just a general comment to the thread, if you have different parts of your filesystem on different partitions, you will want to share them individually. NFS doesn't seem to share beyond the partition that the directory is on that you want to share (it's possible there is just a setting that i missed, but i wouldn't know what one)

for instance, i have to share /, /usr, /var, and /tmp individually in /etc/exports
_________________
Sheepdog
Why Risk It? | Samba Howto
Back to top
View user's profile Send private message
struhs
n00b
n00b


Joined: 14 Jun 2005
Posts: 44

PostPosted: Wed Nov 02, 2005 4:00 pm    Post subject: Reply with quote

Sheepdogj15 wrote:
not to preempt you, but root will need write access to the remote computer. in your /etc/exports, make sure you have no_root_squash and rw as options for the share(s)


I have done that.

Sheepdogj15 wrote:

and just a general comment to the thread, if you have different parts of your filesystem on different partitions, you will want to share them individually. NFS doesn't seem to share beyond the partition that the directory is on that you want to share (it's possible there is just a setting that i missed, but i wouldn't know what one)

for instance, i have to share /, /usr, /var, and /tmp individually in /etc/exports


I'll check/test this as soon as I am back at my desktop PC (this weekend). But I had just one root-partition (/) and the boot-partition (/boot) and I don't think that emerge is accessing the boot-partition.
Back to top
View user's profile Send private message
Sheepdogj15
Guru
Guru


Joined: 07 Jan 2005
Posts: 430
Location: Backyard

PostPosted: Wed Nov 02, 2005 8:17 pm    Post subject: Reply with quote

yeah. portage would only need access to /boot if you were installing grub or another bootloader. you can also compile kernels over NFS so there may be an advantage to making /boot a share.

like i said, that was just a general comment.

hmm, not sure what else could be wrong. what's your local fstab entry look like for the remote share? when you mount it, can you write to it as root? (e.g., make a text file in /mnt/[nfs-share]/root/)
_________________
Sheepdog
Why Risk It? | Samba Howto
Back to top
View user's profile Send private message
struhs
n00b
n00b


Joined: 14 Jun 2005
Posts: 44

PostPosted: Sun Nov 06, 2005 1:50 pm    Post subject: Reply with quote

Here are the errors I get if I try to emerge gnome-light:

Code:

close failed: [Errno 9] Bad file descriptor
close failed: [Errno 9] Bad file descriptor
Calculating dependencies ...done!
>>> emerge (1 of 49) media-libs/libid3tag-0.15.1b to /
close failed: [Errno 9] Bad file descriptor
close failed: [Errno 9] Bad file descriptor
close failed: [Errno 9] Bad file descriptor


... then it compiles and then it stops...

Code:

>>> Completed installing libid3tag-0.15.1b into /var/tmp/portage/libid3tag-0.15.1b/image/

>>> Merging media-libs/libid3tag-0.15.1b to /
--- /usr/
--- /usr/lib/
>>> /usr/lib/libid3tag.la
--- /usr/lib/pkgconfig/
>>> /usr/lib/pkgconfig/id3tag.pc
>>> /usr/lib/libid3tag.a
>>> /usr/lib/libid3tag.so.0.3.0
>>> /usr/lib/libid3tag.so.0 -> libid3tag.so.0.3.0
--- /usr/share/
--- /usr/share/doc/
>>> /usr/share/doc/libid3tag-0.15.1b/
>>> /usr/share/doc/libid3tag-0.15.1b/VERSION.gz
>>> /usr/share/doc/libid3tag-0.15.1b/README.gz
>>> /usr/share/doc/libid3tag-0.15.1b/TODO.gz
>>> /usr/share/doc/libid3tag-0.15.1b/CREDITS.gz
>>> /usr/share/doc/libid3tag-0.15.1b/CHANGES.gz
--- /usr/include/
>>> /usr/include/id3tag.h
>>> /usr/lib/libid3tag.so -> libid3tag.so.0.3.0
Traceback (most recent call last):
  File "/usr/bin/emerge", line 3200, in ?
    mydepgraph.merge(mydepgraph.altlist())
  File "/usr/bin/emerge", line 1912, in merge
    retval=portage.doebuild(y,"merge",myroot,self.pkgsettings,edebug)
  File "/usr/lib/portage/pym/portage.py", line 2724, in doebuild
    return merge(mysettings["CATEGORY"],mysettings["PF"],mysettings["D"],mysettings["BUILDDIR"]+"/build-info",myroot,mysettings,myebuild=mysettings["EBUILD"])
  File "/usr/lib/portage/pym/portage.py", line 2896, in merge
    return mylink.merge(pkgloc,infloc,myroot,myebuild)
  File "/usr/lib/portage/pym/portage.py", line 6893, in merge
    return self.treewalk(mergeroot,myroot,inforoot,myebuild,cleanup=cleanup)
  File "/usr/lib/portage/pym/portage.py", line 6567, in treewalk
    mylock = portage_locks.lockfile(destroot+CONFIG_MEMORY_FILE)
  File "/usr/lib/portage/pym/portage_locks.py", line 93, in lockfile
    fcntl.lockf(myfd,fcntl.LOCK_EX|fcntl.LOCK_NB)
IOError: [Errno 37] No locks available
close failed: [Errno 9] Bad file descriptor


I have write access to the root directory on the notebook.

I think that something is wrong. Googled for that error, but was unable to find something about it.

Regards,
Stefan
Back to top
View user's profile Send private message
struhs
n00b
n00b


Joined: 14 Jun 2005
Posts: 44

PostPosted: Sun Nov 06, 2005 3:02 pm    Post subject: Reply with quote

Solved the problem:

"nolock" in the mount - command for each share solves the problem.
Back to top
View user's profile Send private message
Sheepdogj15
Guru
Guru


Joined: 07 Jan 2005
Posts: 430
Location: Backyard

PostPosted: Mon Nov 07, 2005 1:11 am    Post subject: Reply with quote

yup... i had that problem too. it seems to be a problem (not sure if it's a bug or intentional) in NFS. :?
_________________
Sheepdog
Why Risk It? | Samba Howto
Back to top
View user's profile Send private message
Iron_DragonLord
Apprentice
Apprentice


Joined: 04 Nov 2004
Posts: 273

PostPosted: Sun Feb 19, 2006 6:19 am    Post subject: Reply with quote

Hi, I found a solution to the "close failed: [Errno 9] Bad file descriptor" and other problems is to start /etc/init.d/nfsmount (emerge -av nfs-utils)

Hope that helps.
Back to top
View user's profile Send private message
aries
Tux's lil' helper
Tux's lil' helper


Joined: 03 May 2004
Posts: 127
Location: Sliedrecht the Netherlands

PostPosted: Wed May 17, 2006 5:12 pm    Post subject: Reply with quote

Maybe a slight off topic, but at least it has something todo with it.

How can one pass commands from the old root into the new one after chroot?

I want to build a script that:
1 chroots
2 update portage
3 emerge -buqD world
4 sync's builded packages with a server

But already at point 2 i run iinto problems after chroot nothin happens.
This is the script:
Code:
mount -o bind /mnt/S3_packs  /mnt/ix86/i586_S3/usr/portage/packages
mount -o bind /usr/portage/distfiles   /mnt/ix86/i586_S3/usr/portage/distfiles
mount -o bind /var/tmp/portageP3  /mnt/ix86/i586_S3/var/tmp/portage

mount -t proc none /mnt/ix86/i586_S3/proc
mount -o bind /dev /mnt/ix86/i586_S3/dev
chroot /mnt/ix86/i586_S3 /bin/bash
env-update && source /etc/profile

#2
emerge --sync

emerge sync happens only if I exit out of the new root.

How can I execute this in the new root environment?
Back to top
View user's profile Send private message
chrbecke
Guru
Guru


Joined: 12 Jul 2004
Posts: 598
Location: Berlin - Germany

PostPosted: Wed May 17, 2006 5:54 pm    Post subject: Reply with quote

aries,

you have to use two scripts: one that does the chroot, and another one that does the "emerge --sync" and so on in the chrooted environment.

chroot.sh - script that chroot's like in your example:
Code:
#!/bin/bash
mount -o bind /mnt/S3_packs  /mnt/ix86/i586_S3/usr/portage/packages
mount -o bind /usr/portage/distfiles   /mnt/ix86/i586_S3/usr/portage/distfiles
mount -o bind /var/tmp/portageP3  /mnt/ix86/i586_S3/var/tmp/portage

mount -t proc none /mnt/ix86/i586_S3/proc
mount -o bind /dev /mnt/ix86/i586_S3/dev

# Note: path to sync_and_stuff.sh must be relative to your new root,
# i.e. with /mnt/ix86/i586_S3/ as your new root and your script
# at /mnt/ix86/i586_S3/sync_and_stuff.sh, use /sync_and_stuff.sh

chroot /mnt/ix86/i586_S3 /bin/bash /sync_and_stuff.sh


sync_and_stuff.sh - script that does things in the chroot environment:
(place this script as /mnt/ix86/i586_S3/sync_and_stuff.sh)
Code:
#!/bin/bash
env-update && source /etc/profile
emerge --sync
echo "Done with syncing, spawning an interactive shell"
echo "Note that you have to \"env-update && source /etc/profile\" again in this shell!"
/bin/bash -i


This should do what you want.


HTH,

Christian

edit: fixed script path
Back to top
View user's profile Send private message
aries
Tux's lil' helper
Tux's lil' helper


Joined: 03 May 2004
Posts: 127
Location: Sliedrecht the Netherlands

PostPosted: Thu May 18, 2006 5:02 pm    Post subject: Reply with quote

It did help!

Excactly what I was looking for.
Thanks for your help Christian (and for polishing the script).

Aries
Back to top
View user's profile Send private message
slycordinator
Advocate
Advocate


Joined: 31 Jan 2004
Posts: 3059
Location: Korea

PostPosted: Fri May 19, 2006 6:07 am    Post subject: Re: mini-HOWTO: Installing Gentoo on slow machines Reply with quote

chrbecke wrote:
1) Chroot on desktop box
Emerge everything in a chroot on my desktop box, make a tarball and copy it over to the target box. To update it, build binary packages in the chroot
Code:
emerge -b <package>
and install them (they're located in /usr/portage/packages, btw.) with
Code:
emerge -k <package>
.

Advantage:

    * definitly the fastest way

Disadvantage:

    * need to keep a copy of the whole target box' filesystem on my desktop box for later updates


I do a similar thing.

In the chroot, emerge all the packages I want. Then, outside the chroot, I use rsync to update the slow box.
Back to top
View user's profile Send private message
slycordinator
Advocate
Advocate


Joined: 31 Jan 2004
Posts: 3059
Location: Korea

PostPosted: Fri May 19, 2006 6:09 am    Post subject: Reply with quote

aries wrote:
emerge sync happens only if I exit out of the new root.

How can I execute this in the new root environment?


Well you gotta be more descriptive than that. What actually happens when you do "emerge --sync"?

Any particular errors?
Back to top
View user's profile Send private message
aries
Tux's lil' helper
Tux's lil' helper


Joined: 03 May 2004
Posts: 127
Location: Sliedrecht the Netherlands

PostPosted: Fri May 19, 2006 12:21 pm    Post subject: Reply with quote

It is solved for me!
My script was simply wrong no particular errors.

The two scripts given by chrbecke were the solution:
Code:
#!/bin/bash
 mount -o bind /mnt/S3_packs  /mnt/ix86/i586_S3/usr/portage/packages
 mount -o bind /usr/portage/distfiles   /mnt/ix86/i586_S3/usr/portage/distfiles
 mount -o bind /var/tmp/portageP3  /mnt/ix86/i586_S3/var/tmp/portage
 
 mount -t proc none /mnt/ix86/i586_S3/proc
 mount -o bind /dev /mnt/ix86/i586_S3/dev
 
 # Note: path to sync_and_stuff.sh must be relative to your new root,
 # i.e. with /mnt/ix86/i586_S3/ as your new root and your script
 # at /mnt/ix86/i586_S3/sync_and_stuff.sh, use /sync_and_stuff.sh
 
 chroot /mnt/ix86/i586_S3 /bin/bash /sync_and_stuff.sh

Code:
#!/bin/bash
 env-update && source /etc/profile
 emerge --sync
 echo "Done with syncing, spawning an interactive shell"
 echo "Note that you have to \"env-update && source /etc/profile\" again in this shell!"
 /bin/bash -i


This was my problem:
With my own script:
Code:
mount -o bind /mnt/S3_packs  /mnt/ix86/i586_S3/usr/portage/packages
 mount -o bind /usr/portage/distfiles   /mnt/ix86/i586_S3/usr/portage/distfiles
 mount -o bind /var/tmp/portageP3  /mnt/ix86/i586_S3/var/tmp/portage
 
 mount -t proc none /mnt/ix86/i586_S3/proc
 mount -o bind /dev /mnt/ix86/i586_S3/dev
 chroot /mnt/ix86/i586_S3 /bin/bash
 env-update && source /etc/profile
 
 #2
 emerge --sync

This happened:
1. chroot into new enveronment
2. nothing happened!
3. exit out of the 'new' environment
4.... and now the emerge --sync etc. started, but I wanted it to run under 2
Back to top
View user's profile Send private message
vanten
n00b
n00b


Joined: 08 Jan 2006
Posts: 44
Location: Sweden

PostPosted: Sun May 21, 2006 1:29 pm    Post subject: Reply with quote

*Bookmarked*
_________________
.: GNU/Linux :: Gentoo :: Fluxbox :.
.: BSD :: OpenBSD :: Fluxbox :.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
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