LinuxQuestions.org
Review your favorite Linux distribution.
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 03-27-2017, 07:13 AM   #121
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,631

Rep: Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696

Quote:
Originally Posted by jsbjsb001 View Post
In answer to your first question, GRUB itself is normally is installed to the MBR, as the BIOS looks at the MBR to find an OS to boot. So there needs to be something in the MBR, for the an OS of some type, to start at all (Windows or Linux). GRUB's configuration files are stored in the /boot/grub folder.

In answer to your second question, no, it does not have to be installed to the MBR, you can also install it, to the root partition's, partition boot sector.

Chainloading to my understanding is the act of starting an OS, other than Linux.

Hope this helps.
At a very high level and subject to some inaccuracy:
The MBR code is what gets control first as the boot image is loaded from the disk. The MBR itself is not very big, so the first thing any MBR code does is intialize then load something else. In the case of grub, it has stages, and the MBR code is stage 1. It loads stage 2 which is far larger and smarter, can read the grub config files from disk, and determine how to start the next stage.

A Chainloader is only required when the Grub loader is handing off control to a different boot loader, this was required to load some ( perhaps all) Windows and DOS versions in grub v1. I am not sure if that is ever required in grub 2, or where else it might have value. In general, chainloading is a hack and not the best option. At times you have no choice, and a good hack is all that works, but dirrect support in grub is better and always improving.

Last edited by wpeckham; 03-27-2017 at 07:15 AM.
 
2 members found this post helpful.
Old 03-27-2017, 10:29 PM   #122
linux-man
Member
 
Registered: Nov 2016
Location: Geneva
Distribution: native install of Parrot Home Edition 5.0 Debian (no security tools) 64 bit, KDE, 5.14.0-9parrot1,
Posts: 872

Rep: Reputation: Disabled
Quote:
Originally Posted by wpeckham View Post
The MBR code is what gets control first as the boot image is loaded from the disk. The MBR itself is not very big, so the first thing any MBR code does is intialize then load something else. In the case of grub, it has stages, and the MBR code is stage 1. It loads stage 2 which is far larger and smarter, can read the grub config files from disk, and determine how to start the next stage.
Is there a need to increase either MBR size or size of Grub to accommodate three Operating Systems on one hard disk? eg
2 linux distro's and one Windows? Only one swap required in this situation?

Last edited by linux-man; 03-27-2017 at 10:49 PM.
 
Old 03-28-2017, 01:13 AM   #123
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Quote:
Originally Posted by linux-man View Post
Is there a need to increase either MBR size or size of Grub to accommodate three Operating Systems on one hard disk? eg
2 linux distro's and one Windows? Only one swap required in this situation?
You can't increase the size of the MBR, as far as I know (or GRUB), if I'm understanding what your asking here correctly.

I don't think Windows can use a Linux SWAP partition and in Windows as far as I know, the SWAP space is normally in the file C:\pagefile.sys
 
1 members found this post helpful.
Old 03-28-2017, 11:00 AM   #124
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,631

Rep: Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696
Quote:
Originally Posted by jsbjsb001 View Post
You can't increase the size of the MBR, as far as I know (or GRUB), if I'm understanding what your asking here correctly.

I don't think Windows can use a Linux SWAP partition and in Windows as far as I know, the SWAP space is normally in the file C:\pagefile.sys
I can confirm this. I have run several multi-boot machines with Windows (though I have no windows other than NT4 available right now) and while multiple linux distributions in multi-boot can share one swap partition every Windows instance requires and builds a unique hidden pageswap file.

The MBR is fixed in size and location by the original disk format specifications from way back when IBM-DOS first supported hard drives. It may have originated earlier. At that time it only needed a single sector, so that was all that that the specification called for.

When things got bigger the MBR did not (because the BIOS code was written to support that specification and had to load from that MBR during IPL) so the MBR code loads a second stage boot code from a somewhat arbitrary disk location. The system is perfect for DOS, works well with Windows and OS/2, but not so well with anything else.

Replacing the MBR code with another loader is trivial, and LILO, GRUB (1), and GRUB2 are fine examples. Each of these has a stage 1 in the MBR, a stage 2 from the disk that can display a menu and then load a kernel (stage 3?) based upon the results. That kernel can be the kernel or native OS loader for an arbitrary operating system (Windows, Linux, or BSD are common).

One thing you do not want to do is home GRUB in a linux partition that you plan to blow away. Decide on one as a base that you will run for a long time, and let an secondary or short term distros come and go an later partitions. If you do not plan it well, removing the distribution that homes your grub can result in having a bad afternoon. Easy enough to fix, in the end, but better to avoid the problem.

My current laptop came with WinXP, runs a Intel Centrino Duo (not terrible for when it was new, but not exactly a powerhouse). After running dual-boot WinXP and MINT for a time, I loaded it with VSIDO in a total reload eliminating Windows. Today I base it on Q4OS Linux, with multi-boot loading for FreeDOS, KolibriOS, and I am playing with adding ReactOS and TinyCore Linux. GRUB2 homes on Q4OS handles loading all of these nicely, once configured (TinyCore in Persitent mode, like KolibriOS, is not autodetected: the others are). I have, in the past, run FreeBSD versions and GRUB2 detected and handled them nicely. Really, if you do not pull the rug out form under it, you should find that it takes care of your booting needs very nicely.
 
3 members found this post helpful.
Old 03-28-2017, 02:05 PM   #125
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
Totally agree with the above 2 posts from jsbjsb001 and wpeckham. wpeckham gives a very clear explanation of how GRUB works and how it depends on the MBR in a BIOS based system.

Cheers,
 
Old 03-29-2017, 06:06 AM   #126
linux-man
Member
 
Registered: Nov 2016
Location: Geneva
Distribution: native install of Parrot Home Edition 5.0 Debian (no security tools) 64 bit, KDE, 5.14.0-9parrot1,
Posts: 872

Rep: Reputation: Disabled
Quote:
Originally Posted by wpeckham View Post
while multiple linux distributions in multi-boot can share one swap partition every Windows instance requires and builds a unique hidden pageswap file.
Pageswap file resides in Windows own swap?

Quote:
Originally Posted by wpeckham View Post
One thing you do not want to do is home GRUB in a linux partition that you plan to blow away...
My current laptop...GRUB2 homes on Q4OS
By don't "home" you mean "don't let it be allocated"?

Can the windows secondary bootloader be deleted from first sector? If GRUB becomes secondary preferred bootloader does that mean I don't need windows secondary bootloader on dual Win/Linux OS?
 
Old 03-29-2017, 07:27 AM   #127
RockDoctor
Senior Member
 
Registered: Nov 2003
Location: Minnesota, US
Distribution: Fedora, Ubuntu, Manjaro
Posts: 1,791

Rep: Reputation: 427Reputation: 427Reputation: 427Reputation: 427Reputation: 427
I keep a small boot partition for Grub's MBR component to point to, and chainload various OSs from there. Each OS's bootloader goes in that OS's root partition. Requires manual editing of the boot partition's grub.cfg entries as I change OSs, but means I don't have to worry if I decide to blow away any of my installed OSs.
 
Old 03-29-2017, 07:42 AM   #128
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
linux-man, what they're saying is that you must be sure that Grub resides someplace that you won't blow-away if you install a new operating system. Put it into a small partition that does not contain anything else.

- - -

Windows has its own very-funky second stage boot-loader, NTLDR.SYS, I believe, which Grub does know how to pass control to.

At one client's shop which used a lot of Windows servers, they actually installed Grub (on a very small independent partition, as noted previously) and used it as their primary boot-loader in order to start Windows. They said that they liked the flexibility that Grub gave them when things went wrong. "Microsoft just assumes that everything will work perfectly all the time," they said.

Last edited by sundialsvcs; 03-29-2017 at 07:46 AM.
 
2 members found this post helpful.
Old 03-29-2017, 09:16 AM   #129
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
Quote:
Originally Posted by linux-man View Post
Pageswap file resides in Windows own swap?
Hey again linux-man,

Windows swap space is in a file in the Windows main ntfs file system, located in the c:\ directory, called pagefile.sys

Quote:
By don't "home" you mean "don't let it be allocated"?
As explained in a previous post, this is just the poster's warning to not install the stage 2 files of GRUB (its main program and configuration files) on a partition that you are likely to delete or modify.

Quote:
Can the windows secondary bootloader be deleted from first sector? If GRUB becomes secondary preferred bootloader does that mean I don't need windows secondary bootloader on dual Win/Linux OS?
Do not touch the Windows boot loader. GRUB will pass control to the Windows boot loader (this is what chainloading means) when you select Windows from the GRUB menu of bootable operating systems.

Finally, just out of curiosity, have you actually tried any of these suggestions as of yet or are you still collecting information ?

Cheers,

Last edited by Rickkkk; 03-29-2017 at 09:17 AM.
 
1 members found this post helpful.
Old 03-29-2017, 10:30 PM   #130
linux-man
Member
 
Registered: Nov 2016
Location: Geneva
Distribution: native install of Parrot Home Edition 5.0 Debian (no security tools) 64 bit, KDE, 5.14.0-9parrot1,
Posts: 872

Rep: Reputation: Disabled
Quote:
Originally Posted by Rickkkk View Post
...are you still collecting information ?
Yes,I'm at collecting information stage. But I have partitioned the drive with windows as per
prior discussions. Backups done.

Would there be any benefit in making separate partition mount points for the following?
/tmp
/var
/opt
/usr

Last edited by linux-man; 03-29-2017 at 10:38 PM.
 
Old 03-30-2017, 01:45 AM   #131
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Re partitioning, if you only have one disk and its a home system, I wouldn't bother, except maybe for /var/ which contains /log, /spool dirs etc, which can fill up if you get a runaway process or you don't setup logrotate well enough.
NB: normally the default setting for logrotate is good enough unless you do get a runaway process as mentioned.

HTH
 
Old 03-30-2017, 10:02 AM   #132
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
Quote:
Originally Posted by linux-man View Post
Yes,I'm at collecting information stage. But I have partitioned the drive with windows as per
prior discussions. Backups done.

Would there be any benefit in making separate partition mount points for the following?
/tmp
/var
/opt
/usr
Hi linux-man,

I agree with Chrism01 above - for home systems I would tend to keep it simple and just use a root partition or, at the most, a separate partition for /home. As others have previously pointed out, setups for a business environment, particularly for servers, benefit more from more granular partitioning.

Cheers :-)
 
1 members found this post helpful.
Old 04-02-2017, 02:10 AM   #133
linux-man
Member
 
Registered: Nov 2016
Location: Geneva
Distribution: native install of Parrot Home Edition 5.0 Debian (no security tools) 64 bit, KDE, 5.14.0-9parrot1,
Posts: 872

Rep: Reputation: Disabled
Is having a separate /root partition more susceptible to a risk fragmentation of the disk?
How large should I partition for multi distro setup? 2 linux, 1 windows
/
/boot
/home
I have 200GB to play with for linux.

I read this somewhere:
"If you often install a new distro, I recommend to separate 1 empty ext4 partition for special programs or their configs --such as virtualbox disk files, your projects, etc. Because some distro installer may be unstable and your home data may be destroy.
It is my bad experience."
True/False?
What would this empty ext4 be named? How large should it be (if I did one)? Should I do it too?

Last edited by linux-man; 04-02-2017 at 05:34 AM.
 
Old 04-02-2017, 04:54 AM   #134
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Quote:
Originally Posted by linux-man View Post
Is having a separate /root partition more susceptible to a risk fragmentation of the disk?
How large should I partition for multi distro setup? 2 linux, 1 windows
/ (root)
/boot
/home
I have 200GB to play with.

I read this somewhere:
"If you often install a new distro, I recommend to separate 1 empty ext4 partition for special programs or their configs --such as virtualbox disk files, your projects, etc. Because some distro installer may be unstable and your home data may be destroy.
It is my bad experience."
True/False?
What would this empty ext4 be named? How large should it be (if I did one)? Should I do it too?
The "root" partition would always be your "/" partition, not "/root". The "/root" folder is the "home" folder for the root/superuser account, which often confuses people, because it's the same name as the "root" partition (which are NOT one of the same thing).

I'm not sure you would have more file fragmentation by having separate partitions, I don't think that's what it would mean anyway (I don't think you would have more fragmentation, personally). Linux file systems, (like ext4) are pretty good in terms of NOT fragmenting the disk, maybe large files (video files, etc) would be more likely to fragment, than smaller files, like files on your "root" partition (which mostly are going to be fairly small/smallish, if that makes sense) in terms of today's standards.

It's normal to have a separate "/home" partition and there are benefits to having this sort of setup, but having said that, it is a matter of personal choice, as there is no right or wrong answer, as far as that goes. You will more than likely be safe accepting the defaults proposed by your distro's installation program. Naming your partitions, helps ID them when looking at them in programs like (but not limited to) Gparted.

I personally do name my partitions for the same reason as stated above. You can look at the size of them as well, to help ID them.

Last edited by jsbjsb001; 04-02-2017 at 05:21 AM. Reason: fixed formatting/spelling, and additions
 
2 members found this post helpful.
Old 04-02-2017, 11:15 AM   #135
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,631

Rep: Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696
Quote:
Originally Posted by linux-man View Post
Is having a separate /root partition more susceptible to a risk fragmentation of the disk?
How large should I partition for multi distro setup? 2 linux, 1 windows
/
/boot
/home
I have 200GB to play with for linux.

I read this somewhere:
"If you often install a new distro, I recommend to separate 1 empty ext4 partition for special programs or their configs --such as virtualbox disk files, your projects, etc. Because some distro installer may be unstable and your home data may be destroy.
It is my bad experience."
True/False?
What would this empty ext4 be named? How large should it be (if I did one)? Should I do it too?
1. Generally, linux partitions do not suffer from fragmentations that impact performance or life significantly the file system drivers handle reducing fragmentation in normal use transparently: as long as there is sufficient free disk space in the file system.

2. The purpose for extra partitions is twofold: system protection and datas protection - both using segregation. The extra partition gives you a space that you can cheaply back up or transfer without impacting the OS and installed applications. The system is protected because that extra file system filling up and crashing will NOT crash the OS.

3. I have seen these partions named home and mounted /home and used to host the user folders, /data or /opt and used to host third party applications or data, and other patterns. There is no hard & fast rule, it depends upon how you want to run and what you use your system for.
 
1 members found this post helpful.
  


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



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

All times are GMT -5. The time now is 07:07 PM.

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