Fresh Install on /dev/sdb2 Question [SOLVED]

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
User avatar
rgand
Level 5
Level 5
Posts: 536
Joined: Fri Feb 05, 2016 12:44 am

Fresh Install on /dev/sdb2 Question [SOLVED]

Post by rgand »

I have successfully installed Mint 18.1 on my SSD and it works great. I have a second drive to use mostly for data storage but will also put Mint 18.2 on it as a dual boot option.

Before proceeding and loosing important data, I'll explain what I have so far. Here's a screen shot of GParted to show /dev/sdb as it is now.
sdb-GParted.png
I have deleted the Windows installation partitions that were on /dev/sdb and created two new Ext4 partitions in their place. /dev/sdb2 where I want to install 18.2 and /dev/sdb3 where I want to copy the contents of /dev/sdb4, my existing data partition. After Mint 18.2 is installed and the contents of /dev/sdb4 have been copied onto /dev/sdb3, I'll delete partitions /dev/sdb4 and /dev/sdb5 so I can extend the size of /dev/sdb3 to include the rest of the space. It's important that the existing files on /dev/sdb4 are saved. I really don't have a drive big enough to save those files elsewhere while I do this so I'm being cautious and seeking help before doing something irreversible. I have successfully installed Mint several times but never onto existing partitions like this.

After booting to my live boot disk and starting the installation, I chose 'Do something else' as the option and could see the partitions on /dev/sdb but really didn't know how to proceed so here I am. How do I install 18.2 onto /dev/sdb2 correctly? Thanks for any guidance here. RG
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Smile, it makes people wonder what you've been up to.
User avatar
karlchen
Level 23
Level 23
Posts: 18228
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Fresh Install on /dev/sdb2 Question

Post by karlchen »

Hello, rgand.

"Something else" is always the right option when installing. It is the only option which gives you control over which disk partitions will be used for what. :D

The open question / unresolved issue which I see at the moment is that there does not seem to be any disk partition which you could use as your swap space.
Unlike Windows, Linux Mint does not create a swap file, but it uses a dedicated swap partition instead.
I would recommend using a swap partition a bit larger than RAM size, because only if the swap partition can hold the complete RAM content, you will be able to use hibernation. Else hibernation will not be possible.

Personally,I would very likely reduce the partition /dev/sdb3 by RAMSIZE*1.25 and use the now unallocated GB's and turn them into a swap partition.

But:
I see roughly 5 GB on /dev/sdb3 are in use. Suggests to me you should backup whatever is on /dev/sdb3 to an external medium (USB pendrive) so that it will not be lost by reducing the size of /dev/sdb3. (Should not happen, but who knows for sure.)

In order to install Linux Mint to /dev/sdb2, you select /sdb2 and tell the installer to mount it as /.
You might tell the same installer to use /dev/sdb3 and mount it as /home.

HTH,
Karl
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 792 days now.
Lifeline
User avatar
rgand
Level 5
Level 5
Posts: 536
Joined: Fri Feb 05, 2016 12:44 am

Re: Fresh Install on /dev/sdb2 Question

Post by rgand »

karlchen wrote:Hello, rgand.

"Something else" is always the right option when installing. It is the only option which gives you control over which disk partitions will be used for what. :D

The open question / unresolved issue which I see at the moment is that there does not seem to be any disk partition which you could use as your swap space.
Unlike Windows, Linux Mint does not create a swap file, but it uses a dedicated swap partition instead.
I would recommend using a swap partition a bit larger than RAM size, because only if the swap partition can hold the complete RAM content, you will be able to use hibernation. Else hibernation will not be possible.

Personally,I would very likely reduce the partition /dev/sdb3 by RAMSIZE*1.25 and use the now unallocated GB's and turn them into a swap partition.

But:
I see roughly 5 GB on /dev/sdb3 are in use. Suggests to me you should backup whatever is on /dev/sdb3 to an external medium (USB pendrive) so that it will not be lost by reducing the size of /dev/sdb3. (Should not happen, but who knows for sure.)

In order to install Linux Mint to /dev/sdb2, you select /sdb2 and tell the installer to mount it as /.
You might tell the same installer to use /dev/sdb3 and mount it as /home.

HTH,
Karl
Thanks for the reply, Karl. I forgot about needing a swap partition. There was a leftover Windows recovery partition on the right (/dev/sdb5) which I converted to a linux-swap partition. When I install Mint 18.2 on that drive, do I need to point that partition out to the installation software?

This morning I had created /dev/sdb3 and haven't used it for anything so your guess is as good as mine as to what is on it. I looked at it with the file manager and it shows a folder called lost+found but when I try to view the contents I get a message that says I don't have the appropriate permissions to view the contents. Should I format that partition again? Delete that folder?

I reduced the size of /dev/sdb2 by 10 GB, keeping 30 for the OS and adding the rest to /dev/sdb3. I know 30GB is more than I need for Mint but it will be large enough for whatever OS I may want to put on it in the future. austin.texas in another thread had mentioned making a separate partition for data and possibly putting /home on it, as you suggested. How much space should I allot for that? I expect to be using my data partition for just about all user files.

The 10 GB unallocated space will get added to /dev/sdb3 after I have moved everything onto it and deleted the existing /dev/sdb4. This brings up another question, can I increase the size of a partition without damaging the contents if I increase the size to the right in GParted?

I will be naming /dev/sdb3 eventually. Can that be named after data is on it without affecting the contents?

Here's the way things look at this moment:
sdb-GParted 2.png
Smile, it makes people wonder what you've been up to.
User avatar
JerryF
Level 16
Level 16
Posts: 6571
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: Fresh Install on /dev/sdb2 Question

Post by JerryF »

sdb-GParted 2.png
If you're not going to be dual booting or accessing your data with another OS besides Mint, I would do the following:


Install Mint as
  • / onto sdb2
  • /home onto sdb3
  • Leave sdb4 alone for now
Then I would boot into Mint and access sdb4 and copy all your files you want from there to your /home/(username) in Mint.

After that is successful, I would delete partition sdb4 and resize sdb3 to take over that unused space
User avatar
karlchen
Level 23
Level 23
Posts: 18228
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Fresh Install on /dev/sdb2 Question

Post by karlchen »

Hi, rgand.

Let me add only this piece of advice to JerryF's recommendations:
Even though your data on /dev/sdb4 should not be in danger at any point in time, if you follow the steps which JerryF has explained, you should seriously consider getting some reliable external backup medium (USB harddisk) nonetheless, where you backup your data in regular intervals.
Even if you never commit any mistake and never delete any relevant data file, your harddisk will not live forever. None of them do.
So if the data files on /dev/sdb4 are important, back them up.

Cheers,
Karl
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 792 days now.
Lifeline
User avatar
rgand
Level 5
Level 5
Posts: 536
Joined: Fri Feb 05, 2016 12:44 am

Re: Fresh Install on /dev/sdb2 Question

Post by rgand »

JerryF wrote:If you're not going to be dual booting or accessing your data with another OS besides Mint, I would do the following:


Install Mint as
  • / onto sdb2
  • /home onto sdb3
  • Leave sdb4 alone for now
Then I would boot into Mint and access sdb4 and copy all your files you want from there to your /home/(username) in Mint.

After that is successful, I would delete partition sdb4 and resize sdb3 to take over that unused space
I will be doing a dual boot but one OS is on another drive (SSD). It has been my intention to delete /dev/sdb4 and resize /dev/sdb3 to take that space once the files are copied over. Both OS's will access that partition. Perhaps the simplest solution is to put both / and /home on sbd2 and keep sdb3 as a separate entity, accessible by both versions of Mint.
karlchen wrote:Hi, rgand.

Let me add only this piece of advice to JerryF's recommendations:
Even though your data on /dev/sdb4 should not be in danger at any point in time, if you follow the steps which JerryF has explained, you should seriously consider getting some reliable external backup medium (USB harddisk) nonetheless, where you backup your data in regular intervals.
Even if you never commit any mistake and never delete any relevant data file, your harddisk will not live forever. None of them do.
So if the data files on /dev/sdb4 are important, back them up.

Cheers,
Karl
Yeah, I have a removable drive I do save important files on but to copy everything off the existing data drive onto it involves a lot of fiddlework to fit it all on and not have duplicate files unnecessarily. I'll get on that before proceeding, then.

Thanks to you both. I appreciate all the help. I'm sure I'll have a question or two when I get to the installation again.
Smile, it makes people wonder what you've been up to.
User avatar
rgand
Level 5
Level 5
Posts: 536
Joined: Fri Feb 05, 2016 12:44 am

Re: Fresh Install on /dev/sdb2 Question

Post by rgand »

It took a couple of days but I rounded up a drive to save data onto. Everything is backed up now so even if I trash what's on sdb, I can always put it back.

Not wanting to make a mistake and screw up my Mint 18.1 installation, I removed sda and live booted to Mint 18.2 Cinnamon 64bit to install. For the purposes of this post, I'll still call the target drive sdb even though at the time the other drive was out, it was then 'sda'. I put sda back in for now.

I designated sdb1 as bios/grub and sdb2 as / for installation. I set both partitions to be formatted. I didn't designate any destination for /home so it would default onto sdb2. Twice the installer gave an error message that "GRUB installation failed" and "The 'grub-efi-amd64-signed' package failed to install into /target/". Then the installer crashed.

I put sda back in again until I can figure out what needs to happen. I'll again temporarily remove it for the installation process.

Here's how sdb looks at this time.
sdb2070117.png
So what am I doing wrong? What is the best way to proceed, now?

Thanks, RG
Smile, it makes people wonder what you've been up to.
gold_finger

Re: Fresh Install on /dev/sdb2 Question

Post by gold_finger »

rgand wrote:I designated sdb1 as bios/grub and sdb2 as / for installation. I set both partitions to be formatted. I didn't designate any destination for /home so it would default onto sdb2. Twice the installer gave an error message that "GRUB installation failed" and "The 'grub-efi-amd64-signed' package failed to install into /target/". Then the installer crashed.
You set-up partitions for a legacy mode install to GPT drive, but USB stick got booted in UEFI mode and is trying to install that way. It can't because it needs an ESP (EFI System Partition) for grub installation. Or, maybe you pointed grub boot loader to /dev/sdb1 (incorrect) instead of /dev/sdb (correct).

If your Mint 18.1 installation was done in UEFI mode, then you should do the same with the 18.2 install. To find out, look at its drive in GParted to see if there is an EFI System Partition (formatted as FAT32, typically anywhere from 100-550MB in size). If it is in UEFI mode, then you should keep both drives in computer when installing Mint 18.2. Then you can set root partition as you did before (on /dev/sdb2) and direct grub boot loader installation to the ESP on /dev/sda -- will probably be /dev/sda1.

If Mint 18.1 was installed in Legacy mode, there won't be an ESP on its drive. If that drive is also using GPT partitions, there will be a small (unformatted) partition with flag of "bios_grub". If that drive is using MBR partitions, there won't be an ESP nor any small "bios_grub" partition. If confirmed that Mint 18.1 was installed in legacy mode, then you need to change boot mode of the USB stick. Usually that can be done by accessing UEFI/Bios Boot Menu with a special key being pushed immediately after powering on. Look for a message on screen during power-up for accessing the Boot Menu -- the key to push varies from one manufacturer to the next. EG. Dell and some Lenovos use <F12> for boot menu. HPs I think are <F9> or <F10, or <Esc> key gives description and choice of either one to hit. The boot menu for USB should show choices for either UEFI or non-UEFI booting.

NOTE: If you're doing a Legacy mode install, don't format the "bios_grub" partition -- it's supposed to be unformatted. Also, point grub boot loader to /dev/sdb, not to the "bios_grub" partition.
User avatar
rgand
Level 5
Level 5
Posts: 536
Joined: Fri Feb 05, 2016 12:44 am

Re: Fresh Install on /dev/sdb2 Question

Post by rgand »

gold_finger wrote:You set-up partitions for a legacy mode install to GPT drive, but USB stick got booted in UEFI mode and is trying to install that way. It can't because it needs an ESP (EFI System Partition) for grub installation. Or, maybe you pointed grub boot loader to /dev/sdb1 (incorrect) instead of /dev/sdb (correct).
Yes, I pointed the grub boot loader to /dev/sdb1.
gold_finger wrote:If your Mint 18.1 installation was done in UEFI mode, then you should do the same with the 18.2 install. To find out, look at its drive in GParted to see if there is an EFI System Partition (formatted as FAT32, typically anywhere from 100-550MB in size). If it is in UEFI mode, then you should keep both drives in computer when installing Mint 18.2. Then you can set root partition as you did before (on /dev/sdb2) and direct grub boot loader installation to the ESP on /dev/sda -- will probably be /dev/sda1.
My mint 18.1 was done in UEFI mode. There is an EFI partition formatted in FAT32 and 512MB in size. I'll get to trying as you suggest tomorrow. Should I format /dev/sdb1 to FAT32 first?

/dev/sda:
sda_070117.png
Thanks for the help on this. In the past, I've either started with an unformatted disk and let the installer have its way with the defaults or upgraded from one Linux OS to another. This is my first attempt at working with a drive with formatted partitions that don't have an OS installed. Will report back with how it goes.
Smile, it makes people wonder what you've been up to.
User avatar
Sgthawker
Level 4
Level 4
Posts: 226
Joined: Sun Apr 27, 2014 2:23 am

Re: Fresh Install on /dev/sdb2 Question

Post by Sgthawker »

If you leave sda & sdb installed you don't need to create a second esp partition on sdb. The installer will see the first esp in the sequence of searching for one, and will install grub to sda even if you direct the installer to use sdb. I have run into this issue before while installing multi boot Linux and windows OSs in uefi mode.
LM21.1 KDE/LM21.1 Cin/ UEFI Tuf Gaming X570 Plus, Ryzen 7 5800X, GTX 3060, Samsung 980 Pro M.2 NVMe
LM21.1 KDE/LM21.1 Cin/ UEFI on STRIX laptop, i7700 HQ, GTX 1060, Samsung 980 Pro M.2 NVMe
User avatar
rgand
Level 5
Level 5
Posts: 536
Joined: Fri Feb 05, 2016 12:44 am

Re: Fresh Install on /dev/sdb2 Question

Post by rgand »

Sgthawker wrote:If you leave sda & sdb installed you don't need to create a second esp partition on sdb. The installer will see the first esp in the sequence of searching for one, and will install grub to sda even if you direct the installer to use sdb. I have run into this issue before while installing multi boot Linux and windows OSs in uefi mode.
Thanks for the reply. sdb doesn't have an installed OS on it. That was Win 7 and I happily formatted it away. I'm now creating partitions on sdb and installing onto them for a second boot option. One of the upgrades the other day was for a new kernel and the grub menu disappeared, I assume overwritten, so I guess there's no boot sequence to find.
Smile, it makes people wonder what you've been up to.
gold_finger

Re: Fresh Install on /dev/sdb2 Question

Post by gold_finger »

rgand wrote:My mint 18.1 was done in UEFI mode. There is an EFI partition formatted in FAT32 and 512MB in size. I'll get to trying as you suggest tomorrow. Should I format /dev/sdb1 to FAT32 first?
No need to do that. Can keep as is (won't hurt anything).

When installing 18.2, set root partition to /dev/sdb2 and set "Device for boot loader installation" to /dev/sda1 (the already existing ESP). You'll need both drives in computer when installing.
User avatar
rgand
Level 5
Level 5
Posts: 536
Joined: Fri Feb 05, 2016 12:44 am

Re: Fresh Install on /dev/sdb2 Question

Post by rgand »

gold_finger wrote:
rgand wrote:My mint 18.1 was done in UEFI mode. There is an EFI partition formatted in FAT32 and 512MB in size. I'll get to trying as you suggest tomorrow. Should I format /dev/sdb1 to FAT32 first?
No need to do that. Can keep as is (won't hurt anything).
OK, good to know.
gold_finger wrote:When installing 18.2, set root partition to /dev/sdb2 and set "Device for boot loader installation" to /dev/sda1 (the already existing ESP).You'll need both drives in computer when installing.
i see the need for both drives to be in if installed this way. If sda happens to fail though, will sdb still work as a stand-alone drive and if I add a second drive would the grub menu then install on sdb? Would sdb at that time become sda and the 'device for boot loader' then be correct?

Forgive the newbie questions, but I'm trying to understand this. In the end, I would like to have the option of removing either drive (maybe at some unknown time in the future) and have the remaining one boot as a stand-alone. Then I could add another drive and install a new OS on that, perhaps for a newer system or something.

I appreciate all the great guidance. This is all starting to make sense to me.
Smile, it makes people wonder what you've been up to.
User avatar
rgand
Level 5
Level 5
Posts: 536
Joined: Fri Feb 05, 2016 12:44 am

Re: Fresh Install on /dev/sdb2 Question

Post by rgand »

gold_finger wrote:When installing 18.2, set root partition to /dev/sdb2 and set "Device for boot loader installation" to /dev/sda1 (the already existing ESP). You'll need both drives in computer when installing.
With both drives in, I set the install this way (/ to go on /dev/sdb2 but you can't see it in the screenshot of the installation window). I then got this warning window that three partitions were gong to get formatted although I only set /dev/sdb2 to be formatted. I am not sure which partitions are going to be formatted so I canceled the installation and figured I'd better ask what this means. Here is the message window and a screenshot of the installation window.
InstallMess_070217-2.jpg
InstallMess_070217.png.jpg
Smile, it makes people wonder what you've been up to.
gold_finger

Re: Fresh Install on /dev/sdb2 Question

Post by gold_finger »

That's normal -- it's formatting root partition and the swap partitions it detects. I forgot that you already have a swap partition on /dev/sda, so you don't need a second one on /dev/sdb. You can delete the swap on sdb drive and installer will use already existing one on sda. When done, both versions of Mint on computer will use the swap partition on /dev/sda3. Installer for 18.2 will not break ability of 18.1 to use it -- so no worries.
User avatar
rgand
Level 5
Level 5
Posts: 536
Joined: Fri Feb 05, 2016 12:44 am

Re: Fresh Install on /dev/sdb2 Question

Post by rgand »

gold_finger wrote:That's normal -- it's formatting root partition and the swap partitions it detects. I forgot that you already have a swap partition on /dev/sda, so you don't need a second one on /dev/sdb. You can delete the swap on sdb drive and installer will use already existing one on sda. When done, both versions of Mint on computer will use the swap partition on /dev/sda3. Installer for 18.2 will not break ability of 18.1 to use it -- so no worries.
Thanks, I was a little concerned. I'll let it go beyond that, then. But, won't I need the swap partition on sdb if I have to remove sda?
Smile, it makes people wonder what you've been up to.
gold_finger

Re: Fresh Install on /dev/sdb2 Question

Post by gold_finger »

rgand wrote:But, won't I need the swap partition on sdb if I have to remove sda?
These days swap is most important if you plan to use hibernation. Aside from that it will rarely be used (or "needed") if you've got plenty of RAM (4-8GB or more).
rgand wrote:i see the need for both drives to be in if installed this way. If sda happens to fail though, will sdb still work as a stand-alone drive and if I add a second drive would the grub menu then install on sdb? Would sdb at that time become sda and the 'device for boot loader' then be correct?

Forgive the newbie questions, but I'm trying to understand this. In the end, I would like to have the option of removing either drive (maybe at some unknown time in the future) and have the remaining one boot as a stand-alone. Then I could add another drive and install a new OS on that, perhaps for a newer system or something.
Somehow I completely missed reading this post of yours before. Didn't realize you would like to make the drive able to boot as a stand-alone drive if removing other one. In that case here is what I would do:
  1. Open GParted while booted into live Mint 18.2 USB and select to show /dev/sdb.
  2. Delete /dev/sdb1 and /dev/sdb2; hit "Apply" button to finalize deletions. (If it won't let you delete them, right-click the swap partition on /dev/sdb5 and choose "Swapoff", then try again to delete first two partitions.)
  3. Now make the two partitions again. This time first one formatted as FAT32, size = 550MB. Second one formatted as Ext4, size = rest of remaining space between first and third partitions. Hit "Apply".
  4. Right-click on /dev/sdb1 (the FAT32 partition you just made) and choose "Manage flags", then set flag as "esp". Hit "Apply".
  5. Leave Swap partition (or remake it if you deleted it) at end of drive where you have it now. If plan to use hibernation, make it slightly bigger than amount of RAM you have. Otherwise 2-4GB should be fine.
  6. Done.
I know it's okay to have more than one ESP, but I've never done so myself and don't know exactly how system handles that. So not entirely sure if system will show choice to boot new Mint 18.2 when your done, or if you'll need to manually do something else afterwards to get the boot choice. For now, let's try using the second ESP and see what happens. (EDIT: Do not continue with these instructions. See post below by Sgthawker about using more than one ESP and my revised instructions after it.) Start installer, choose "Something else" install method, set root partition as you did before, then select the ESP on /dev/sdb1, click "Change" and set it as the EFI Boot Partition for this install.

Here's a pic as an example:
Image

Near bottom of window, set "Device for boot loader installation" to /dev/sdb1 (the ESP on sdb).

Finish install and hopefully you see choice for booting new install after reboot when done. If not, boot into Mint 18.1, open a terminal and post back with results of this command in a terminal:

Code: Select all

efibootmgr -v
Last edited by gold_finger on Mon Jul 03, 2017 10:27 am, edited 2 times in total.
User avatar
Sgthawker
Level 4
Level 4
Posts: 226
Joined: Sun Apr 27, 2014 2:23 am

Re: Fresh Install on /dev/sdb2 Question

Post by Sgthawker »

I installed Win 7 in UEFI with the ESP on it's sda1 partition with the single drive installed in my desktop system. I then disconnected it while I installed my m.2 drive and setup my ESP with several / for multiple distros, a DATA, and swap and after my installs of linux, I then reinstalled the sda with my m.2, selected the m.2 as first boot device in my UEFI, ran my primary distro and updated grub to allow a Win boot(fortunately a rare event).

In the past with UEFI installs I had 3 drives and couldn't get the ESP to go to the right drive. After research I found that the installer will put it's boot loader into the first ESP it sees in the sequence of how it searches for them upon the boot loader portion of the install, regardless of what you select during the install setup.
LM21.1 KDE/LM21.1 Cin/ UEFI Tuf Gaming X570 Plus, Ryzen 7 5800X, GTX 3060, Samsung 980 Pro M.2 NVMe
LM21.1 KDE/LM21.1 Cin/ UEFI on STRIX laptop, i7700 HQ, GTX 1060, Samsung 980 Pro M.2 NVMe
gold_finger

Re: Fresh Install on /dev/sdb2 Question

Post by gold_finger »

@Sgthawker,

Thank you very much for posting that info on using more than one ESP! That clears things up.


@rgand,

According to what Sgthawker just said, best thing to do would be to disconnect the Mint 18.1 drive, make partitions I described above on Mint 18.2 drive and install to them. Reboot computer after install to make sure new install works. Then reconnect first drive. If you want Mint 18.1 to be in charge of booting, leave its drive as first in boot order then run sudo update-grub to add boot entries for new Mint 18.2.

If you want Mint 18.2 to control booting, set its drive ahead of other one in device boot order in UEFI settings, then run sudo update-grub in it to add entries for old Mint 18.1.
User avatar
rgand
Level 5
Level 5
Posts: 536
Joined: Fri Feb 05, 2016 12:44 am

Re: Fresh Install on /dev/sdb2 Question

Post by rgand »

OK, then. These last couple posts did the trick. I didn't know to "Manage Flags" so any install I did short of a full format and letting Mint take the defaults was probably not going to work. 18.2 Cinnamon is up and running well. I updated the grub menu on both drives so no matter which is first in the boot priority, both boot options are available. I did change the priority to my SSD but that's just my preference, not a necessity. I'll go mark this thread [SOLVED].

You guys are golden. Many thanks.
Smile, it makes people wonder what you've been up to.
Locked

Return to “Installation & Boot”