Bug 444274 - Setting partition active in Parted in multi-boot case
Setting partition active in Parted in multi-boot case
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: parted (Show other bugs)
9
All Linux
low Severity medium
: ---
: ---
Assigned To: Joel Andres Granados
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-04-26 07:38 EDT by Keith Wilkinson
Modified: 2008-11-05 11:37 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-11-05 11:37:56 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Keith Wilkinson 2008-04-26 07:38:03 EDT
Description of problem: It doesn't appear possible to set a primary partition 
active in Parted during install. (OpenSuSE does allow this). If trying to 
install boot code in a /boot primary partition (rather than MBR) and 
boot from /boot by making the partition active, the install fails 
if you don't use another tool to set the /boot primary partition active 
before installing. 

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. As described above
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 Bug Zapper 2008-05-14 06:12:20 EDT
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 2 Joel Andres Granados 2008-10-16 11:57:32 EDT
Is this possible in a runing system.  I mean, setting a partition as primary partition.
Comment 3 Keith Wilkinson 2008-10-16 15:44:29 EDT
You can create up to three primary partitions plus one extended partition on a drive. Only one of the three primary partitions can be "visible" (as a C drive) 
at any time.  Setting a partition "active" makes it "visible".  So this is 
useful in a multiboot (with Windows) situation.  You can put /boot on one of 
the primary partitions, and another can be a Windows C: drive, for example. 
You don't have to mess with the MBR, just change the "active" partition. 
Linux-based partitioning software like Acronis Disk Director allows you 
to change the "active" partition (and reboot), and SuSE's partitioner 
also allows you to do this.  But not Fedora.
Comment 4 Joel Andres Granados 2008-10-17 03:24:30 EDT
I think you missunderstood me,  sorry for being so vague :)  I want to know if parted is able to do this in an environment other than the installer.  Is parted able, with no errors, to change the primary partition?
Comment 5 Keith Wilkinson 2008-10-17 12:22:11 EDT
> Is parted able, with no errors, to change the primary partition? 

I didn't say anything about changing the size of primary partitions, 
rather to mark one of the (up to three) primary partitions as active. 
GRUB can do this, but it's useful if the user can do it manually with 
PartEd: for example, if you already have Windows installed then the 
primary partition that Windows is using will be Active.  If you want 
to install LINUX /boot on another primary partition then you will 
have to mark the proposed LINUX /boot partition as Active before 
installing. The SuSE installer seems to understand this, but the 
Fedora one doesn't, which can result in failed installation attempts. 

If PartEd can do this (mark a Primary partition as Active) then you 
can use a live CD to switch between an existing Windows installation 
and LINUX:  when installing LINUX, you leave the MBR as is, and 
install /boot on another Primary partition, with boot code at the 
head of that partition rather than in MBR.  Then you can use a Live
CD to switch between Windows and LINUX simply by changing which 
primary partition is marked as Active 

I gather than the SuSE PartEd can shrink an existing Windows 
primary partition and allow you to create a /boot primary 
partition in the freed-up space, allow you to move and resize
the Windows D: drive part of the extended partition and 
create Linux partitions *after* the Windows D: drive in the
extended partition.  I have not personally used it to do this, 
but I know that it does allow you to change which of the 
primary partitions is marked as active. If the Live CD has 
these functions, then you should not need Acronis Disk Director 
(or the like) to resize an existing Windows installation to 
make room for a dual-boot LINUX installation. 

I have found that in a triple boot installation (Windows, 
another LINUX distro, and Fedora) you need to install 
Fedora before the other LINUX distro.  If you try to 
install Fedora *after* the other LINUX distro then 
Fedora will stomp on it. It would be good if Fedora 
could "play nice" in a multiboot PC environment -- 
then you would not have to use another distro like 
SuSE to partition the disk before installing Fedora.
Comment 6 Joel Andres Granados 2008-10-17 14:33:16 EDT
>I didn't say anything about changing the size of primary partitions,
me neither.  you got my question though.  I was missing a preposition.  the question should have been: Is parted able, with no errors, to change to a primary partition? sorry about that. :)

1. Fedora installations *do* allow you to make an install to a system with not touching the mbr.  You just have to tell it to not do that.  The default is to change the mbr because we try to put everything in GRUB for all the distros/os that we find in the system.  But if you think you know best, you can allwasy deselect the "modify mbr button".

2. Why would you want a LiveCD to manage your Bootloading, why not use grub.  It supports most all linux flavors I know of and whatever it does not support, you can chainload the booting.  I see the use of a good bootloader (GRUB) much better way of choosing the os/distro you want to use than going into a liveCD, changing the partition metadata and rebooting.

3. I don't know about suse but resizing the windows partition is somewhat trivial. resizing the filesystem contained inside the partition is the tricky part.  ATM parted is trying to flee from file system code (including ext2, ext3, ntfs....).  This is basically to avoid duplicate code and to stop making stupid mistakes at partitioning time :).  We prefer to point the user to individual file system tools like e2fsprogs and the like.

4. The fact that parted is not able to change metadata of a partition table *is* a bug.

As I understand: suse's parted is able to change the partition metadata.  can you post the output of the command you used for this purpose?  What type of partition table is it? If its default its probably msdos.
Comment 7 Keith Wilkinson 2008-10-17 15:18:20 EDT
> 1. Fedora installations *do* allow you to make an install to a system with not
touching the mbr.

That's not the main problem -- another reason that Fedora doesn't play nicely 
with multiboot Windows plus dual LINUX installations seems to be the way it 
recognizes the different LINUX partitions that it "owns".  GRUB can recognize 
partitions in several different ways. SuSE uses partition labels, I vaguely recall.  So you can label "/" as "/s" for SuSE's root.  SuSE doesn't insist 
on walking over another distro's root etc. 

> 2. Why would you want a LiveCD to manage your Bootloading, why not use GRUB. 

Because beginners often find that Windows no longer works if they remove GRUB, 
and often GRUB no longer works when they remove LINUX ;-) 
The "safe" way to multiboot, for people who don't want to mess with their Windows MBR, is to use a Windows.ini menu to load LINUX [or use a LIVE CD 
to change the active partition if they only occasionally boot up LINUX].  
After installing LINUX as described, you switch the Active partition back to Windows and edit Windows.ini  How to load LINUX by copying the 512-byte loader from the /boot partition or whatever to a file which Windows loads to boot LINUX is described on the Web. 

> 4. As I understand: suse's parted is able to change the partition metadata. 

I think Ubuntu as well as SuSE can resize a working Windows installation partition to free up space to install LINUX, though I haven't done it myself. 
You don't need to use the command line, the Graphic interface does the resizing and setting of active partition.
Comment 8 Joel Andres Granados 2008-10-17 15:43:06 EDT
1. Fedora does not use labels anymore.  it uses UUID, which has other issues, but thats another story:)

2. Safe multiboot is very personal concept I think.  For me, it is not save to change partition metadata just because you want to boot to another partition.  Lots of thing can happen while you write/read that part of memory.  and if anything is left in an unstable state,  things can go wrong:)  But that another discussion for another flame :)

4. parted does not have a graphical interface.  gparted uses parted library.  and that adds a whole other level to the problem.  gparted might be the one that has the problem.  It might not.

Again:  Can you please tell me how you changed the metadata in suse and/or ubuntu?

thx.
Comment 9 Keith Wilkinson 2008-10-17 19:11:00 EDT
Try a Google search for "resizing Windows suse" (without quotes) 
e.g. http://searchsystemschannel.techtarget.com/generic/0,295582,sid99_gci1215199,00.html 
or for "resizing Windows partition ubuntu" (without quotes) or for 
"resizing Windows partition Knoppix" (without quotes). 
You might also read 
http://fedoraproject.org/wiki/Features/PartitionResizing
Comment 10 Joel Andres Granados 2008-10-18 09:23:05 EDT
Summary:
1. There might be a bug in parted.
2. It might have to do with the fact that it does not change partition metadata.
3. You tell me that there is a way to change partition metadata in suse and in ubuntu.
4. I need to know exactly what you did in those distributions (step by step) so I can asses where the parted library is getting called and maybe find out if there is a bug or not.

Objective of the bugreport:  Find the bug (if any) and squash it.  Not learn how to resize windows partitions.

Number 4 is the reason I asked you for the procedure you used for changing the partition metadata (toggle the active partition bit).

I am completely lost with comment #9.  I don't see any gain toward the Objective in me finding out how to rezise window partitions, specially when we are talking about just the active bit in the partition metadata.

PS: I am aware of the plans for fedora partitioning in anaconda.  The idea is to do a complete rewrite of the code.

I'm sorry for being so direct but I think this whole discussion is leading nowhere.  I also invite you to reread your original comment.  The first sentence states that parted cannot change primary partition metadata.
Comment 11 Keith Wilkinson 2008-10-19 02:00:12 EDT
Summary: 
1. Objective of this bugreport:  As the Fedora wiki at 
http://fedoraproject.org/wiki/Features/PartitionResizing 
says, the objective is to (quote): 
"Lower the barrier to entry for new users who only have Windows installed on their PC".  In other words, to remove all the usability bugs that make Fedora inferior (from a usability viewpoint) to other distros.  Because if nobody wants to use Fedora because it's such a PITA then maybe you won't have a job 
in a few years. 

2. As I said in my initial post : 
(In Fedora) it doesn't appear possible to set a primary partition active in (the graphical version of) Parted. In SuSE you can mark a primary partition as Active.
If you create a new primary partition on a Windows machine -- say a /boot primary partition -- and try to install the boot code in the /boot primary partition (rather than in the MBR) and boot from /boot by making the partition active, the install will fail unless you use another tool to set the /boot primary partition active before trying to install to it. In other words, Fedora will fail but SuSE will look after the details for you, and the install will succeed. Probably Ubuntu and other major distros also allow you to explicitly set the partition you want to install the boot code in to "Active" or the installer sets the partition active before you attempt to install.  Maybe Fedora is the only distro which cannot do this and which virtually promises that a beginner's installation will fail (because the partition with the boot code was not set Active before the install) and/or will wipe out the MBR. 
In Fedora it is very easy to wipe out the MBR, whereas it is much more difficult for a beginner to wipe out his Windows machine with SuSE. 

4. As I explained : 
GRUB already can do (does do) this (set different primary partitions active) to multiboot between LINUX and Windows.  SuSE's graphical partition manager can do this at install time or when running LINUX. Fedora can't.
The user interface of Fedora is also inferior to SuSE and other distros -- it is easy for a new user to wipe out the MBR.  Fedora also does not automatically create a GRUB boot menu showing Windows as "Windows". 

5. If you try to install Fedora after installing another LINUX distro, to dual boot, you will find that Fedora doesn't play nicely with it. 

6. > Can you please tell me how you changed the metadata in suse and/or
ubuntu? 

I didn't mention the word "metadata" anywhere.
Comment 12 Joel Andres Granados 2008-11-05 11:37:56 EST
Based on comment #11:
1. if the objective is based on http://fedoraproject.org/wiki/Features/PartitionResizing, then this is a feature, not a bug.  In this case this should be treated as http://fedoraproject.org/wiki/Features/Policy.

2. Graphical version of parted is not parted, please reopen a bug (or clone this one) and put gpartede instead of parted in the component

3. you missed it :)

4. parted can make a partition bootable.  if your problem is that this does not happen in the installer, then open a bug against anaconda (or close this one).  Same goes for the installer wiping mbr.

5. same as numeral 4.

6. whenever you set a partition as primary, you are changing the metadata in the partition table. So while you didn't mention that word, you were talking about it all along.

try `parted DEVICE toggle PART_NUM boot`  This will toggle the boot flag in the partition table and make that partition bootable for windows.  If this does not work (on running system or installer), then we have a bug in parted.

Closing this issue as this does not relate to parted.

Note You need to log in before you can comment on or make changes to this bug.