Page 1 of 1

More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 12:14 pm
by Sparky
I have a 1TB drive. MX takes about 600 and the rest are in 2 partitions. I cant delete them, I can't format them and cant resize the main partition. I don't know what to do to reclaim the space for MX. I even tried a live version of Gparted with the same results.

Here is a pic:
Image

Re: More Gparted problems.

Posted: Sun Sep 27, 2020 12:18 pm
by Sparky
Solved it after I posted it. I had been trying for hours, I should have not collapsed the 2nd partition...

Re: More Gparted problems.

Posted: Sun Sep 27, 2020 12:20 pm
by uncle mark
Sparky wrote: Sun Sep 27, 2020 12:18 pm Solved it after I posted it. I had been trying for hours, I should have not collapsed the 2nd partition...
I'm sure the fact that the "second" partition was a logical inside an extended was probably in play.

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 12:24 pm
by rob.chaffe
You've lost the swap partition, if this is the same drive you asked help for a few days ago. Do you have a delay when booting, as the system looks for the missing swap?

Rob

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 12:26 pm
by Sparky
rob.chaffe wrote: Sun Sep 27, 2020 12:24 pm You've lost the swap partition, if this is the same drive you asked help for a few days ago. Do you have a delay when booting, as the system looks for the missing swap?

Rob
Yes! It says it can't find it. Can I restore it or make a new one?

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 12:29 pm
by tony37
Sparky wrote: Sun Sep 27, 2020 12:26 pm Yes! It says it can't find it. Can I restore it or make a new one?
making a swap partition isn't difficult (just pick linux-swap as file system), but you have to make sure your /etc/fstab file is correctly pointing to it

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 12:34 pm
by Sparky
tony37 wrote: Sun Sep 27, 2020 12:29 pm
Sparky wrote: Sun Sep 27, 2020 12:26 pm Yes! It says it can't find it. Can I restore it or make a new one?
making a swap partition isn't difficult (just pick linux-swap as file system), but you have to make sure your /etc/fstab file is correctly pointing to it
I don't kno how to make a new 2GB partition, let alone point to it :confused:

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 12:36 pm
by rob.chaffe
Let's start at the beginning. In GParted select; View, Device information. If the device partition table is MSDOS, one must use an Extended Partition to use more than 4 partitions. If it's GPT, Extended Partition is not needed to have more than 4 partitions.
https://i.postimg.cc/RhBd5fZ0/Screensho ... -28-29.png

Then clearly state what you'd like to accomplish.

Rob

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 12:38 pm
by Sparky
It's like this now. Wont let me create a new partition.

Image

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 12:39 pm
by Sparky
rob.chaffe wrote: Sun Sep 27, 2020 12:36 pm Let's start at the beginning. In GParted select; View, Device information. If the device partition table is MSDOS, one must use an Extended Partition to use more than 4 partitions. If it's GPT, Extended Partition is not needed to have more tham 4 partitions.
https://i.postimg.cc/RhBd5fZ0/Screensho ... -28-29.png

Then clearly state what you'd like to accomplish.

Rob
It's MSDOS. Should I reformatted?

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 12:40 pm
by rob.chaffe
No. Do Not. You will loose everything.

Rob

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 12:40 pm
by Eadwine Rose
If you are going to reformat, just start new and fresh. Because I haven't looked at your screenshot but that WILL wipe all data on that partition.

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 12:41 pm
by rob.chaffe
What is it you want to accomplish?

Rob

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 12:44 pm
by Sparky
Oh man! I'll make a new install.
Thanks everyone!
I just wanted to create a new SWAP partition for the current install.

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 12:45 pm
by Sparky
Eadwine Rose wrote: Sun Sep 27, 2020 12:40 pm If you are going to reformat, just start new and fresh. Because I haven't looked at your screenshot but that WILL wipe all data on that partition.
How can I make sure it wont create a new MSDOS device on a new install?

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 12:48 pm
by rob.chaffe
Device, Create new partition table in GParted.

https://i.postimg.cc/4xPFZWDh/Screensho ... -48-48.png

Rob

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 12:51 pm
by tony37
question: do you use UEFI for booting?

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 12:53 pm
by Sparky
tony37 wrote: Sun Sep 27, 2020 12:51 pm question: do you use UEFI for booting?
No, Legacy

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 12:55 pm
by tony37
Sparky wrote: Sun Sep 27, 2020 12:53 pm
tony37 wrote: Sun Sep 27, 2020 12:51 pm question: do you use UEFI for booting?
No, Legacy
Then I have learned from Huckleberry Finn that MBR (also called msdos) is the way to go after all. I think the safest thing is just making this swap partition.

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 12:56 pm
by Sparky
rob.chaffe wrote: Sun Sep 27, 2020 12:48 pm Device, Create new partition table in GParted.

https://i.postimg.cc/4xPFZWDh/Screensho ... -48-48.png

Rob
Can't
Image

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 12:57 pm
by tony37
Of course you have to unmount the partition first, so you have to do this from live USB.

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 12:58 pm
by Sparky
tony37 wrote: Sun Sep 27, 2020 12:57 pm Of course you have to unmount the partition first, so you have to do this from live USB.
Ahhh, ok, I already have it on USB, will do it now, Thanks.

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 12:58 pm
by rob.chaffe
Boot MX Linux from your thumb drive (or DVD) for a fresh install. At the second or third screen, there is an option to run GParted. Set partition table. Then create main partition leaving space for swap after the main partition. Create swap, Finish the install.

Rob

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 12:59 pm
by tony37
Then shrink the partition. If you don't want to hibernate your system then 2 GB for swap will be enough I guess.

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 1:01 pm
by uncle mark
Sparky wrote: Sun Sep 27, 2020 12:38 pm It's like this now. Wont let me create a new partition.

Image
Shrink the existing partition (drag from the right) to leave a few gigs for swap. Do this as a single operation.

Then, in a new operation, create a new swap partition in the newly created space.

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 1:05 pm
by rob.chaffe
I'm going to bow out because there are too any cooks stirring the pot. And the OP changes his mind so fast it's hard to keep up.

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 1:08 pm
by Sparky
Gparted live said that If I create a new partition it will erase ALL data on the main partition. What If I just use it without SWAP?

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 1:10 pm
by tony37
Sparky wrote: Sun Sep 27, 2020 1:08 pm Gparted live said that If I create a new partition it will erase ALL data on the main partition. What If I just use it without SWAP?
Are you sure it says that? Gparted always warns about potential data loss.
Using without Swap is possible, I think you have enough RAM when you have 12 GB. But you'll have to edit your /etc/fstab file anyway, so you can post that if you want advice there.

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 1:13 pm
by Sparky
contents of fstab (I do have 12 GB of RAM on this laptop)

Code: Select all

# Pluggable devices are handled by uDev, they are not in fstab
UUID=2f851df4-e0ec-425b-8944-8276cf36f4e0 / ext4 defaults 1 1
UUID=db352309-b3e7-4d6b-83bd-2ef92cd8dac1 swap swap defaults 0 0 

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 1:17 pm
by tony37
If you don't want a swap partition (making a swap file later on should also be possible) then you simply remove the last line from fstab (that UUID doesn't exist anymore anyway).

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 1:19 pm
by Sparky
tony37 wrote: Sun Sep 27, 2020 1:17 pm If you don't want a swap partition (making a swap file later on should also be possible) then you simply remove the last line from fstab (that UUID doesn't exist anymore anyway).
Thanks Tony!

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 1:20 pm
by tony37
It's possible that your system will still try to resume from swap, is there somewhere a "RESUME" variable in your /etc/default/grub file?

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 1:23 pm
by Sparky
No resume:

Code: Select all

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(unset PRETTY_NAME; (. /etc/lsb-release; echo ${PRETTY_NAME:?}) 2>/dev/null || echo Debian)"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 1:27 pm
by tony37
Ok, then I think things should go fine. Let me know if booting does take a lot longer than expected, or if you'd get an error.

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 1:32 pm
by Sparky
Will do, thanks!

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 1:51 pm
by tony37
Do you ever get close to using 12GB RAM? In that case it's best to make a swap file, following this guide worked for me. You can always remove it afterwards, there also isn't this gparted hassle involved.

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 4:30 pm
by Sparky
The link points back to this thread.

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 4:42 pm
by tony37
oops, corrected

There's a lot of explanation there, if you just want instructions to create a 2GB swapfile:

Code: Select all

sudo dd if=/dev/zero of=/swapfile bs=1024 count=2000000
sudo mkswap /swapfile
sudo chmod 600 /swapfile
sudo swapon /swapfile
and then add the following to /etc/fstab if you want to boot with it:

Code: Select all

/swapfile    none    swap    sw    0    0
If you want, say a 4GB swapfile, then change count=2000000 in the first command to count=4000000

And to remove the swapfile: remove the entry from /etc/fstab (or put a '#' in front of it) and:

Code: Select all

sudo swapoff /swapfile
sudo rm /swapfile

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 5:14 pm
by Sparky
Thanks Tony, I really appreciate your help!
I find myself running out of RAM when I use VirtualBox, which wasn't as apparent before, so I'll add the 4GB swap.

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 5:59 pm
by Sparky
Did it!

Code: Select all

$ swapon --show
NAME      TYPE SIZE USED PRIO
/swapfile file 3.8G   0B   -2

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 6:25 pm
by Stuart_M
I am not sure swap files as opposed to a dedicated swap partition is a good option. I have seen some information saying that it should be on its own dedicated partition.

One post you may want to look at is by user "p.H" http://forums.debian.net/viewtopic.php?p=706232#p706232 (20 August 2019) who said
Do think twice before doing that. Linux was designed to use raw block devices as swap space, and still is. Using swapfiles with Linux is a hack. A dirty one. It does not work natively on filesystems types which do not allow to map files to physical blocks, use copy-on-write, and so on ; making it work natively on some of them (NFS, Btrfs) has required heavy intrusive kernel patching. The only clean way to use a swap file would be through a loop device, which incurs a performance penalty.
I have heard both ways, that swap files are just as good as dedicated partitions, and that users have good results with a swap file vice partition.

I prefer a dedicated swap partition - just another point of view.

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 6:36 pm
by tony37
Sparky wrote: Sun Sep 27, 2020 5:59 pmDid it!
Nice.
It would have surprised me if Gparted would really have erased your main partition if you just chose to shrink it, but I can't guarantee of course. Anyway, partitioning is always a bit tricky, just making a file feels a lot safer (as long as there is enough space for it and you don't enter too many zeroes after 'count=').
When you get to the point that swap is heavily being used, it's time to close some applications anyway as swap is not a real substitute for RAM, it just functions as a bit of a safety measure, but when a lot of swap is being used your pc becomes unworkably slow anyway. At least in my experience.

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 6:45 pm
by tony37
Stuart_M wrote: Sun Sep 27, 2020 6:25 pm I am not sure swap files as opposed to a dedicated swap partition is a good option.
If the OP would have used hibernation, then I would have been more cautious about using a swap file.
I think Linux Mint uses a swap file by default now, so it can't be that outlandish.

Re: More Gparted problems. [SOLVED]

Posted: Sun Sep 27, 2020 6:49 pm
by tascoast
I like having a 'data' partition, so that rearranging a drive with Gparted becomes easier. I have moved partitions few times without errors and find Gparted reliable, warnings of potential data loss aside.

Having spent some time setting up and modifying multiple partitions on several drives there are some tricks and strategies you can adopt to move, resize, create... with minimal juggling, such a keeping free target space to the right etc. It's really helpful to size partitions in multiples of 1,024, I think, if you want a precise 20GB root/30MB home, a rough target I go for (having big files in a 'data' partition). You can even try to create partitions in a specific order to get sda1, sda2, sda2...in the sequence you prefer, although labeling partitions in Gparted is probably the most effective way to keep things manageable in Thunar etc, where partitions become easily identifiable.

Re: More Gparted problems. [SOLVED]

Posted: Mon Sep 28, 2020 11:20 am
by Sparky
This is correct for fstab right?

Code: Select all

UUID=2f851df4-e0ec-425b-8944-8276cf36f4e0 / ext4 defaults 1 1
UUID=db352309-b3e7-4d6b-83bd-2ef92cd8dac1 swap swap defaults 0 0 
/swapfile    none    swap    sw    0    0

Re: More Gparted problems. [SOLVED]

Posted: Mon Sep 28, 2020 11:49 am
by tony37
That second entry is of your disappeared swap partition, didn't you already delete that?
The rest is ok.

Re: More Gparted problems. [SOLVED]

Posted: Mon Sep 28, 2020 11:52 am
by Sparky

Code: Select all

UUID=2f851df4-e0ec-425b-8944-8276cf36f4e0 / ext4 defaults 1 1 
/swapfile    none    swap    sw    0    0
Thanks!

Re: More Gparted problems. [SOLVED]

Posted: Mon Sep 28, 2020 12:11 pm
by Sparky
tascoast wrote: Sun Sep 27, 2020 6:49 pm I like having a 'data' partition, so that rearranging a drive with Gparted becomes easier. I have moved partitions few times without errors and find Gparted reliable, warnings of potential data loss aside.

Having spent some time setting up and modifying multiple partitions on several drives there are some tricks and strategies you can adopt to move, resize, create... with minimal juggling, such a keeping free target space to the right etc. It's really helpful to size partitions in multiples of 1,024, I think, if you want a precise 20GB root/30MB home, a rough target I go for (having big files in a 'data' partition). You can even try to create partitions in a specific order to get sda1, sda2, sda2...in the sequence you prefer, although labeling partitions in Gparted is probably the most effective way to keep things manageable in Thunar etc, where partitions become easily identifiable.
Aren't you limited by 4 partitions in MBR?
If I hadn't deleted my SWAP by accident, I'd be able to create a new partition, but with the 1, even Live Gparted gave me a warning of potential data loss to my MX install (the 1 and only partition). I keep Timeshift updates, but I have so many apps and downloads, that reinstalling MX would be a pain.

Re: More Gparted problems. [SOLVED]

Posted: Mon Sep 28, 2020 12:17 pm
by tony37
Sparky wrote: Mon Sep 28, 2020 12:11 pm Aren't you limited by 4 partitions in MBR?
In principle, yes, but in MBR you can create an 'extended' partition in which you can create as many 'locigal' partitions as you want.
Sparky wrote: Mon Sep 28, 2020 12:11 pmIf I hadn't deleted my SWAP by accident, I'd be able to create a new partition, but with the 1, even Live Gparted gave me a warning of potential data loss to my MX install (the 1 and only partition).
Gparted always warns about potential data loss, even if you want to simply change a label. So by all likelihood, creating a swap partition would have gone just fine.

Re: More Gparted problems. [SOLVED]

Posted: Mon Sep 28, 2020 12:20 pm
by Sparky
So I know for the next time, what should I use instead of MBR?
What If I want MX, MX-KDE- and another distro on the same computer?

Re: More Gparted problems. [SOLVED]

Posted: Mon Sep 28, 2020 12:38 pm
by tony37
GPT would be recommended but then you'd preferably have to boot using UEFI (not Legacy). And then you'd need to make an ESP (EFI system partition), formatted as FAT32, with flags 'boot' and 'esp', and let's say about 200MB large to be on the safe side. Although 100MB will be more than enough normally.
And converting MBR to GPT is really dangerous, although I have read about people doing this without data loss.

Is there a specific reason you use Legacy boot and not UEFI?

Re: More Gparted problems. [SOLVED]

Posted: Mon Sep 28, 2020 12:53 pm
by Sparky
I thought it was the default, and that EFI is more complicated and hence I stayed with legacy for ages.

Re: More Gparted problems. [SOLVED]

Posted: Mon Sep 28, 2020 6:13 pm
by uncle mark
Sparky wrote: Mon Sep 28, 2020 12:20 pm So I know for the next time, what should I use instead of MBR?
What If I want MX, MX-KDE- and another distro on the same computer?
MBR would handle this fine as long as you aren't going to use separate /home partitions. With MBR, you get four partitions, so you'd have three for your OSs and one for swap. The three OSs can share the same swap.

Re: More Gparted problems. [SOLVED]

Posted: Mon Sep 28, 2020 6:26 pm
by Sparky
3 OSs with 1 SWAP each= 6
What am I missing?

Re: More Gparted problems. [SOLVED]

Posted: Mon Sep 28, 2020 7:05 pm
by tascoast
Sparky wrote: Mon Sep 28, 2020 6:26 pm 3 OSs with 1 SWAP each= 6
What am I missing?
Extended partitions, allowing many partitions?

Re: More Gparted problems. [SOLVED]

Posted: Mon Sep 28, 2020 7:09 pm
by tony37
Sparky wrote: Mon Sep 28, 2020 6:26 pm 3 OSs with 1 SWAP each= 6
What am I missing?
3 os +1 swap = 4
(but don't hibernate when you're sharing swap)

Re: More Gparted problems. [SOLVED]

Posted: Mon Sep 28, 2020 7:28 pm
by fehlix
OK, guys to confuse you all. In MBR/BIOS/legacy you can format your drive/hdd/ssd to GPT.
If you create as first 1MB sized bios_grub partition, you can have all the benefit of GPT and still install in BIOS/MBR mode as you would normally do on a MSDOS/MBR partitioned drive . How does this sound?
:puppy:

Re: More Gparted problems. [SOLVED]

Posted: Tue Sep 29, 2020 5:25 am
by asqwerth
Adding to fehlix's post, just remember that mbr is not exactly equivalent of msdos.

Msdos is the legacy partition table style, where you can only set up 3 primary partitions and one extended partition (like a sausage tube) into which you can squeeze many logical partitions.

Gpt is new style partition table where you can have as many primary partitions as you want.

Msdos partition table is often associated with legacy boot. In legacy boot using msdos partition table, the bootloader is written onto the mbr, which is kind of just the front bit of the whole device /drive. This bit is not part of a formatted partition. So if you want to leave enough space for your mbr because you multiboot and may need a larger bootloader, just start your first partition maybe 500mb in from the extreme left end of the drive.

Uefi is the new style of managing bootloader, where one creates a separate efi partition formatted as fat32 with a boot flag. The efi partition is where you can install all the bootloaders of all your distros. It's like a dumping ground for bootloaders. Then you need to decide which distro's bootloader (usually grub) controls booting on your machine. You can shift the order of all the grubs in efi partition by accessing the bios of your machine or using efibootmgr command from within any of your distros. Shift your controlling grub to the top of the list of grubs.

Mostly Gpt is associated with Uefi boot.

But I believe fehlix is saying that if you use Gpt partition table, you can still use legacy boot by having some partition emulate the mbr at the front end of a msdos partition table. That gives you the simplicity of legacy boot with the ability to have tons of partitions on your drive.

Re: More Gparted problems. [SOLVED]

Posted: Tue Sep 29, 2020 7:30 am
by Sparky
Oh boy. It gets more complicated by the minute.

Re: More Gparted problems. [SOLVED]

Posted: Tue Sep 29, 2020 7:36 am
by richb
Good summary asqwerth.