Partition Questions Re-Partitioning <Solved>

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Locked
User avatar
phd21
Level 19
Level 19
Posts: 9629
Joined: Thu Jan 09, 2014 9:42 pm
Location: Florida

Partition Questions Re-Partitioning <Solved>

Post by phd21 »

Hi Everyone,

I have a common setup scenario that a lot of users have. I have a dual boot system: I have MS Windows (XP Pro-NTFS) Primary partition installed originally, and then I installed Linux Mint 17.1 KDE as another partition along with the "linuxswap" mini partition; I let Linux Mint auto-install itself. I found that I do not use the MS Windows XP partition any more; plus I have MS Win XP in my Linux mint VirtualBox. So, I want to reclaim the space taken up by that original Windows partition for use in my Linux Mint KDE partition.

Original setup: one hard drive

/dev/sda ------> /dev/sda1 ntfs (win xp pro) boot
/dev/sda2 extended lba
/dev/sda5 ext4 (LM17.1 kde)
/dev/sda6 linuxswap

1. I used a live Linux Mint KDE DVD to bring up its "partition manager" to easily delete the MS Windows partition (right click the swap partition and disable, then right click Windows partition and delete, & hit "apply"). But, when I tried to move the partition to the left to reclaim that 1st partition's space (from MS Windows), it would not let me? So, I booted up to my "gparted live" partition manager DVD (great, useful program to have), and it did let me move the "sda2" over to the left and then I could resize my "sda5" partition to reclaim the space. It took a long time, but it worked well. Booted up just fine without even having to recreate the Grub2 boot up. I realize that I could have booted up the "gparted live" DVD to do the whole process, but why didn't my Linux Mint partition manager allow me to move the extended partition?

2. Now I noticed that my system did not change the drive designators to something like "sda1", "sda2", etc...
I still have the /dev/sda2 extended lba
/dev/sda5 ext4 (LM17.1 kde)
/dev/sda6 linuxswap

Even though everything is working fine, is there a way to easily and safely change these drive designators to "sda1", "sda2", etc..? Can I, and should I, try to change the "extended" logical partition to "primary" partition? Then I would not have three displayed partitions when there are really only two? Perhaps using "testdisk" or "fixparts"?

Thank you all in advance ...
Last edited by phd21 on Fri Jun 19, 2015 12:47 pm, edited 5 times in total.
Phd21: Mint 19.2 Cinnamon & xKDE (Xfce) & KDE Neon 64-bit Awesome OS's, Dell Inspiron I5 7000 2 in 1, Dell OptiPlex 780 Core2Duo E8400 3GHz,4gb Ram, Intel 4 Graphics. I use KDE?:https://opensource.com/life/15/4/9-reasons-to-use-kde

User avatar
seeley
Level 7
Level 7
Posts: 1867
Joined: Sun Mar 07, 2010 7:20 am

Re: Partitioning Questions Re-Partitioning

Post by seeley »

Hi phd21!
For a better understanding please post a screenshot of GParted.
But you must know: changing partitions is not a good idea - it can take hours and fail (loss of Data)!
If you only want one OS, the best way is:
1. save all important Data
2. create new partitions
3. fresh install.

Edit:
I could guide you through partitioning up to the Mint-KDE installation ; it is a long time ago I installed Linux/ KDE,
but the installation with prepared partitions is not a big problem.
Last edited by seeley on Tue Jun 16, 2015 10:15 am, edited 1 time in total.
seeley @ Linux multiboot

User avatar
Pjotr
Level 21
Level 21
Posts: 14979
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland)
Contact:

Re: Partitioning Questions Re-Partitioning

Post by Pjotr »

phd21 wrote:Even though everything is working fine, is there a way to easily and safely change these drive designators to "sda1" and sda2", etc..? Can I, and should I, try to change the "extended" logical partition to "primary" partition? Then I would not have three displayed partitions when there are really only two? Perhaps using "testdisk" or "fixparts"?
If it ain't broken, don't fix it.... :mrgreen:

Otherwise seeley +1.
Tip: 10 things to do after installing Linux Mint 20 Ulyana
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.

User avatar
seeley
Level 7
Level 7
Posts: 1867
Joined: Sun Mar 07, 2010 7:20 am

Re: Partitioning Questions Re-Partitioning

Post by seeley »

Hi phd21!
Maxbe you'll find a hint on my help
quickly get help
http://forums.linuxmint.com/viewtopic.p ... 366328/url
or on
HowTo install Qiana KDE on a Linux multiboot system
http://forums.linuxmint.com/viewtopic.p ... 879733/url
although it concerns multiboot.
seeley @ Linux multiboot

dave61430
Level 1
Level 1
Posts: 15
Joined: Tue May 19, 2015 4:57 pm

Re: Partitioning Questions Re-Partitioning

Post by dave61430 »

It looks as though you finished up with a single extended partition. Windows assigns consecutive drive letters as it mount partitions. Linux always names the four allowable primary partitions 1,2,3,4 if they exist but doesn't release the designation if they don't.

It then name volumes within an extended partition 5 thru' whatever.
In your case you could use primary partitions for Linux if you are certain you will never want to revert to a dual boot situation.

I don't know why the live media wouldn't let you move the partition, maybe some safety issue.

User avatar
phd21
Level 19
Level 19
Posts: 9629
Joined: Thu Jan 09, 2014 9:42 pm
Location: Florida

Re: Partitioning Questions Re-Partitioning

Post by phd21 »

Hi seeley, Pjotr, dave61430,

Thank you all for your quick replies. I appreciate that.

To Pjotr: I am a firm believer in " if it ain't broke, don't fix it" philosophy, unless you can make it better, easier, and or more useful, & to safely do so.

I always have good complete backups: drive image backups using Clonezilla Live which has never failed me (weekly or more), and file sync backups (daily) to external hard drives.

To seeley: Thank you. I checked out your links, good posts, wow. I know how to partition drives using many utilities, but thanks again. I'm sure other users reading this post will find your information in those links very informative, like I did. You really do not need to know how to partition drives to install Linux Mint on a blank drive, or to overwrite a drive with an existing operating system, or to install along side MS Windows, Mac, etc... because the Linux Mint installer is very good and pretty easy, although it sure helps to have some knowledge of drive partitions.

I know that a fresh install is the best way to go. I did not want to do a fresh install because I have hundreds, if not thousands, of programs, applications, and data, already installed in my current Linux Mint 17.1 KDE system. I thought about doing a fresh install to the deleted Windows partition, but when I was in the Linux Mint install process "manual" setup option, it asked what the "mount point" was, and I did not know what to put in there, "/", or "/home", or ???, because I did not want to mess up my existing "sda5" Linux Mint 17.1 KDE partition or how it works. I would like to know for future reference though what the "mount point" should be in this scenario, and or what other various scenarios would have different "mount points" and why. I did see some references to this in your links...

To dave61430: Yes, I ended up with a single active partition (with the small "linuxswap" partition as usual of course). But, the partition with my Linux Mint KDE "sda5" still shows up underneath the "sda2" partition which is an extended partition (logical?). Regarding primary partitions, I never plan on dual booting Windows on this machine again, although I may add another Linux distro which I already know how to do, or create a "data" partition like I used to have. Like I said, I already have VirtualBox installed in my LM 17.1 KDE system with a MS Win XP virtual machine running in that, if and when I feel like using Ms Win XP again.

FYI Note: I was thinking about creating a separate boot partition which I know only needs to be a couple hundred mb or less, so I left 1gb unallocated which you can see in the screen shot below. What's interesting is that I have two almost identical computers, on this one this 1gb unallocated space showed up underneath the "sda2" partition, yet on my other computer, the unallocated space showed before the "sda2" partition like it is supposed to do?
How much space is really required for a small boot loader partition?

Current configuration:

sudo fdisk -l
Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: xxxxxxxxxxx

Device Boot Start End Blocks Id System
/dev/sda2 2048 488396799 244197376 f W95 Ext'd (LBA)
/dev/sda5 2107392 480968703 239430656 83 Linux
/dev/sda6 480970098 488396799 3713351 82 Linux swap / Solaris
PartitionManagerScreen_06-16-2015.jpg

FYI-2: Here are some links to articles, posts, that I have also been reviewing on this topic:

How can I change an extended partition with 3 logical partitions to 3 primary
http://www.linuxquestions.org/questions ... ry-808846/

[SOLVED] convert a logical partition to a primary one?
http://ubuntuforums.org/archive/index.p ... 08458.html

FixParts Tutorial with some references to "testdisk"
http://www.rodsbooks.com/fixparts/
Last edited by phd21 on Tue Jun 16, 2015 3:23 pm, edited 4 times in total.
Phd21: Mint 19.2 Cinnamon & xKDE (Xfce) & KDE Neon 64-bit Awesome OS's, Dell Inspiron I5 7000 2 in 1, Dell OptiPlex 780 Core2Duo E8400 3GHz,4gb Ram, Intel 4 Graphics. I use KDE?:https://opensource.com/life/15/4/9-reasons-to-use-kde

User avatar
seeley
Level 7
Level 7
Posts: 1867
Joined: Sun Mar 07, 2010 7:20 am

Re: Partitioning Questions Re-Partitioning

Post by seeley »

Okay, what I see:
your root partition is very big and you don't have an own home partition - suboptimal;
if your swap partition is big enough depends on your RAM [normally size of swap = (1,2 - 1,5) * size of RAM] and if you want to use suspend on RAM / disc.
An own boot partition is not necessary - only if you have other file systems (btrfs, maybe xfs - depends on the distribution).
After some kernel upgrades the boot partition could be too small (depends on the distribution; in Fedora and openSuse you easily can control that - in a file).

I would not change partitions - you had to shrink your extended partition (loss of Data possible!)
seeley @ Linux multiboot

User avatar
phd21
Level 19
Level 19
Posts: 9629
Joined: Thu Jan 09, 2014 9:42 pm
Location: Florida

Re: Partitioning Questions Re-Partitioning

Post by phd21 »

seeley wrote:Okay, what I see:
your root partition is very big and you don't have an own home partition - suboptimal
Not sure what you mean by this. My "sda5" partition is my main one (home partition ?) and it does have a Linux "/home" folder, and boots up correctly.
seeley wrote: if your swap partition is big enough depends on your RAM [normally size of swap = (1,2 - 1,5) * size of RAM] and if you want to use suspend on RAM / disc.
Per my signature line in my posts, I have only 2gb of ram :( , and my swap seems to be large enough for to satisfy my Linux Mint requirements. Although I changed my "swapiness" to 10 to reduce swap usage for faster system performance.
seeley wrote:An own boot partition is not necessary - only if you have other file systems (btrfs, maybe xfs - depends on the distribution).
I agree, but I'm still learning about Linux systems and having multiple operating systems on one computer. I read that if you plan on booting various operating systems, then creating a boot partition would help. I try to learn something new every day :).
seeley wrote: After some kernel upgrades the boot partition could be too small (depends on the distribution; in Fedora and openSuse you easily can control that - in a file).
Ok. That is why I asked what do more experienced users recommend regarding creating a small "boot" partition, like size, volume name, format (fat32, ntfs, ext4, ?), any other parameters?, etc.
I would not change partitions - you had to shrink your extended partition (loss of Data possible!)
Since everything is working, I agree. But, I am curious if extended partitions can be safely changed to primary partitions without data loss and stuff related to those kind of tasks.

I've always been able to move and resize partitions within the MS Windows partition and the Linux Mint (extended) partition(s) easily with the Linux Mint partition manager (editor), or another bootable partition manager; until this scenario when I deleted the Ms Windows partition and wanted to reclaim the space from the primary MBR partition for use in an "extended" partition which I had to use "gparted live" DVD to do - and it worked well.

Thank you again for your help with this :).

FYI: I also use a really good very cool program called "aptik" to backup my system settings and applications to a folder on my external drive which I assume then that I could have deleted all the partitions on the drive, then done a fresh install of Linux Mint, installed "aptik", and restored all my customizations, PPAs, applications, etc... using "aptik". But, since I have never done that before, I chose not to do that (yet). By the way on my Linux Mint desktop, I can only get Aptik's graphical user interface (gui) to work from a console terminal prompt by typing in "sudo aptik-gtk".
Last edited by phd21 on Tue Jun 16, 2015 5:32 pm, edited 2 times in total.
Phd21: Mint 19.2 Cinnamon & xKDE (Xfce) & KDE Neon 64-bit Awesome OS's, Dell Inspiron I5 7000 2 in 1, Dell OptiPlex 780 Core2Duo E8400 3GHz,4gb Ram, Intel 4 Graphics. I use KDE?:https://opensource.com/life/15/4/9-reasons-to-use-kde

Cosmo.
Level 23
Level 23
Posts: 17817
Joined: Sat Dec 06, 2014 7:34 am

Re: Partitioning Questions Re-Partitioning

Post by Cosmo. »

phd21 wrote:I read that if you plan on booting various operating systems, then creating a boot partition would help.
Without knowing what you read I think, that this is a misunderstanding.
phd21 wrote:That is why I asked what do experienced users recommend regarding creating a small "boot" partition, like size, volume name, format (fat32, ntfs, ext4, ?), any other parameters?, etc.
If there are no special needs - e.g. fully encryption of the hard drive - don't use a separate /boot-partition. For sizing you have 2 choices: Too small (but you will find that only after some time of usage) or a waste of space (with the consequence, that other partitions get to small). Only for the records: if at all: ext4, never a non-Linux-file-system.
phd21 wrote:I am curious if extended partitions can be safely changed to primary partitions without data loss and stuff related to those kind of tasks.
Curiosity is in general a fine thing. But if you should read anywhere about a method (which I do not know, because I would never use it), be noted, that such operations shall in any case be done after a fully backup. There is always the chance, that something goes wrong: user error, software failure, sudden power loss, .... But having done the backup, you have already done half the work for a regular change from scratch. And with the regular change you can be sure, that this works. Only disadvantage: the curiosity stays. :wink:
phd21 wrote:By the way on my Linux Mint desktop, I can only get Aptik's graphical user interface (gui) to work from a console terminal prompt by typing in "sudo aptik-gtk".
I know Aptik and have it handy, just in case - but the case until now did not come. The only function which seems interesting for me is the possibility, to save and restore my PPAs. For me the Aptik-GUI shows, if I launch it from the menu; but the function to save program settings gets only working, if Aptik gets started with the terminal command you wrote. (Doesn't bother me, as this can easier and better controllable be done by restoring the backed up files and folders.)

User avatar
Derek_S
Level 6
Level 6
Posts: 1278
Joined: Sat Dec 28, 2013 5:36 pm
Location: Long Island, N.Y.

Re: Partitioning Questions Re-Partitioning

Post by Derek_S »

Hello phd21 - There is only one disk utility I'm aware of that can be used to convert logical partitions into primary partitions - MiniTool Partition Wizard. That being said, I would suggest that you backup all of your important data first and have a DVD or USB flash drive prepared just in case you must re-install Linux Mint. Why? Performing a disk operation such as this is not without risk. You could possibly lose your data or find yourself with an unbootable operating system. If you're not prepared to deal with this, you have no one to blame but yourself.

I would suggest that you use the bootable cd version of Partition Wizard. You have the choice of burning the .iso file to a CD or DVD, or if have access to a Windows-based computer, you can use Rufus to create a bootable USB flash drive using the .iso file.

The download link to Partition Wizard is here: http://www.partitionwizard.com/partitio ... le-cd.html

The download link to Rufus is here: https://rufus.akeo.ie/

Proceed at your own risk. You're aware of the consequences and you have been warned!
"Truth is becoming rarer and rarer as time passes. It is only a matter of time before it will cease to exist."

User avatar
phd21
Level 19
Level 19
Posts: 9629
Joined: Thu Jan 09, 2014 9:42 pm
Location: Florida

Re: Partitioning Questions Re-Partitioning

Post by phd21 »

Hi Everyone, Derek_S, cosmo, etc ...

As any one should do when messing around with disk partitioning, I already have complete backups. Thanks everyone for the warnings though.

Not sure how much I care whether this partition is extended or primary at the moment, since my system is working and my goal of reclaiming the space from a primary partition to my extended partition was achieved. Although obviously, I am intellectually interested in this topic. It would be nice to have consecutive partitions sda1, sda2, sda3, etc... again.

Also, from what I have been reading today, there really is not a need to create a separate small boot partition to have successful multiple booting operating systems on a computer, although in some cases it can help. So, in my case I can reclaim that 1 gigabyte of space that I reserved for that. I was dual booting Windows and Linux for years without a separate boot partition...

To Derek_S: Thank you, I already have the MiniTool Partition Wizard boot CD, but I have not tried that - yet. I will check that out...

For all of you who did not read what I read about converting logical partitions to primary partition(s), which apparently can be done, please read the interesting link below:
http://ubuntuforums.org/archive/index.p ... 08458.html


Another method I read about to get my current system to a primary partition was to shrink my current partition so that I could fit 2 partitions of the same size on this drive, move my current partition to the right, create a primary "ext4" partition in the front of the drive of the same size, then copy/clone my existing partition to that new primary "sda1" partition, then I could delete my "sda5" partition and reclaim its space easily with a partition manager.
Phd21: Mint 19.2 Cinnamon & xKDE (Xfce) & KDE Neon 64-bit Awesome OS's, Dell Inspiron I5 7000 2 in 1, Dell OptiPlex 780 Core2Duo E8400 3GHz,4gb Ram, Intel 4 Graphics. I use KDE?:https://opensource.com/life/15/4/9-reasons-to-use-kde

wayne128
Level 10
Level 10
Posts: 3412
Joined: Tue Jul 13, 2010 12:15 am

Re: Partitioning Questions Re-Partitioning

Post by wayne128 »

On this subject, my understanding is

1. the OS has been cloned, presumably on an external hard disk.
2. the OS is now at extended partition on internal hard disk
3. the OP wishes to repartition so that the OS will become on Primary partition..


If I were in this situation, I would use this method:

4. Since the clone is already done, and remember clone can be restored to any other partition that is equal or larger than its original size, so I would just use a bootable Linux DVD or USb flash, boot the computer, run Live, then run gparted, wipe out the hard disk. Repartition the way the OP wishes, that is essentially create a Primary partition larger that the of the clone, create Swap as needed.

5. Then, run clonezilla, copy or restore the cloned OS to the Primary partition.
6. Test if it is bootable, if not, just boot with Linux DVD/USB, mount the Primary OS partition, and reinstall grub to the Mbr of the hard disk, it should let the new Primary OS bootable

good luck

User avatar
phd21
Level 19
Level 19
Posts: 9629
Joined: Thu Jan 09, 2014 9:42 pm
Location: Florida

Re: Partitioning Questions Re-Partitioning <Solved>

Post by phd21 »

Hi Derek_S and everyone else,

SOLVED ! Okay, and the winner is Derek_S' recommendation - solution + MiniTool Partition Wizard. Thank you ! :D

*** Always have a good complete backup of your hard drive's partitions before changing or modifying hard drive partitions ***

To easily convert "extended" partition(s) to primary partitions...
What you need: 2 CD's, or 2 DVD's, or 2 USB flash drives containing:

1. CD/DVD that has the most excellent bootable "MiniTool Partition Wizard"
http://www.partitionwizard.com/partitio ... le-cd.html

2. CD/DVD that has awesome and easy bootable "boot-repair-disk" which can fix Linux and Ms Windows boot problems.
http://sourceforge.net/projects/boot-repair-cd/files/

The programs above require you to download their ".iso" files from the links above and "burn", create, bootable CD/DVD, or USB flash drive of these programs.

Yes, the program "MiniTool Partition Wizard" bootable DVD can easily change extended partitions to primary partitions without destroying your system and your data. You just boot up to this CD/DVD/USB flash drive, select your partition(s) that you want to change from extended to primary and right click that partition and select modify (change) it to a primary partition and hit apply; it only takes seconds to do. I did one partition at a time although you might be able to do more than that at one time.

Note: 06-17-2015 11:10pm US Eastern: I just re-ran this procedure on my other computer and it worked great.
FYI: Re: MiniTool Partition Wizard: I used version 8, they now have a version 9 which should not matter. One thing to consider when using this is that my Logitech wireless keyboard and mouse using 1 USB "unifying" receiver would not work with MiniTool Partition Wizard boot DVD, maybe they updated this in ver.9, but I don't know? So, I used a regular Logitech USB keyboard and USB mouse and they did work. My mini USB Favi keyboard with touchpad also worked.


Note: This process did mess up my boot up process, Grub2 boot, which I just booted up my "boot-repair-disk", connected it to the internet, and hit the single click "recommended repair" button to fix that, which also worked well.

If you have been reading this post, I have two "extended" partitions: my main Linux Mint 17.1 KDE (sda5) and the associated "linuxswap" mini partition (sda6) underneath a "sda2" extended partition which I wanted to make primary partitions and to change their drive designations from the existing "sda2", "sda5", "sda6" (there are only 2 real partitions in this "sda5" & "sda6") to "sda1" and "sda2". This process worked and was the easiest solution.

Thanks again to all of you for your good advice and taking the time to post. :)

This Linux Mint forum is considered to be excellent, which it is, and one of many good reasons why lots of people are switching to Linux Mint.
Phd21: Mint 19.2 Cinnamon & xKDE (Xfce) & KDE Neon 64-bit Awesome OS's, Dell Inspiron I5 7000 2 in 1, Dell OptiPlex 780 Core2Duo E8400 3GHz,4gb Ram, Intel 4 Graphics. I use KDE?:https://opensource.com/life/15/4/9-reasons-to-use-kde

hcentaur13
Level 4
Level 4
Posts: 463
Joined: Sat May 18, 2013 5:13 pm

Re: Partition Questions Re-Partitioning <Solved>

Post by hcentaur13 »

Windows handle drive letters to distinguish partitions. Linux knows nothing about drive letters - its programs knows even nothing about partitions! It hgandles only diurectories. As linux sees only files - anthing is a file! Special types of files are directories. They are files holding information about other files A xspecial type of a directory is a mountpoint. A mountpoint looks like any other file but instead to hold files it does only point to the physical location of the root directory of a mounted partition. It is only a logical link to the physical location. Each directory is so either itsel the physical location of the collection of descriptios of other filles or it is only a logical place that shows where to rootdirectory of a partitions physically is sitting. So a mountpoint is the logical location that shows where the physical location can be foud. That location can be found on the same drive or another drive oin the same computer or in another computer in the same location or somwhere in the whole universum.

/ is the logical location of the root filesystem. It says nothing about the physical location of the partition where the whole tree of the root filesystem is located. Yes, / ist the basic of the whole filesysterm. Each directory can be either a directory tthat hoilds the decription of other files and directories in itself or a mountpoint that hides the physical location of the partition of other files or directories in other partitions.

man is a program that delivers documentation to commands (in windows known as help). To get more information about the mechanism linux handles filkes read
man mount
man umount
man fstab
man mountpoint

It makes no sense to hold /boot in an own partition. It makes sense to hold /home in its own partition because whenever a new installation of the system is needed too have userdata separated from system data makes an installation of the system quick and easy. / needs to be formatted before the system can be installed - The data of all users (except root) needs to be in another partition when theyr data should be alive after install of the system. format will remove the whole content of the partition, including any mountpoint - but live other partitions untouched and alive. So create new mountpoints and no users can see the new install as theyr data lives thereafter without change., /having /home as ordinary directory requires backup to get the data saved in the panic situation the system has crashed to die!

Yes - backup is required anyway. But when the system administrator gets the needs to backup in panic sitation because the system has crashed he may make stupid errors and loose data. Having userdata separated he can setup the system quick and easy because the userdata left unchanged it its own partition(s). The system is quick up.

Locked

Return to “Installation & Boot”