LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-16-2017, 06:41 AM   #16
Safeway44
Member
 
Registered: Apr 2017
Location: Land of the Lost
Distribution: Kali
Posts: 32

Original Poster
Rep: Reputation: Disabled

Quote:
Originally Posted by hazel View Post
Here's something I found on a Ubuntu site:
sudo mount /dev/sda1 /mnt # Mount the root filesystem in /mnt
Starting at root@(none):
I got
sudo: unable to resolve host(none): Connection Refused
Quote:
Originally Posted by hazel View Post
sudo mkdir /mnt/boot/efi # Create a directory to mount the ESP in
already exists
Quote:
Originally Posted by hazel View Post
sudo mount /dev/sda3 /mnt/boot/efi # Mount the ESP
I got
sudo: unable to resolve host(none): Connection refused
btw sda3 is what partition? Home, boot...?
Quote:
Originally Posted by hazel View Post
sudo grub-install --root-directory=/mnt /dev/sda # Run the grub install

Quote:
Originally Posted by hazel View Post
Basically you boot from the CD, mount your normal root partition,
root partition is sda1? so what's sda3?
Quote:
Originally Posted by hazel View Post
mount the efi system partition on the root partition's /boot/efi directory and then install grub there.

Last edited by Safeway44; 04-16-2017 at 06:46 AM.
 
Old 04-16-2017, 07:08 AM   #17
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,574
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
Please read post 13 again. I pointed out there that this is only an example and that you must use the correct partition device names for your system, not the ones used in the example. You need to find out those names and that is what you are going to use fdisk for.

Run fdisk -l and write down the correct partition numbers for the root partition and the efi system partition. The device names will be /dev/sdan where n is the partition number. So if the efi system partition is 1 and your root partition is 2, the device /dev/sda2 must be mounted somewhere on your rescue system (say on /mnt) and /dev/sda1 would then go on /mnt/boot/efi.

Again, these are examples only. You should be able to understand this.

Last edited by hazel; 04-16-2017 at 07:10 AM.
 
Old 04-16-2017, 07:47 AM   #18
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,508

Rep: Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490
If you are using the Kali DVD to run these commands, stop using sudo. By default when you log in to Kali you already are root. That is the default by design because of it's purpose. To give us a better idea of what you have, when you fun the: fdisk -l (Lower Case Letter L) how about posting the actual output here?

From your earlier posts, the problems you are having are because you have a windows UEFI install with a Legacy/CSM install of Kali. If for some reason, you don't or can't install Kali UEFI, the best you can hope for is to be able to switch to CSM/Legacy in the BIOS to boot Kali and to UEFI to boot windows.

You asked earlier about deleting Grub from the MBR. The page below explains that. Make sure you scroll down the page to the section: Option #2: Command to delete mbr only so you don't delete your partition table. You should be able to boot windows without making this change by setting the BIOS to boot UEFI. You'll need to have someone more familiar with UEFI confirm this.

https://www.cyberciti.biz/faq/linux-...rd-dd-command/

If you get this straightened out and still want to learn computer forensics, I would suggest you install Kali to a flash drive. Detailed instructions on there site and should eliminate a lot of these problems.

Last edited by yancek; 04-16-2017 at 01:16 PM.
 
Old 04-16-2017, 09:51 AM   #19
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,574
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
It is possible to convert a legacy mbr system to boot with uefi instead. I remember reading a HOWTO on doing this immediately after installation by remounting the hard drive on the installation image, mounting the efi system partition on it, and then installing GRUB in its proper location on the esp. Unfortunately I haven't been able to find that item again.

The existing GRUB stub in the mbr can be left in place. It doesn't do any harm because a UEFI running in native mode ignores the mbr.

I've read a lot of warnings against mixing UEFI native and legacy booting on a permanent basis. Sooner or later you're going to use the wrong method with bad results.
 
Old 04-16-2017, 11:25 PM   #20
Safeway44
Member
 
Registered: Apr 2017
Location: Land of the Lost
Distribution: Kali
Posts: 32

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by hazel View Post
It is possible to convert a legacy mbr system to boot with uefi instead.
I have an UEFI computer

Quote:
Originally Posted by hazel View Post
The existing GRUB stub in the mbr can be left in place. It doesn't do any harm because a UEFI running in native mode ignores the mbr.
Your right, I've changed my mind about deleting the GRUB stub in MBR.

Quote:
Originally Posted by hazel View Post
I've read a lot of warnings against mixing UEFI native and legacy booting on a permanent basis. Sooner or later you're going to use the wrong method with bad results.
You mean like computers that run windows on uefi and linux on legacy on the same computer long term?
 
Old 04-16-2017, 11:34 PM   #21
Safeway44
Member
 
Registered: Apr 2017
Location: Land of the Lost
Distribution: Kali
Posts: 32

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by yancek View Post
From your earlier posts, the problems you are having are because you have a windows UEFI install with a Legacy/CSM install of Kali.
Correct

Quote:
Originally Posted by yancek View Post
You asked earlier about deleting Grub from the MBR. The page below explains that. Make sure you scroll down the page to the section: Option #2: Command to delete mbr only so you don't delete your partition table.
https://www.cyberciti.biz/faq/linux-...rd-dd-command/
There's no mention in the article on how to delete just the small portion of grub that's sitting in the mbr. But thank you anyway. I've decided to leave it as is.

Quote:
Originally Posted by yancek View Post
You should be able to boot windows without making this change by setting the BIOS to boot UEFI. You'll need to have someone more familiar with UEFI confirm this.
My windows is booting fine in UEFI

Last edited by Safeway44; 04-17-2017 at 02:06 AM.
 
Old 04-17-2017, 01:11 AM   #22
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,574
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
Quote:
Originally Posted by Safeway44 View Post
I have an UEFI computer
Yes, but when you installed Kali, you told the UEFI to behave like a BIOS. That's what "legacy mode" actually means.
Quote:
You mean like computers that run windows on uefi and linux on legacy on the same computer long term?
Yes. It's not recommended.
 
Old 04-17-2017, 02:29 AM   #23
Safeway44
Member
 
Registered: Apr 2017
Location: Land of the Lost
Distribution: Kali
Posts: 32

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by hazel View Post
mount the efi system partition on the root partition's /boot/efi directory and then install grub there.
I have a separate partition just for boot, should I still go ahead like you said above?

Last edited by Safeway44; 04-17-2017 at 02:56 AM.
 
Old 04-17-2017, 02:35 AM   #24
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,574
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
If you have a boot partition, start by mounting it on the empty /boot directory of your root partition. Then create /boot/efi in it. Then mount the esp on /boot/efi.
 
Old 04-17-2017, 02:37 AM   #25
Safeway44
Member
 
Registered: Apr 2017
Location: Land of the Lost
Distribution: Kali
Posts: 32

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by hazel View Post
If you have a boot partition, start by mounting it on the empty /boot directory of your root partition. Then create /boot/efi in it. Then mount the esp on /boot/efi.
Could I get the code please?

Quote:
Originally Posted by hazel View Post
... and then install grub there.
Do I need to be online to do that?

Quote:
Originally Posted by hazel View Post
grub-install --root-directory=/mnt /dev/sda # Run the grub install

Last edited by Safeway44; 04-17-2017 at 02:56 AM.
 
Old 04-17-2017, 04:38 AM   #26
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,574
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
Quote:
Originally Posted by Safeway44 View Post
Could I get the code please?
Start by reading the man page for mount (man mount). See if you can work out the arguments you need to give it. It'll be good training for you. You really can't use Linux, especially a distro like Kali, if you expect to be spoon-fed all the time. I'll give you a clue: you need to tell mount what partition you want to mount, what kind of filesystem it's using, and where you want to mount it, in that order.

Quote:
Do I need to be online to do that?
No. You only need to be online to use the Internet.

Last edited by hazel; 04-17-2017 at 06:46 AM.
 
Old 04-17-2017, 07:32 AM   #27
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,508

Rep: Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490
Quote:
There's no mention in the article on how to delete just the small portion of grub that's sitting in the mbr
Yes there is. It is under Option #2: Command to delete MBR only (the last part highlighted in red) but as pointed out above, if you have UEFI set up it ignores the MBR so it's not a problem. I think it would be a good idea to post the actual output of commands like fdisk -l or gdisk -l and also what exactly you have on your separate boot partition. What's in the EFI partition would also be useful information.
 
Old 04-18-2017, 05:04 AM   #28
Safeway44
Member
 
Registered: Apr 2017
Location: Land of the Lost
Distribution: Kali
Posts: 32

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by yancek View Post
Yes there is. It is under Option #2: Command to delete MBR only (the last part highlighted in red) but as pointed out above, if you have UEFI set up it ignores the MBR so it's not a problem.
I think your right.

Your saying Grub is that 446 bytes of MBR?
If Grub occupies that 446 bytes of the primary portion in MBR then what was occupying that 446 bytes of space prior to Grub's arrival?

Quote:
Originally Posted by yancek View Post
What's in the EFI partition would also be useful information.
I use fdisk -l for this?
 
Old 04-18-2017, 05:28 AM   #29
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,574
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
No, you mount the efi partition on /boot/efi as I have described, and then use the ordinary Linux file management tools to find out what is in that directory. The whole point of uefi booting is that all boot code is in normal files that can be inspected from out of any operating system, and not in special "magical spaces" like the mbr.

You need some very basic education. Try reading this.

Last edited by hazel; 04-18-2017 at 05:31 AM.
 
Old 04-18-2017, 07:19 AM   #30
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,508

Rep: Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490
Quote:
If Grub occupies that 446 bytes of the primary portion in MBR then what was occupying that 446 bytes of space prior to Grub's arrival?
Nothing. From the information you posted, your windows was UEFI which does not use the MBR.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows 8 not loading from GRUB KingDookies Linux - Newbie 44 12-20-2012 03:33 PM
Loading Windows with GRUB scouture Linux - Software 3 03-09-2005 06:07 PM
SuSE 9.1 and Windows Xp refuse to live in harmony: error loading windows through GRUB sanctumtacete Linux - Newbie 3 10-19-2004 07:47 AM
GRUB loading windows teamstatic84 Linux - General 5 12-29-2003 08:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration