How do I install multiple Linux OSes on one machine?

Discussion in 'all things UNIX' started by kdcdq, Feb 15, 2018.

  1. act8192

    act8192 Registered Member

    Joined:
    Nov 9, 2006
    Posts:
    1,754
    MBR here, legacy boot. Every time I added Mint to XP or Win7+10, I used these instructions:
    https://www.dedoimedo.com/computers/dual_boot.html
    and
    https://www.dedoimedo.com/computers/dual-boot-windows-7-ubuntu.html
    In the instructions, in gparted, and during installation I've never ran into this LBA thingie.
    Do I need to know it? I tried reading in wikipedia and didn't understand.
    Could you PLEASE try to describe as you would talking to a 4-yr old?
     
  2. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    11,153
    Location:
    NSW, Australia
    act8192,

    OK, some maths for a 4 year old.

    Why does a 2 TB HD show as 1863.02 GB in Disk Management? Because they are different units. Windows says GB when it really means GiB. All Windows units are binary even though they are labelled KB, MB, GB. Hard disk size stamped on the label of the disk is a Decimal size. It is 2 TB, not 2 TiB.
    This page explains the difference between Binary and Decimal...

    http://www.dewassoc.com/kbase/hard_drives/binary_v_decimal_measurement.htm

    All the units we use in our computers are binary even though they aren't correctly labelled. We use KiB, MiB, GiB, etc. Half a KiB is 512 bytes. Until recently the only sector size on a HD was 512 bytes. I won't discuss larger sectors at present. Below is a MBR sector. This sector is the first sector on a HD and is not inside a partition. The MBR is never inside a partition. Its Logical Block Address is LBA 0.
    The next sector is LBA 1, etc. Each sector has a LBA number.

    MBR-Win7.gif

    The code in LBA 0 can be regarded as having three sections. Boot code, Disk Signature and Partition table. When you write a new MBR to a disk you only write Boot code. The other two sections aren't altered.

    When a partition is called 1 MiB aligned it means it starts a certain number of 1 MiB blocks from the start of the HD. As 1 MiB is 2048 sectors (each sector is half a KiB) you can determine if a partition is 1 MiB aligned by dividing the Start LBA of the partition by 2048. If the answer is an integer (whole number) then the partition is 1 MiB aligned. If the answer isn't an integer and you have a SSD then you probably need to fix the alignment as there might be performance issues.
    For example, my Win10 partition has a Start LBA of 1159168. 1159168/2048 = 566. An integer so all OK.

    Clear as mud?
     
  3. act8192

    act8192 Registered Member

    Joined:
    Nov 9, 2006
    Posts:
    1,754
    Not at all. Perfectly clear, I always understood that 1K=1024. And now I understand why my System_Drv starts on sector 2048.
    I gather that LBA is the same as sector or refers to sector. But maybe not if 4096 byte sectors are involved.
    Your answer about what's in MBR bytes 0-511 is super not that its readable easily.
    I understand now what you were after earlier about zapping all grub code when uninstalling when you wrote LBA100+.

    Alignment, you mentioned, is a can of worms here.
    Re: divisible by 2048. Some of my partitions start in wrong places. I might start a separate thread about it.

    Almost forgot: Thank you :)
     
  4. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    11,153
    Location:
    NSW, Australia
    For 1 MiB alignment divide the start LBA by the number of sectors in 1 MiB. The result should be an integer.

    For 4K native sectors...
    1048576/4096 = 256 so you would divide by 256

    For 512 byte sectors (or 512e)
    1048576/512 = 2048 so you would divide by by 2048

    A MBR disk has a limit of 2^32 sectors so if you have 512 byte sectors the maximum disk size is 2^32 * 512 which is 2,199,023,255,552 bytes. That is 2 TiB. (or 2.2 TB could be stamped on the disk)

    But what if the sectors are larger? Disks with 4K Native sectors, eight times larger than 512 byte sectors, can have a maximum MBR disk size of 16 TiB. They still have 2^32 sectors. (or 17.6 TB could be stamped on the disk) You could install Win8 or Win10 on these disks. Or Linux.
     
    Last edited: Feb 28, 2018
  5. act8192

    act8192 Registered Member

    Joined:
    Nov 9, 2006
    Posts:
    1,754
    Thanks again. Understood. I'm posting about alignment separately, perhaps you'd be willing to help.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.