1

The last time I touched Unix of any flavor it was Solaris, so please forgive me. I'm am so very rusty.

I decided to build a home lab and get back into things. I've built, destroyed, and rebuilt my Ubuntu server more times in the last week than I can count. But I have a new issue. It will seem simple to you, but it's scary to me.

I intend to add a log aggregator to this box, and it's an HP min. So, I got a 1TB external drive and plugged into it. I also made the mistake of rebuilding a time or two with that drive plugged in so I think it may have hosted the OS once, and that's where the partitions come from.

So, here is the problem. When I look at lsblk, it looks like this:

lsblk

While my fstab looks like this:

fstab

Now, from what my old mind can figure out, root "/" is mounted to a virtual drive of some sort, which is part of the 500GB drive inside the machine. I am reading up on how that works, but after all this time, it's new to me. It was setup that way by the install, I do not know why.

The /boot, /boot.efi, and swap I don't have problems with. But I want to mount the new drive and it looks like it already has some partitions.

The old drive looks like: internal drive

And the new drive looks like this: external drive

On the internal/old drive the first 2 partitions are mounted, but the third is not.

On the external/new drive none of them are mounted.

So, hoping I gave you enough information, is it safe to mount partition 3 on the old/internal drive, I ask because that's where the "lvm" for the root "/" mount is and I don't wanna mess it up somehow.

Second, is it safe to remove all 3 partitions from the new/external drive and create a new one, then mount it?

And lastly, I assume the best way to do this is still fdisk?

I've spent a lot of time relearning all of this. I've rebuilt the box so many times the idea of doing it again scares the hell out of me. So, I'm being cautious and asking the experts before I do anything that could kill the machine. I have DNS, mail, pihole, and a few other things on it right now, and they are all working. I would not like to have to reinstall them, again.

Thanks so much for any help, and advice. I feel very much the noob again.

Dennis

dsb9938
  • 31
  • 1
    Why couldn't you mount partition 3? The easiest way to mount partitions is that same GUI you showed us: https://askubuntu.com/q/164926/1004020 Then you can move to fstab for specialized setups. I never saw Fdisk used to mount partitions. Deleting partitions is fine if they aren't in fstab. Make sure you make new folders instead of using "/" or just let the GUI automatically create one in /media – Daniel T Mar 02 '24 at 01:50
  • It isn't that I couldn't, it's that I wasn't sure if the lvm mount for root was something that would auto grow in size or something. I was afraid if I took the rest as a mount, and it needed more room, it would fail. And I meant to use fdisk to remove the existing partitions and create one full drive new one. – dsb9938 Mar 02 '24 at 02:11
  • 2
    Welcome to Ask Ubuntu. Please don't put screenshots of the terminal. If possible copy the text and paste it directly into your question. Then select the pasted text and format it as code using the {_} icon above the edit window. – user68186 Mar 02 '24 at 02:44
  • I did not see, or select on purpose, the lvm option. I assume there is no way to remove it now? – dsb9938 Mar 02 '24 at 02:52
  • 1
    Simplest way to remove LVM is to copy to a new partition, but LVM isn't that important for your question about mounting drives. Your question also said nothing about growing the partitions, and growing partitions should be avoided to reduce complexity – Daniel T Mar 02 '24 at 02:57
  • Okay, based on the advice of Daniel, I removed the three partitions on the external drive, created and formatted a new one. It is now in fstab, and mounts on boot with general use access. I am still unsure about the other, because gpartd will not let me do anything with the partition. I think the lvm has it locked or something. It looks like that whole space is taken by the lvm, and I'm fine with that as long as the drive space is not wasted. PS - sorry about the images, I didn't know how to post the text. Next time I'll get it right. – dsb9938 Mar 02 '24 at 02:58

1 Answers1

2

Okay, here's what I did. Removed the 3 partitions on the external drive, created one new one, mounted it in fstab, rebooted, set permissions.

The 'lvm' partition looks like something that grows as needed into the available space. I will leave it alone for now and read up on how lvm works. Then I can decide to leave it, or not.

I would like to thank everybody who who helped me in the comments. You guys made me think about things by asking questions, rather than telling me things. That made me go look things up, and hopefully learn something.

-Kudos

As a followup: lvm is forever. You cannot convert it to a regular partition. This being the case, I am just going to leave it and expand it to fill the drive. Thanks oh so much Ubuntu!

The end of the story:

I just resized the existing logical volume to fill the drive it was on. This is how I expected the install to go anyway. So now, I have my one normally partitioned drive, and the one logical. All is good in the world. As a side note, unless you need to span a bunch of drives to make a large partition (which I would rather do with RAID) I do not recommend LVM

dsb9938
  • 31
  • 1
    You might also want move the data from the LVM into a regular partition like user68186 said. Now I think there might be a UUID or name conflict somewhere, and removing LVM would be simpler than debugging it – Daniel T Mar 02 '24 at 03:09
  • I think it best I learn exactly how it works before I put my dirty fingers into it. After that, I can decide if it needs to go or not. And thanks again for the help. – dsb9938 Mar 02 '24 at 03:13
  • 2
    I do not use LVM, but those that do have posted best not to have volume on two drives. If one drive fails, you lose all data on both drives. You can have separate volumes on each drive. https://ubuntuforums.org/showthread.php?t=2461714 & https://ubuntuforums.org/showthread.php?t=2491117 – oldfred Mar 02 '24 at 03:54
  • I just resized the existing logical volume to fill the drive it was on. This is how I expected the install to go anyway. So now, I have my one normally partitioned drive, and the one logical. All is good in the world. As a side note, unless you need to span a bunch of drives to make a large partition (which I would rather do with RAID) I do not recommend LVM. – dsb9938 Mar 02 '24 at 04:46