I have a usb drive with overclockix (debian-based) that I have booted my system from. I am trying to figure out a way to install it to the attached SATA SSD drive. I attempted the following:
I created the following partitions on the SSD with fdisk:
/dev/sda1 /boot ext2 (bootable)
/dev/sda2 / ext4
/dev/sda3 /var ext4
/dev/sda4 /home ext4
/dev/sda5 none swap
partprobe /dev/sda
I ran mkfs. on each partition and mkswap on sda5.
Then I mounted the partitions:
mount /dev/sda2 /mnt
mkdir /mnt/boot /mnt/var /mnt/home
mount /dev/sda1 /mnt/boot
mount /dev/sda3 /mnt/var
mount /dev/sda4 /mnt/home
Then I copied the files from the USB:
rsync -avp --exclude /proc --exclude /boot --exclude /home --exclude /var --exclude /sys --exclude /dev --exclude /run / /mnt
rsync -avp /var /mnt/var
rsync -avp /boot /mnt/boot
rsync -avp /home /mnt/home
Then I bind mounted proc, sys, run and dev:
mkdir /mnt/proc /mnt/run /mnt/sys /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
mount --bind /dev /mnt/dev
mount --bind /run /mnt/run
Then I chrooted to /mnt:
chroot /mnt /bin/bash
I created a new fstab:
blkid >> /etc/fstab
vi /etc/fstab
UUID=<UUID> <mpoint> <type> defaults(or sw) 0 2
Then I ran grub-install /boot /dev/sda which returned no errors.
I exited the chroot, unmounted the partitions, removed the USB and rebooted.
I thought that this would create a nearly identical file system as what is on the USB device which would boot with grub. However, I wasn't able to boot from the drive. I am thinking it has something to do with UEFI, but I can't quite figure out what else needs to be done.
Any help is appreciated, thanks.