Created
January 18, 2017 10:09
-
-
Save Diederikjh/ccf26b37ad7d77b08c1dc86f8b321e95 to your computer and use it in GitHub Desktop.
Copy system drive and ready to chroot.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First sync old root then rew root. | |
# Mostly from http://askubuntu.com/a/3409/41258 | |
sudo rsync -avP --numeric-ids --exclude='/dev' --exclude='/proc' --exclude='/sys' --exclude='/home' --exclude='/media' --exclude='/var/cache/zoneminder' /media/ubuntu/eb636436-ea9f-4e1b-bc71-5b46eb6e96a1/ /media/ubuntu/690ad96f-d072-41ef-9ebe-a524f891a2f6/ | |
sudo mkdir /media/ubuntu/690ad96f-d072-41ef-9ebe-a524f891a2f6/proc | |
sudo mount -B /proc /media/ubuntu/690ad96f-d072-41ef-9ebe-a524f891a2f6/proc | |
sudo mkdir /media/ubuntu/690ad96f-d072-41ef-9ebe-a524f891a2f6/dev | |
sudo mount -B /dev /media/ubuntu/690ad96f-d072-41ef-9ebe-a524f891a2f6/dev | |
sudo mkdir /media/ubuntu/690ad96f-d072-41ef-9ebe-a524f891a2f6/sys | |
sudo mount -B /sys /media/ubuntu/690ad96f-d072-41ef-9ebe-a524f891a2f6/sys | |
sudo chroot /media/ubuntu/690ad96f-d072-41ef-9ebe-a524f891a2f6 | |
#TODO fix up /etc/fstab to mount new root (690ad96f-d072-41ef-9ebe-a524f891a2f6) | |
sudo update-grub | |
#install grub on new drive: | |
sudo grub-install /dev/sdc | |
#aslo make above drive (/dev/sdc) first bootable drive in BIOS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment