Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
chrootintoclonedmachine [2016/05/24 15:52]
yassine chaouche
chrootintoclonedmachine [2019/07/18 11:17] (current)
yassine chaouche
Line 2: Line 2:
 [[:​index|Home]] > [[:​computers|computers]] > [[:​linux|linux]] > [[chroot|chroot]] > [[ChrootIntoClonedMachine|ChrootIntoClonedMachine]] | [[:​about|About]] [[:​index|Home]] > [[:​computers|computers]] > [[:​linux|linux]] > [[chroot|chroot]] > [[ChrootIntoClonedMachine|ChrootIntoClonedMachine]] | [[:​about|About]]
  
-When you chroot into a machine you just [[http://​forums.debian.net/​viewtopic.php?​f=5&​t=127773&​p=612196#​p612196|cloned with rsync]], you can't really do anything useful because no device is created. Some crucial files and directories need to be borrowed from the "​host"​ system, you can do this with the following commands (thanks to [[http://​blog.coffeebeans.at/​archives/​263|drmagoo]] for this tip) :+When you chroot into another root partition (another distro on /dev/sda8, or a machine you just [[http://​forums.debian.net/​viewtopic.php?​f=5&​t=127773&​p=612196#​p612196|cloned with rsync]] ​into /​var/​clone/​), you can't really do anything useful because no device is created. Some crucial files and directories need to be borrowed from the "​host" ​(live|running) ​system, you can do this with the following commands (thanks to [[http://​blog.coffeebeans.at/​archives/​263|drmagoo]] for this tip)
 + 
 +If you are chrooting into a cloned machine in your /target/ directory ​
  
 <​code>​ <​code>​
-mount --bind /proc /​target/​proc 
 mount --bind /dev /target/dev mount --bind /dev /target/dev
 +mount --bind /proc /​target/​proc
 # This one is needed for ssh access # This one is needed for ssh access
 mount --bind /dev/pts /​target/​dev/​pts mount --bind /dev/pts /​target/​dev/​pts
Line 13: Line 15:
 </​code>​ </​code>​
  
-Now most commands should work. Make sure though that files belong to the good owner. Use rsync --no-numeric-ids if necessary when cloning ​the machine.+Now most commands should work. Make sure though that files belong to the good owner. Use rsync --no-numeric-ids if necessary when cloning ​machine. 
 + 
 + 
 +If you are accessing another distribution in some partition you only need to bind /dev/ from your live system then create /proc and /sys after you have chrooted to the other root partition 
 + 
 +<​code>​ 
 +mount -o bind /dev/ /​target/​dev 
 +chroot /target 
 +mount -t proc proc /proc 
 +mount -t sysfs sys /sys 
 +</​code>​ 
 + 
 + 
  
 ---- ----

QR Code
QR Code chrootintoclonedmachine (generated for current page)