Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] Funny setup
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
wilsonsamm
Apprentice
Apprentice


Joined: 12 Jul 2008
Posts: 196

PostPosted: Fri Jun 13, 2014 8:59 pm    Post subject: [solved] Funny setup Reply with quote

I did a gentoo install as per the handbook, except that instead of mounting a fresh partition, I simply used a folder on me NFS share, and instead of booting from Gentoo's Live CD, I did it all in the Debian system that runs on the same server that the NFS share is done from. Then, I use rsync to copy the gentoo system to my other computer (the reason is that the server I talk about is always on anyway, so it has time to do some compiling, Plus it is loads faster than the laptop where I want to use Gentoo.)

On my laptop, which dual boots debian and gentoo, I have the following script to copy the Gentoo operating system from the share.
Code:
rsync -aP --delete /mnt/share/stage4 /mnt/gentoo


When I run this, I get a million lines like this:
Code:
rsync: send_files failed to open "/mnt/share/stage4/etc/sudoers": Permission denied (13)

Obviously, there is some permission problem preventing some things from copying. Because the system boots OK, but X cannot start because
Code:
# which X
which: no X in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin)


even though I did merge X, as shown when I ssh into the server and chroot into where I installed gentoo.
Code:
# which X
/usr/bin/X


I suspect that the problem is that I installed gentoo and am copying it as a different user. This explains the permissions problem earlier. So can I safely change the ownership of all the files in the gentoo folder so that they will copy properly?


Last edited by wilsonsamm on Sat Jun 21, 2014 7:32 am; edited 1 time in total
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 13830

PostPosted: Fri Jun 13, 2014 10:15 pm    Post subject: Reply with quote

Files are installed with correct ownership and that ownership should be preserved. Changing the ownership to allow them to copy is absolutely the wrong solution. Did you do your copy as an unsquashed root user?
Back to top
View user's profile Send private message
wilsonsamm
Apprentice
Apprentice


Joined: 12 Jul 2008
Posts: 196

PostPosted: Sat Jun 14, 2014 5:52 am    Post subject: Reply with quote

Hu wrote:
Did you do your copy as an unsquashed root user?

Not too sure what "unsquashed" is, but the situation on debian is that the root user is disabled soo that you have to sudo everything. That rsync up there I put in an executable file called update-gentoo.sh, and then I do sudo update-gentoo.sh.
Back to top
View user's profile Send private message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Sat Jun 14, 2014 7:36 am    Post subject: Reply with quote

wilsonsamm wrote:
...the situation on debian is that the root user is disabled soo that you have to sudo everything...


Code:
sudo su
Back to top
View user's profile Send private message
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1746

PostPosted: Sat Jun 14, 2014 9:41 am    Post subject: Reply with quote

if that share is NFS, make sure it's defined (server side) with "no_root_squash" option. This will allow you full access over network. Also, you might want to restrict it with "ro" (read only) to prevent unintended changes.

I think debian does not allow running GUI as root. It's only possible to run a particular application with kdesu or gsudo or something like that by default. Security reasons, AKA "if you can't work in text mode, you don't know what you're doing, and should not be here so go back to unpriviliged account"
Back to top
View user's profile Send private message
cwr
Veteran
Veteran


Joined: 17 Dec 2005
Posts: 1969

PostPosted: Sat Jun 14, 2014 3:06 pm    Post subject: Reply with quote

I'm not sure if the Gentoo (or sysrescue) DVD can mount NFS shares, but if they can,
that would be one way of copying and preserving permissions. Boot from the DVD,
mount the exported NFS, mount the target partition and (as root) use eg:
Code:

    cd /source ; tar cf - * | (cd /target ; tar xpf -)

to copy the root filesystem across. Note the 'p' flag, which preserves permissions.
I do the same trick with a filesystem exported via CIFS.

(You can also copy using cp, but I don't know the flags off the top of my head.)

Will
Back to top
View user's profile Send private message
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1746

PostPosted: Sat Jun 14, 2014 10:07 pm    Post subject: Reply with quote

Quote:
'm not sure if the Gentoo (or sysrescue) DVD can mount NFS shares,

Every problem has a solution. If there is no solution, it is not a problem :D

DO NOT USE UNLESS YOU KNOW WHAT WILL HAPPEN
on target:
nc -l 6660 | tar -xpv
on source:
tar -cf - ./ | nc <target IP> 6660


You can also enable gzip at will, but it's not very likely to help a lot over LAN (feel free to measure and report though), and I'm pretty sure bzip would slow it down.
Back to top
View user's profile Send private message
wilsonsamm
Apprentice
Apprentice


Joined: 12 Jul 2008
Posts: 196

PostPosted: Sat Jun 21, 2014 7:31 am    Post subject: Reply with quote

szatox wrote:
if that share is NFS, make sure it's defined (server side) with "no_root_squash" option. This will allow you full access over network. Also, you might want to restrict it with "ro" (read only) to prevent unintended changes.


Thanks, that's done the trick beautifully.
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