Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Risolto] Problema chroot
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian)
View previous topic :: View next topic  
Author Message
zar Marco
Guru
Guru


Joined: 09 Sep 2016
Posts: 445
Location: Colle Umberto ( TV )

PostPosted: Thu Nov 24, 2016 3:54 pm    Post subject: [Risolto] Problema chroot Reply with quote

Ciao ragazzi, ormai non so dove sbattere la testa, vi allego i miei tentativi di accedere a gentoo da arch tramite chroot http://pastebin.com/P2b66hRe
Ho provato in vari tentativi, ho seguito la wiki di gentoo, ma all'ingresso in chroot se do env-update mi da l'errore che si vede nel pastebin. Posso procedere ed anche usare emerge, ma se faccio una modifica ad un file che prevede etc-update, questo comando restituisce lo stesso errore. Sapete come posso fare?


Last edited by zar Marco on Tue Dec 06, 2016 5:13 am; edited 1 time in total
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30915
Location: here

PostPosted: Thu Nov 24, 2016 4:12 pm    Post subject: Reply with quote

Prova a vedere qua (sinceramente io sono sempre partito da livecd), soprattutto questa parte
gentoo wiki wrote:
Once the resize has finished, boot back into the old Linux as described. Then go to The Gentoo Handbook: Preparing the Disks and follow the instructions. When chrooting, use the following command to flush the environment:

root #env -i HOME=$HOME TERM=$TERM chroot /mnt/gentoo /bin/bash
root #/usr/sbin/env-update
root #source /etc/profile

_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
zar Marco
Guru
Guru


Joined: 09 Sep 2016
Posts: 445
Location: Colle Umberto ( TV )

PostPosted: Thu Nov 24, 2016 4:17 pm    Post subject: Reply with quote

fedeliallalinea wrote:
Prova a vedere qua (sinceramente io sono sempre partito da livecd), soprattutto questa parte
gentoo wiki wrote:
Once the resize has finished, boot back into the old Linux as described. Then go to The Gentoo Handbook: Preparing the Disks and follow the instructions. When chrooting, use the following command to flush the environment:

root #env -i HOME=$HOME TERM=$TERM chroot /mnt/gentoo /bin/bash
root #/usr/sbin/env-update
root #source /etc/profile


No no non mi serve per installare, ma per gestire gentoo mentre sto lavorando con arch. Ci do un occhio ugualmente ma in installazione non ebbi problemi con chroot, grazie per l'aiuto
Back to top
View user's profile Send private message
sabayonino
Veteran
Veteran


Joined: 03 Jan 2012
Posts: 1014

PostPosted: Thu Nov 24, 2016 11:51 pm    Post subject: Reply with quote

il Wiki Gentoo indica :

mount --make-rslave ....


e non

mount --make-slave

(questo se si accede a chroot con systemd)

Man mount
Quote:
The shared subtree operations.
Since Linux 2.6.15 it is possible to mark a mount and its submounts as shared, private, slave or unbindable. A shared mount provides the ability to create mirrors of that mount such
that mounts and unmounts within any of the mirrors propagate to the other mirror. A slave mount receives propagation from its master, but not vice versa. A private mount carries no
propagation abilities. An unbindable mount is a private mount which cannot be cloned through a bind operation. The detailed semantics are documented in Documentation/filesys‐
tems/sharedsubtree.txt file in the kernel source tree.

Supported operations are:

mount --make-shared mountpoint
mount --make-slave mountpoint
mount --make-private mountpoint
mount --make-unbindable mountpoint

The following commands allow one to recursively change the type of all the mounts under a given mountpoint.

mount --make-rshared mountpoint
mount --make-rslave mountpoint
mount --make-rprivate mountpoint
mount --make-runbindable mountpoint


il percorso di bash (o qualsiasi altro comando) è comunque rilevabile con :
Code:
# whereis bash
bash: /bin/bash /etc/bash /usr/share/man/man1/bash.1.bz2 /usr/share/info/bash.info.bz2



Qui c'è un warning se si accede al chroot da un sistema non-gentoo-based:
Quote:
Note
The --make-rslave operations are needed for systemd support later in the installation.
Warning
When using non-Gentoo installation media, this might not be sufficient. Some distributions make /dev/shm a symbolic link to /run/shm/ which, after the chroot, becomes invalid. Making /dev/shm/ a proper tmpfs mount up front can fix this:
root #rm /dev/shm && mkdir /dev/shm
root #mount -t tmpfs -o nosuid,nodev,noexec shm /dev/shm

Also ensure that mode 1777 is set
root # chmod 1777 /dev/shm

_________________
LRS i586 on G.Drive
LRS x86-64 EFI on MEGA
Back to top
View user's profile Send private message
zar Marco
Guru
Guru


Joined: 09 Sep 2016
Posts: 445
Location: Colle Umberto ( TV )

PostPosted: Fri Nov 25, 2016 8:17 am    Post subject: Reply with quote

sabayonino wrote:
il Wiki Gentoo indica :

mount --make-rslave ....


e non

mount --make-slave

(questo se si accede a chroot con systemd)

Man mount
Quote:
The shared subtree operations.
Since Linux 2.6.15 it is possible to mark a mount and its submounts as shared, private, slave or unbindable. A shared mount provides the ability to create mirrors of that mount such
that mounts and unmounts within any of the mirrors propagate to the other mirror. A slave mount receives propagation from its master, but not vice versa. A private mount carries no
propagation abilities. An unbindable mount is a private mount which cannot be cloned through a bind operation. The detailed semantics are documented in Documentation/filesys‐
tems/sharedsubtree.txt file in the kernel source tree.

Supported operations are:

mount --make-shared mountpoint
mount --make-slave mountpoint
mount --make-private mountpoint
mount --make-unbindable mountpoint

The following commands allow one to recursively change the type of all the mounts under a given mountpoint.

mount --make-rshared mountpoint
mount --make-rslave mountpoint
mount --make-rprivate mountpoint
mount --make-runbindable mountpoint


il percorso di bash (o qualsiasi altro comando) è comunque rilevabile con :
Code:
# whereis bash
bash: /bin/bash /etc/bash /usr/share/man/man1/bash.1.bz2 /usr/share/info/bash.info.bz2



Qui c'è un warning se si accede al chroot da un sistema non-gentoo-based:
Quote:
Note
The --make-rslave operations are needed for systemd support later in the installation.
Warning
When using non-Gentoo installation media, this might not be sufficient. Some distributions make /dev/shm a symbolic link to /run/shm/ which, after the chroot, becomes invalid. Making /dev/shm/ a proper tmpfs mount up front can fix this:
root #rm /dev/shm && mkdir /dev/shm
root #mount -t tmpfs -o nosuid,nodev,noexec shm /dev/shm

Also ensure that mode 1777 is set
root # chmod 1777 /dev/shm


Ciao e grazie mille, quando fai riferimento a systemd, intendi nel sistema ospitante o in gentoo?
Back to top
View user's profile Send private message
sabayonino
Veteran
Veteran


Joined: 03 Jan 2012
Posts: 1014

PostPosted: Fri Nov 25, 2016 11:03 am    Post subject: Reply with quote

Quote:
The --make-rslave operations are needed for systemd support later in the installation.


Gentoo
_________________
LRS i586 on G.Drive
LRS x86-64 EFI on MEGA
Back to top
View user's profile Send private message
zar Marco
Guru
Guru


Joined: 09 Sep 2016
Posts: 445
Location: Colle Umberto ( TV )

PostPosted: Fri Nov 25, 2016 11:24 am    Post subject: Reply with quote

ok grazie, proverò
Back to top
View user's profile Send private message
zar Marco
Guru
Guru


Joined: 09 Sep 2016
Posts: 445
Location: Colle Umberto ( TV )

PostPosted: Tue Dec 06, 2016 5:13 am    Post subject: Reply with quote

Ho risolto, sbagliavo scrivendo slave invece di rslave come scritto da @sabayonino
Back to top
View user's profile Send private message
zar Marco
Guru
Guru


Joined: 09 Sep 2016
Posts: 445
Location: Colle Umberto ( TV )

PostPosted: Wed Dec 14, 2016 9:13 am    Post subject: Reply with quote

Ciao, scusate se riapro questa discussione.
Sto tentando di rientare in gentoo da arch con chroot. Mi connetto e tutto ma ho un problema con un repo esterno al momento del sync. Il repo in questione, se entro da gentoo non mi da alcun errore.
Questo è il codice di errore che mi da
Code:
(chroot) arch / # emerge --sync
>>> Syncing repository 'gentoo' into '/usr/portage'...
!!! getaddrinfo failed for 'rsync.at.gentoo.org': [Errno -3] Temporary failure in name resolution
Do you want to sync your Portage tree with the mirror at
rsync://rsync.at.gentoo.org/gentoo-portage/? [Yes/No] y
>>> Starting rsync with rsync://rsync.at.gentoo.org/gentoo-portage/...
rsync: getaddrinfo: rsync.at.gentoo.org 873: Temporary failure in name resolution
rsync error: error in socket IO (code 10) at clientserver.c(125) [Receiver=3.1.2]
>>> Retrying...
!!! Exhausted addresses for rsync.at.gentoo.org
>>> Syncing repository 'gentoo-italia' into '/var/lib/repos/gentoo-italia'...
/usr/bin/git pull
fatal: unable to access 'https://github.com/hexvar/gentoo-italia/': Couldn't resolve host 'github.com'
!!! git pull error in /var/lib/repos/gentoo-italia
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30915
Location: here

PostPosted: Wed Dec 14, 2016 10:19 am    Post subject: Reply with quote

Code:
>>> Syncing repository 'gentoo' into '/usr/portage'...
....
rsync: getaddrinfo: rsync.at.gentoo.org 873: Temporary failure in name resolution
...
fatal: unable to access 'https://github.com/hexvar/gentoo-italia/': Couldn't resolve host 'github.com'


Ti funziona la rete? Se dai un ping github.com risolve il nome?
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
zar Marco
Guru
Guru


Joined: 09 Sep 2016
Posts: 445
Location: Colle Umberto ( TV )

PostPosted: Wed Dec 14, 2016 10:38 am    Post subject: Reply with quote

Allora dal teminale in chroot non riesco a pingare neppure google. Nel terminale diciamo normale riesco a pingare. Mi sa che è un problema di connessione allora, ma devo capire come mai. Se provo a dare un ifconfig mi vede connesso.
Questo è l'output del ping
Code:
(chroot) arch / # ping www.google.com
ping: unknown host www.google.com


Con github il risultato è lo stesso
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30915
Location: here

PostPosted: Wed Dec 14, 2016 10:51 am    Post subject: Reply with quote

In /etc/resolv.conf cosa hai impostato?
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
zar Marco
Guru
Guru


Joined: 09 Sep 2016
Posts: 445
Location: Colle Umberto ( TV )

PostPosted: Wed Dec 14, 2016 11:02 am    Post subject: Reply with quote

quel file mi risulta vuoto
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30915
Location: here

PostPosted: Wed Dec 14, 2016 11:04 am    Post subject: Reply with quote

zar Marco wrote:
quel file mi risulta vuoto

Prima di fare il chroot copialo da arch alla cartella gentoo
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
zar Marco
Guru
Guru


Joined: 09 Sep 2016
Posts: 445
Location: Colle Umberto ( TV )

PostPosted: Wed Dec 14, 2016 11:18 am    Post subject: Reply with quote

Ok fatto, nella cartella mnt risulta copiato
Code:
saul on arch  mer dic 14 12:16:46
[dir.= ~] > cat /mnt/gentoo/etc/resolv.conf
# Generated by resolvconf
search Home
nameserver 192.168.1.254


ma una volta in chroot da lo stesso errore e se vado a verede quel file
Code:
(chroot) arch / # cat /etc/resolv.conf
cat: /etc/resolv.conf: File o directory non esistente



E' come se non mi rendesse la modifica attiva in chroot
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30915
Location: here

PostPosted: Wed Dec 14, 2016 12:31 pm    Post subject: Reply with quote

Allora una volta in chroot prova a creare il file con dentro
Code:
search Home
nameserver 192.168.1.254

_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
zar Marco
Guru
Guru


Joined: 09 Sep 2016
Posts: 445
Location: Colle Umberto ( TV )

PostPosted: Wed Dec 14, 2016 12:41 pm    Post subject: Reply with quote

Effettivamente non ci avevo pensato, ma non è che poi potrebbe andare a creare un qualche problema partendo normalmente in gentoo?
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30915
Location: here

PostPosted: Wed Dec 14, 2016 12:53 pm    Post subject: Reply with quote

zar Marco wrote:
Effettivamente non ci avevo pensato, ma non è che poi potrebbe andare a creare un qualche problema partendo normalmente in gentoo?

Al massimo lo cancelli :D . Non so cosa succede con networkmanager se trova gia' un resolv.conf ma secondo me lo va a sovrascrivere.
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
zar Marco
Guru
Guru


Joined: 09 Sep 2016
Posts: 445
Location: Colle Umberto ( TV )

PostPosted: Wed Dec 14, 2016 1:11 pm    Post subject: Reply with quote

Ok ottimo domani provo
Back to top
View user's profile Send private message
sabayonino
Veteran
Veteran


Joined: 03 Jan 2012
Posts: 1014

PostPosted: Wed Dec 14, 2016 7:15 pm    Post subject: Reply with quote

per praticità mettici dentro i DNS di google

Code:
nameserver 8.8.8.8
nameserver 8.8.4.4


o gli opendns

Code:
nameserver 208.67.222.222
nameserver 208.67.220.220


non quelli della rete interna (sempre se non hai un sistema dedicato al DNS)
_________________
LRS i586 on G.Drive
LRS x86-64 EFI on MEGA
Back to top
View user's profile Send private message
zar Marco
Guru
Guru


Joined: 09 Sep 2016
Posts: 445
Location: Colle Umberto ( TV )

PostPosted: Wed Dec 14, 2016 8:37 pm    Post subject: Reply with quote

sabayonino wrote:
per praticità mettici dentro i DNS di google

Code:
nameserver 8.8.8.8
nameserver 8.8.4.4


o gli opendns

Code:
nameserver 208.67.222.222
nameserver 208.67.220.220


non quelli della rete interna (sempre se non hai un sistema dedicato al DNS)


Dubito di avere un sistema dedicato, e mi scuso per l'ignoranza, ma a cosa servono? Cioè io ho fatto l'installazione senza metterli e funziona bene
Back to top
View user's profile Send private message
sabayonino
Veteran
Veteran


Joined: 03 Jan 2012
Posts: 1014

PostPosted: Wed Dec 14, 2016 11:28 pm    Post subject: Reply with quote

se hai eseguito l'installazione seguendo il manuale passo-passo , avrai anche esegiuito

Code:
# cp -L /etc/resolv.conf /mnt/gentoo/etc/


come indicato

:mrgreen:

al massimo , post installazione possono venir gestiti dal gestore connessione. ma senza quelli , non vai da nessuna parte senza accorgimenti
_________________
LRS i586 on G.Drive
LRS x86-64 EFI on MEGA
Back to top
View user's profile Send private message
zar Marco
Guru
Guru


Joined: 09 Sep 2016
Posts: 445
Location: Colle Umberto ( TV )

PostPosted: Thu Dec 15, 2016 8:26 am    Post subject: Reply with quote

OK, ora sono su gentoo, se vado a vedere il file /etc/resolv.conf risulta già scritto
Code:
martoo on hptoo  gio dic 15 09:21:45
[dir.= ~] > cat /etc/resolv.conf
# Generated by dhcpcd from enp3s0.dhcp
# /etc/resolv.conf.head can replace this line
domain Home
nameserver 192.168.1.254
# /etc/resolv.conf.tail can replace this line


allora non mi spiego come mai in chroot non va....comunque aggiungo lo stesso i DNS di google secondo voi?
Back to top
View user's profile Send private message
sabayonino
Veteran
Veteran


Joined: 03 Jan 2012
Posts: 1014

PostPosted: Thu Dec 15, 2016 11:32 am    Post subject: Reply with quote

se quell'IP non fa da DNS server ....

inoltre il file è utilizzato come cache

rimpiazza il tutto con i DNS indicati

poi al riavvio di Gentoo eventualmnente si rimmetterà a posto. dipende come è configurato NetworkManager o chi per lui.
_________________
LRS i586 on G.Drive
LRS x86-64 EFI on MEGA
Back to top
View user's profile Send private message
zar Marco
Guru
Guru


Joined: 09 Sep 2016
Posts: 445
Location: Colle Umberto ( TV )

PostPosted: Thu Dec 15, 2016 2:46 pm    Post subject: Reply with quote

Ok grazie, Allor domani lo imposto con i DNS google
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) All times are GMT
Goto page 1, 2  Next
Page 1 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