[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: parted / partition type
From: |
Andrew Clausen |
Subject: |
Re: parted / partition type |
Date: |
Tue, 23 Jan 2001 12:02:08 -0200 |
Hi Scott :-)
Scott Scriven wrote:
> The information I'm trying to get from parted is the "0x83" or
> "Apple_HFS". The type of filesystem isn't important to me.
> Currently, I'm using a combination of the fstype, minor number,
> and the partition flags to determine what the partition type
> is.
>
> The goal is to allow the program to work using newbie language.
> There are only 7 partition configurations the user will see:
>
> Newbie Term PType Flags Filesystem
> ----------- ----- ----- ----------
> Mac OS <-> Apple_HFS hfs
> Linux <-> Apple_UNIX_SVR2 anything
> Linux root <-> Apple_UNIX_SVR2 root anything
> Linux swap <-> Apple_UNIX_SVR2 swap swap
> Bootloader <-> Apple_bootstrap boot hfs
> Unused <-> Apple_Free
> Error <-> Any other configuration is "incorrect"
>
> I don't need to know the fstype, except when resizing
> partitions. Formatting is completed later.
OK, I guess that looks good.
> > What do you mean by "formatted correctly"?
>
> Your guess was correct. An Apple_HFS with an ext2 filesystem
> would be "incorrect" or unformatted. Also, if I removed a
> valid linux-swap partition and placed an Apple_bootstrap at the
> same starting point, that would be considered unformatted.
So, if a user "naïvely" does mkfs.ext2 on their macos partition,
(they don't want it any more!) and installs linux there,
are you going to reformat it to HFS for them?
I think the on-disk file system is much more important than
what the partition table says, so rather than treating the
the partition as unformatted, I would treat the partition
table as incorrect.
To do this in libparted, just do:
ped_partition_set_system (part, part->fs_type);
libparted doesn't do this automatically, because there might
be deep-and-meaningful reasons why this is a bad idea on
some platforms. Better to leave things as-is, IMHO.
In future, I think I will add: partition type looks insane.
Fix?
> I don't really need to know if a partition is "formatted
> correctly". I'm just using it as a way to figure out what the
> partition type is, so I can figure out which of the 7
> newbie-level types it is.
Well, looking at the data is better than the partition ID, IMHO
> > What kind of libparted interface do you have in mind?
>
> The current interface is nice. The only thing I would change
> is to add one more column to its "print" output, to display the
> partition type.
***LIBPARTED***
Andrew Clausen
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: parted / partition type,
Andrew Clausen <=