Bug 249380

Summary: bad suggestion to format /home
Product: [openSUSE] openSUSE 10.3 Reporter: Stanislav Brabec <sbrabec>
Component: YaST2Assignee: Thomas Fehr <fehr>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Critical    
Priority: P5 - None CC: christian.jaeger, federico, hpj
Version: Final   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard: gnome-usability, opensuse-10.2, opensuse-10.3
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on:    
Bug Blocks: 328929    
Attachments: activate more debug output

Description Stanislav Brabec 2007-02-27 16:09:07 UTC
Trying to install openSUSE 10.2 on my home machine, it offered to create and format /home partition, which was already ext3 formatted.

This suggestion is invalid on almost 100% of cases - most people with separate /home want to save its contents after installation.

During manual repartitioning, it still offers reiserfs as default, if I click to "Format". I guess it should be ext3.

Logs placed to: ~sbrabec/var_log_YaST2_utx

Suggestions to improvement:

If /home partition already caries linux-friendly filesystem (ext*, xfs, reiser*), never offer formatting.

While formatting partitions to file system, which supports it, use "Last mounted on" entry to properly identify disc structure on next installation.

If more version of SuSE Linux is found in several partitions, the oldest one should be scheduled to be overwritten.

When suggesting to format, don't inherit label from previous partition contents. Especially for / it causes nonsenses (e. g. openSUSE 10.1 with label "Gentoo Linux").

When switching to format, ext2 should be default, not reiserfs.
Comment 1 Thomas Fehr 2007-02-27 16:42:31 UTC
Proposal could of course be rewritten according to your suggestions but this
is certainly something to be decided by project management since it would
mean throwing away current posprosal code and writing new one that can fulfil
your requests. 

- currently nothing about content of partitions is known besides fs type
  Of could we could mount every block device and analyze content but I 
  an already getting complains about slow startup times now. Mounting dozens
  of potentially incosistent filesystems will certainly not make startup 
 faster
- "last mounted on" is not available for reiserfs (no idea about xfs)

Some remarks on things I can change easily:
- When switching to "format" the currently detected fs is default. Which is IMHO
  ok, but you are right that the default should be ext3 if no previous fs
  was detectd. Will fix that.
- Resetting the label when formatting is suggested by proposal code makes sense.
  Will fix that also. Generally resetting the label when formatting is IMHO
  not desirable if someone gives label names like "root", "home", "swap" he
  would probably be pissed if these are destroyed whenever he formats a 
  filesystem.

You other request would mean fundamental changes and I would only change these
if dist team backs up your suggestions and of course is willing to live with 
the considerably increased startup time in some cases.
Comment 2 Thomas Fehr 2007-02-27 17:20:06 UTC
I just tried to find a case where the partition create/edit dialog does
default to reiserfs and was unsuccessful. It should only default to reiserfs
if reiserfs is the detected filesystem on a partition (which is ok since
of there is a fs detected this should be the default also when format is set
to true).

Please apply the following patch to /usr/share/YaST2/include/partitioning/custom_part_dialogs.ycp, it activates some
more debug output of default fs selection.

BTW: 
Lagrange:~ > ls -l ~sbrabec/var_log_YaST2_utx/
ls: /suse/sbrabec/var_log_YaST2_utx/YaST2: Permission denied
Comment 3 Thomas Fehr 2007-02-27 17:20:45 UTC
Created attachment 121353 [details]
activate more debug output
Comment 4 Stanislav Brabec 2007-02-27 18:04:47 UTC
To comment #2: This is my case.

I expected ext3 as unconditional default in the expert partitioner, too. Previous system was SuSE Linux 10.0 on reiserfs, which was scheduled to be overwritten. Now I expected ext3 as default for /.
Comment 5 Thomas Fehr 2007-02-28 09:54:05 UTC
ext3 is only default for three cases:
- when a partition is formatted in a proposal
- when a new partition/LV/MD is created
- when a partition/LV/MD is edited and no filesystem is detected.

Since there are valid reasons to deviate from the default filesystem I do not 
consider it useful to always change the filesystem to ext3 whenever the user
activates format. It worked this way since yast2 partitioner exists and so far
nobody complained.

Meanwhile I changed proposal code to automatically remove labels.
Your other suggestions would mean fundmental changes to current proposal 
functionality and I will only implement such things if dist team approves it.
Comment 6 Stanislav Brabec 2007-02-28 10:23:03 UTC
It was only one part of the bug. Remaining issues:

Trying to install openSUSE 10.2 on my home machine, it offered to format /home partition, which was already ext3 formatted.

This suggestion is invalid on almost 100% of cases - most people with separate
/home want to save its contents after installation.

Logs placed to: ~sbrabec/var_log_YaST2_utx

Proposals to improve:

If /home (and maybe some others) partitions already caries linux-friendly filesystem (ext*, xfs, reiser*), never offer formatting.

While formatting partitions to file system, which supports it, fill "Last
mounted on" entry to properly identify disc structure on next installation.

If more version of SuSE Linux is found in several partitions, the oldest one
should be scheduled to be overwritten.
Comment 7 Thomas Fehr 2007-02-28 10:51:28 UTC
The bug was resolved as WONTFIX.
Reasons were explianed in my comments.
Comment 8 Jonathan Arsenault 2007-05-23 20:58:56 UTC
*** Bug 277582 has been marked as a duplicate of this bug. ***
Comment 9 Matej Horvath 2007-08-09 15:50:42 UTC
*** Bug 298861 has been marked as a duplicate of this bug. ***
Comment 10 Hubert Figuiere 2007-08-09 16:04:02 UTC
I still don't see why this is marked as WONTFIX. Proposing to format /home is wrong 99% of the time. That the whole reason of having /home as a separate partition.
Comment 11 Christian Jäger 2007-09-27 13:37:51 UTC
I find it outrageous that this serious bug has been declared a 'wontfix'.
Comment 12 Hans Petter Jansson 2007-09-27 18:56:52 UTC
I agree. I generally don't want my /home formatted on reinstall.
Comment 13 Larry Ewing 2007-09-27 19:03:26 UTC
When the proposal exactly matches the current layout why would you ever want to format /home?  This is something I have to change every time I do an install and in the worst case it would cause complete loss of data for the user.  WONTFIX doesn't make sense to me either.
Comment 14 Federico Mena Quintero 2007-09-27 20:03:00 UTC
I had filed this as bug #58733 for NLD9, and got shot down as well.

This is a horrible bug.  Why would you *ever* want to make "format my home" the default?
Comment 15 Federico Mena Quintero 2007-09-27 20:03:45 UTC
Reopening.
Comment 16 Thomas Fehr 2007-10-01 10:16:29 UTC
Since 10.3 development is over now, I will implement code in STABLE (while will
become next openSuSE/SLES release) that look at the fs intended to be used
for /home and suppresses formatting if heuristics indicate it is a valid /home
filesystem. 

I still consider this a bogus feature since it involves mounting a potetially
large filesystem with unknown content and state. If the filesystem happens to
be dirty, the log replay alone may take minutes and there is no save way to
prevent these minutes to be wasted, but in the end it is probably
less time consuming to implement that stuff than to discuss this forever.
Comment 17 Stanislav Brabec 2007-10-01 10:58:42 UTC
Maybe it would be nice to set and use e2fs last-mounted-directory entry to simplify guesses during upgrade:

tune2fs -M /home /dev/hda5
Comment 18 Christian Jäger 2007-10-01 11:03:15 UTC
Thank you. I am quite confident that you talented people will manage.
After all, other Linuxes manage, too, (plus importing previous
user-profiles from a pre-existing /home on the fly) without endless waiting-periods.
Comment 19 Thomas Fehr 2007-10-01 11:18:25 UTC
All distribution use the same filesystem types and more or less the same kernel.
So if a log reply happens during mount the waiting periods are exactly the same 
for all distributions. I would not bother if the added delay would happen during
installations where some minutes more do not matter much, but the (potential)
delay will be added to proposal generation which I consider should be fast.

Ad comment#18:
We are talking about "New Installation", not Update path here.
For update we of course read /etc/fstab and can act accordingly.
For "New installation" there is no such code (and I generally want to rely as
less as possible on any data of the system being valid) since it is expected
for users that want the same disk layout anyway and avoid loss of data to use
"Update" instead of "New Installation".

So, looking at output of tune2fs will be part of the heuristics but AFAIK
there is no equivalent functionality for reiserfs and xfs and actually mounting
the fs cannot be avoided for these. 
Comment 20 Richard Creighton 2007-10-01 12:52:59 UTC
(In reply to comment #16 from Thomas Fehr)
> Since 10.3 development is over now, I will implement code in STABLE (while will
> become next openSuSE/SLES release) that look at the fs intended to be used
> for /home and suppresses formatting if heuristics indicate it is a valid /home
> filesystem. 
> 
> I still consider this a bogus feature since it involves mounting a potetially
> large filesystem with unknown content and state. If the filesystem happens to
> be dirty, the log replay alone may take minutes and there is no save way to
> prevent these minutes to be wasted, but in the end it is probably
> less time consuming to implement that stuff than to discuss this forever.
> 

I suggest then making a pop-up dialog when this occurs and let the operator make the decision.   There are already many delays in the installation but one the operator is willing to make is one that saves time in the long run and reconstruction of data structures inadvertently erased or formatted takes longer than remounting a dirty partition and by asking you have alerted the operator and if there is a delay, he also now knows the reason.  If they don't want to save the existing data/structure, proceed as you currently propose to do.
Comment 21 Thomas Fehr 2007-10-01 13:01:13 UTC
It is not trivial do decide how long a log reply will take without 
actually mounting the filesystem (there may be ways, but they would certainly
be fs specific).

Having a popup with necessary user interaction for during computed disk proposal 
is not desired. So far there is a rule that the first proposal must not do any 
user interactions. 
Comment 22 Federico Mena Quintero 2007-10-01 17:30:40 UTC
Thanks for working on this, Thomas!  Every time I do an install I get a cold sweat when I see that my /home may go away :)
Comment 23 Thomas Fehr 2007-10-01 17:42:49 UTC
As I tried to explain, you should consider selecting the "Update" path instead
of "New Installation". It is simply wrong to use "New installation" and hope that
the generated proposal will exactly match your expectations (the expectation
if the next user might be quite different). If I could write software that is 
able to read the thoughts of the user I would most probably write a online 
poker game, seems much more profitable.

Even after my changes there will be no guarantees whatsoever that the partition 
with /home on it is not select to be removed (this will for example happen when 
project managements decides that a new installation of a new product should be
installed with more space for root filesystem or swap or whatever else might
come up as requirements for new products).
Comment 24 Stanislav Brabec 2007-10-02 10:37:53 UTC
It is quite convenient to do a "safe upgrade" as a new installation to the dedicated partition and keeping the old SuSE instance as the default until all tests and customizations of the new one are complete.

There are already YaST modules for searching the best-fit old instance to read old ssh keys, old /etc/hosts.

It would be very nice, if it would be able to read /etc/fstab as well. I know, that is is not so simple as it sounds, because device might have a different name, one must guess which OS instance is the oldest. (It will also require NFS client configuration behavior change.)


Here are few ideas to improve user experience:


1) Ask user, what should be removed:

If partitioning scheme conforms OpenSUSE needs, then maybe a following question would be good:

There is no free or empty partition nor reserved space on your system. Please choose what to do:
(selected) Overwrite partition with label "SuSE Linux 10.0"
Overwrite partition with SuSE Linux 10.1
Overwrite partition with OpenSUSE 10.2
Overwrite partition with label "Home"
Overwrite partition with label "Swap"

If it does not conform, suggest possible ways to solve:

Your disc partitioning does not conform OpenSUSE 11.0 needs:
- No system partition has enough size
- Swap recommended for your RAM size is too small
...
Please choose what to do:
Backup the whole disc and repartition from scratch
Format previous "Home" as / (Home Warning)
Format previous "SuSE_Linux_10.1" as swap

Implementing this calls back a comment from the previous discussion: Resetting the label when formatting to a really descriptive one (e. g. "OpenSUSE_11.0" for /, "OpenSUSE_11.0_usr" for /usr, "OpenSUSE_11.0_var" for /var, "Swap" for swap, "Home" for /home etc.)


2) Home Warning

A special home warning for formatting of partitions with non empty /home directory and partitions with "Home" string in the name (optionally translated, depends on future default names proposal):

It seems that you are overwriting non-empty home directory! Please confirm deleting of these user data.


3) Safe delete

There is a chance for a "safe formatting" as an addition to Format/Not format: long fsck and rm -rf of everything except selected directories (e. g. /home).
Comment 25 Thomas Fehr 2007-10-02 16:51:00 UTC
Of course it is already implemented to make expert partitioner search for fstab
on every block device, look into all the read fstab layouts, present them to the
user and select one to be used for an installation. Maybe you should at least have
a short look into what already exits before you demand to throw it away.
Doing this when the user demands it is fine, doing this automatically and unavoidably whenever a proposal is computed is certainly time consuming and
potentially dangerous. The existence of a valid filesystem signature is clearly 
no enough to guarantee a successful mount, I have seen kernel oops when trying
to mount inconsistent filesystem, so I do not want such this to happen in 
default path.
 
Clearly this demands much more than I will implement and it clearly violates
the rules that currently exits for the proposal. Currently there is no user 
interaction during creation of initial proposal allowed. Additionally I do not 
want to mount every block device in the system to determine possible additional
installs during new installation, this may create an acceptable delay on tiny
systems with only a few partitions. As soon as you let this run on a server
with dozens or even hundreds of block devices it will be much too slow.

The idea about using labels for filesystems by default makes much sense and 
could be implemented relatively easy (your naming scheme exceeds max label 
length which is 16 for reiser and ext2/3 and 12 for xfs but this could easily 
be avoided) but this is clearly also something to be decided about by project 
management (since it for example creates non-uniquely labeled filesystems as
soon as you have more than one installation of the same distribution or more
than one swap, curerntly udev is not handling such duplicate label names very
well). 

Please create a feature request and let project management decide about its
implementation. It does not make sense to waste man months because of a 
bugzilla report as long as it is completely unknown what the management wants.
Comment 26 Christian Jäger 2007-10-05 15:31:19 UTC
Agreed with that. I think that the root of the problem is twofold: Firstly, the 'upgrade'-option seems to have 'bad reputation' though I don't know whether this is at all based on actual problems; I haven't searched bugzilla for it. So many people prefer a 'clean' install that only keeps /home intact. Now that creating a partition for /home is suggested by default, the logical step is to leave it alone. 'Clean' install doesn't mean the same as before. Perhaps we should look at the 'upgrade'-option, too and see what, if anything, is wrong with it.
Comment 27 Christian Jäger 2007-10-08 19:41:39 UTC
As it seems there is indeed reason that users prefer 'new install' over the 'upgrade'-option. I have read several reports now of serious dependency-resolution-problems with 10.2 --> 10.3 upgrades. For example this one: http://education.zdnet.com/?p=1255

These sorts of reports are really meant to scare people away from openSUSE.

If no-one else does I WILL file a feature-request to abolish the current 'upgrade'-option and replace it with an option for a clean install that only leaves the 'home'-partition intact.
Comment 28 Christian Jäger 2007-10-08 20:37:47 UTC
Done: Bug #331939
Comment 29 Federico Mena Quintero 2007-10-11 05:55:17 UTC
This probably won't get fixed for 10.2; moving to 10.3.
Comment 30 Thomas Fehr 2007-12-19 10:38:09 UTC
I now added code that checks if the filesystem that the proposal selected
for /home already contains a valid home filesystem. If this is the case the
partition used for /home is not formatted any more. 
This change will be available in with 11.0 Alpha1.
Comment 31 Federico Mena Quintero 2007-12-19 16:15:16 UTC
Thanks a bunch, Thomas :)  I'm eagerly awaiting the Alpha1 ISOs to install them on my box.