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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
04-16-2017, 06:41 AM
|
#16
|
Member
Registered: Apr 2017
Location: Land of the Lost
Distribution: Kali
Posts: 32
Original Poster
Rep: 
|
Quote:
Originally Posted by hazel
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
sudo mkdir /mnt/boot/efi # Create a directory to mount the ESP in
|
already exists
Quote:
Originally Posted by hazel
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
sudo grub-install --root-directory=/mnt /dev/sda # Run the grub install
|
Quote:
Originally Posted by hazel
Basically you boot from the CD, mount your normal root partition,
|
root partition is sda1? so what's sda3?
Quote:
Originally Posted by hazel
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.
|
|
|
04-16-2017, 07:08 AM
|
#17
|
LQ Guru
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 8,268
|
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.
|
|
|
04-16-2017, 07:47 AM
|
#18
|
LQ Guru
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 11,394
|
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.
|
|
|
04-16-2017, 09:51 AM
|
#19
|
LQ Guru
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 8,268
|
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.
|
|
|
04-16-2017, 11:25 PM
|
#20
|
Member
Registered: Apr 2017
Location: Land of the Lost
Distribution: Kali
Posts: 32
Original Poster
Rep: 
|
Quote:
Originally Posted by hazel
It is possible to convert a legacy mbr system to boot with uefi instead.
|
I have an UEFI computer
Quote:
Originally Posted by hazel
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
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?
|
|
|
04-16-2017, 11:34 PM
|
#21
|
Member
Registered: Apr 2017
Location: Land of the Lost
Distribution: Kali
Posts: 32
Original Poster
Rep: 
|
Quote:
Originally Posted by yancek
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
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
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.
|
|
|
04-17-2017, 01:11 AM
|
#22
|
LQ Guru
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 8,268
|
Quote:
Originally Posted by Safeway44
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.
|
|
|
04-17-2017, 02:29 AM
|
#23
|
Member
Registered: Apr 2017
Location: Land of the Lost
Distribution: Kali
Posts: 32
Original Poster
Rep: 
|
Quote:
Originally Posted by hazel
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.
|
|
|
04-17-2017, 02:35 AM
|
#24
|
LQ Guru
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 8,268
|
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.
|
|
|
04-17-2017, 02:37 AM
|
#25
|
Member
Registered: Apr 2017
Location: Land of the Lost
Distribution: Kali
Posts: 32
Original Poster
Rep: 
|
Quote:
Originally Posted by hazel
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
... and then install grub there.
|
Do I need to be online to do that?
Quote:
Originally Posted by hazel
grub-install --root-directory=/mnt /dev/sda # Run the grub install
|
Last edited by Safeway44; 04-17-2017 at 02:56 AM.
|
|
|
04-17-2017, 04:38 AM
|
#26
|
LQ Guru
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 8,268
|
Quote:
Originally Posted by Safeway44
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.
|
|
|
04-17-2017, 07:32 AM
|
#27
|
LQ Guru
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 11,394
|
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.
|
|
|
04-18-2017, 05:04 AM
|
#28
|
Member
Registered: Apr 2017
Location: Land of the Lost
Distribution: Kali
Posts: 32
Original Poster
Rep: 
|
Quote:
Originally Posted by yancek
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
What's in the EFI partition would also be useful information.
|
I use fdisk -l for this?
|
|
|
04-18-2017, 05:28 AM
|
#29
|
LQ Guru
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 8,268
|
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.
|
|
|
04-18-2017, 07:19 AM
|
#30
|
LQ Guru
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 11,394
|
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.
|
|
|
All times are GMT -5. The time now is 04:37 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|