#248 Creating file system detroys sun disklabel

open
mkfs (5)
5
2006-09-01
2006-06-08
Jim Gifford
No

No matter how I configure the /dev/sdb, after i format
the disk the sun disklabel is gone. Here is the steps I
used to create and verify the issue. Note: This does
not happen with ext2/ext3 file systems.

First - I create the disk label, doing this on a
secondary drive. This is Sparc system.

SCSI device sdb: drive cache: write through w/ FUA
sdb: sdb1 sdb2 sdb3

Second - Format /dev/sdb1 with jfs

mkfs.jfs version 1.1.11, 05-Jun-2006
Warning! All data on device /dev/sdb1 will be lost!

Continue? (Y/N) Y
\

Format completed successfully.

17635328 kilobytes total disk space.

Third re-run fdisk to verify disklabel

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

Discussion

  • Jim Gifford
    Jim Gifford
    2006-06-09

    Logged In: YES
    user_id=492775

    I workaround for this issue is to start the partition on
    block 1 instead of block 0.

    mkfs.jfs /dev/sdb1
    mkfs.jfs version 1.1.11, 05-Jun-2006
    Warning! All data on device /dev/sdb1 will be lost!

    Continue? (Y/N) y
    \

    Format completed successfully.
    17685504 kilobytes total disk space.

    # fdisk /dev/sdb

    Command (m for help): p

    Disk /dev/sdb (Sun disk label): 64 heads, 32 sectors, 17272
    cylinders
    Units = cylinders of 2048 * 512 bytes

    Device Flag Start End Blocks Id System
    /dev/sdb1 1 17272 17685504 83 Linux native
    /dev/sdb3 0 17272 17686528 5 Whole disk

    Command (m for help): x

     
  • David Kleikamp
    David Kleikamp
    2006-09-01

    Logged In: YES
    user_id=422440

    Sorry I let this go so long. Can you try the attached
    patch? I "borrowed" some code from xfsprogs.

     
  • David Kleikamp
    David Kleikamp
    2006-09-01

    Don't zero the reserved space at the beginning of a partition if we can recognize it as a partition label

     
    Attachments
  • David Kleikamp
    David Kleikamp
    2006-09-01

    • labels: --> mkfs
    • assigned_to: nobody --> shaggyk