[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.

Welcome to the Slackware Documentation Project

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
howtos:slackware_admin:how_to_chroot_from_media [2015/06/25 13:10 (UTC)] – [Volume Preparation] Removed a useless dot after </code> didierspaierhowtos:slackware_admin:how_to_chroot_from_media [2021/02/19 23:39 (UTC)] – Fix in the example command sequence alienbob
Line 1: Line 1:
 <!-- Add your text below. We strongly advise to start with a Headline (see button bar above). --> <!-- Add your text below. We strongly advise to start with a Headline (see button bar above). -->
 ====== Chroot From Installation Media ====== ====== Chroot From Installation Media ======
-Slackware is full of tools that can help when the system becomes unstable and cannot boot. One example is upgrading the kernel image and forgetting to run lilo afterwards.+Slackware is full of tools that can help when the system becomes unstable and cannot boot. One example is upgrading the kernel image and forgetting to run ''lilo'' afterwards.
  
 In order to gain access to your system without booting directly to it, it is possible to use an installation media such as Slackware CD1 or the DVD. Once the installation media loads and starts, you can change the media's root directory into a mounted hard-disk partition and use it as the root directory, thus running commands directly from it and affecting it. In order to gain access to your system without booting directly to it, it is possible to use an installation media such as Slackware CD1 or the DVD. Once the installation media loads and starts, you can change the media's root directory into a mounted hard-disk partition and use it as the root directory, thus running commands directly from it and affecting it.
Line 10: Line 10:
 In the simplest of examples, a single hard disk was partitioned locally, normally and it is not encrypted in any way. In this case, all you need to do is to make sure what is the partition's 'name' is and continue to the mounting section. In the simplest of examples, a single hard disk was partitioned locally, normally and it is not encrypted in any way. In this case, all you need to do is to make sure what is the partition's 'name' is and continue to the mounting section.
  
-If this is not the case, and you are using LVM/EVMS or an encrypted volume you will need to prepare the volumes before you can mount and chroot into them:+If this is not the case, and you are using //LVM/EVMS// or an encrypted volume you will need to prepare the volumes before you can mount and chroot into them:
  
 To unlock your LUKS partition, you will need to 'open' it and give it a name with this command (sdxn as example):  To unlock your LUKS partition, you will need to 'open' it and give it a name with this command (sdxn as example): 
Line 44: Line 44:
  
 <code>mkdir /mnt/{boot,usr,home,opt,var,srv} # Create the necessary directories. <code>mkdir /mnt/{boot,usr,home,opt,var,srv} # Create the necessary directories.
-mount /dev/sda1 /mnt/boot 
 mount /dev/myvg/root /mnt mount /dev/myvg/root /mnt
-mount /dev/myvg/usr /mnt/usr+mount /dev/myvg/usr  /mnt/usr
 mount /dev/myvg/home /mnt/home mount /dev/myvg/home /mnt/home
-mount /dev/myvg/opt /mnt/opt +mount /dev/myvg/opt  /mnt/opt 
-mount /dev/myvg/var /mnt/var +mount /dev/myvg/var  /mnt/var 
-mount /dev/myvg/srv /mnt/srv</code>+mount /dev/myvg/srv  /mnt/srv 
 +mount /dev/sda1      /mnt/boot</code>
  
 We could have also used a for loop for everything except /boot (/dev/sda1) and / (/dev/myvg/root) in this example: We could have also used a for loop for everything except /boot (/dev/sda1) and / (/dev/myvg/root) in this example:
Line 61: Line 61:
 Next, we need to prepare three virtual directories to be used by the environment. Those are ''/dev'', a directory with virtual files that represent hardware devices, ''/proc'', a directory with virtual files that represent processes and ''/sys'' which contains the kernel and other system files: Next, we need to prepare three virtual directories to be used by the environment. Those are ''/dev'', a directory with virtual files that represent hardware devices, ''/proc'', a directory with virtual files that represent processes and ''/sys'' which contains the kernel and other system files:
  
-<code>mount -o bind /dev /mnt/dev+<code>mount -o bind  /dev /mnt/dev
 mount -o bind /proc /mnt/proc mount -o bind /proc /mnt/proc
-mount -o bind /sys /mnt/sys</code>+mount -o bind /sys  /mnt/sys</code>
  
 ===== Chrooting ===== ===== Chrooting =====
 howtos:slackware_admin:how_to_chroot_from_media ()