Advertisement
ciusss89

Untitled

Jan 28th, 2014
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. ls /dev/sd*; path="/mnt/chroot"
  3. read -p "Type root partition > " root_part
  4. read -p "Type boot partition > " boot_part
  5. echo "Root is $root_part  Boot is $boot_part"
  6.  
  7. read -p " continue (yes/not)> " s1
  8. s2="yes"
  9.  
  10. if [ "x$s1" == "x$s2" ]
  11. then
  12.         mkdir -p $path
  13.         mount $root_part $path
  14.         cd $path
  15.         mount -o bind /dev dev/
  16.         mount --bind /dev/pts dev/pts
  17.         mount -t proc proc proc/
  18.         mount -t sysfs sys sys/
  19.         mount $boot_part boot/efi
  20.         df -h; sleep 3; echo "chroot icoming"
  21.         chroot . /bin/bash
  22. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement