bug-fdisk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-fdisk] work with file's.. more details!


From: Leslie P. Polzer
Subject: Re: [bug-fdisk] work with file's.. more details!
Date: Wed, 22 Oct 2008 10:46:15 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

On Tue, Oct 21, 2008 at 07:43:29PM +0200, Christian wrote:

> Excuse me for stupid questions but I'm will be sure that what I think 
> and will make is true... :)

Looks like you've done your homework well. :)


> We must make fdisk capable to open a zero-filled binary file and use it 
> as a disk, I'm not expert in this task
> but using gdb I see that when fdisk open `FILE' the device is setup with 
> member `type' as `PED_DEVICE_FILE'. I think
> this mean that libparted work ok with file.

Yeah, libparted works fine in this respect.


> As we can see, we can't handle `DISK' without a partition table, we must 
> make it first.

Yes, that's the way to go.


> Parted ask the user for `label type' and make a table using 
> `ped_disk_new_fresh'.
> 
> How fdisk must work with an empty file? Prompt for a partition type? Use 
> one as default? What? Show all supported partitions to user? Make this 
> feature as extension?

First it needs to startup cleanly. Afterwards the user can use the 'o'
command to create a new DOS partition table (in compatibility mode)
or a new partition table of any supported type (in GNU mode).

---
% fdisk DISK
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF 
disklabel
Building a new DOS disklabel with disk identifier 0xfc1f1bae.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

You must set cylinders.
You can do this from the extra functions menu.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help):
---

  Leslie




reply via email to

[Prev in Thread] Current Thread [Next in Thread]