none
Unable to create filesystem (mkfs.ext4) on large > 2TB GPT virtual disk using Linux VM.

    Question

  • I am unable to create a file system on a large (> 2TB disk) virtual disk for a Linux VM.  I can create the disk, attach it to the VM, partition it with "parted", but I cannot run mkfs.ext4.  Details below.

    Hyper-V 2012 Core (w/ all Windows/Microsoft updates as of 4/19).

    CentOS 6.4 VM w/ 4 virtual processors, 4GB RAM, and 3 dynamic drives: 

    /dev/sda  100GB IDE dynamic vhdx
    /dev/sdb  75GB IDE dynamic vhdx
    /dev/sdc  10TB SCSI dynamic vhdx

    Using parted, created 500GB partition on the 10TB drive (/dev/sdc1). 

    (parted) select /dev/sdc
    Using /dev/sdc
    (parted) print
    Model: Msft Virtual Disk (scsi)
    Disk /dev/sdc: 11.0TB
    Sector size (logical/physical): 512B/4096B
    Partition Table: gpt

    Number  Start   End    Size   File system  Name                Flags
     1      1049kB  500GB  500GB               production_archive

    then run: mkfs.ext4 /dev/sdc1

    repeating error on console from mkfs.ext4:

    INFO: task mkfs.ext4:2581 blocked for more than 120 seconds
    "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.

    Runaway error in var/log/messages until my /var system filled up - 25G worth of it:

    -rw-------. 1 root root 25085329408 Apr 19 23:15 messages

    Apr 19 17:39:28 nfs2 kernel: sd 4:0:0:0: [sdc] Sense Key : No Sense [current]
    Apr 19 17:39:28 nfs2 kernel: sd 4:0:0:0: [sdc] Add. Sense: No additional sense information
    Apr 19 17:39:28 nfs2 kernel: hv_storvsc vmbus_0_13: cmd 0x93 scsi status 0x2 srb status 0x6

    Same problem happens when running "mkfs.ext4 -E lazy_itable_init=1 /dev/sdc1"

    Monday, April 22, 2013 7:28 PM

Answers

  • Aaron,

    Using mkfs.ext4 with the -K switch worked.  I am able to successfully create a file system and use the drives.  For reference to others with this issue:

    - Do not attempt to partition and format the drive during installation.  Instead, use parted and mkfs.ext4 to prepare the drive installation.

    - Do not create the file system with parted.  Only use parted to label and carve the drive.  Use mkfs.ext4 -K to independently format the drive after parted.

    Thank you for your help!

    James


    Tuesday, May 28, 2013 8:43 PM
  • Hi James,

    Yes Microsoft has aware of this issue. Our support team has contacted with RedHat. And RedHat has indicated there is a workaround. Here is what they indicated:

    Note you can avoid sending down the WRITE_SAME commands at mkfs time by using the "-K" flag on invocation.

    Thanks.


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Saturday, May 11, 2013 9:06 AM

All replies

  • Hi,

    Thank you for your post.

    I am trying to involve someone familiar with this topic to further look at this issue.

     

    Lawrence

    TechNet Community Support

    Tuesday, April 23, 2013 5:21 AM
    Moderator
  • Hi ,

    If you uses an MBR formatted disk less than 2 TB from the SAN, does it work?


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Wednesday, April 24, 2013 8:01 AM
  • Yes, small disks work on the virtual scsi adapter.  My work-around strategy was to create 10 x 1.5TB disks on SCSI0 - SCSI9.  Then add those disks to an LVM group, and provision large (> 2TB) logical volumes.   The drawback of this workaround is that my Linux volumes are comingled over all 10 VHDX files...instead of one Linux volume per VHDX file. 
    Wednesday, April 24, 2013 2:19 PM
  • Any more info available from Microsoft?
    Friday, May 03, 2013 2:01 PM
  • Hi James,

    I send this information to product team. They are aware of this issue and it seems to be related to Linux itself. I hope the workaround strategy is acceptable.

    Thanks.


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Wednesday, May 08, 2013 9:03 AM
  • Aaron,

    Thanks for the reply.  I'm not sure if it's fair to pin this as a Linux issue.  We do not see the problem on our VMware test stack.  Nor do we see it with physical Linux systems with real drives.  It seems more probable that its an issue is directly related to hyper-v - either the driver or the synthetic device itself. 

    The workaround strategy requires several compromises we prefer not to make.  Most notably, I can't bind a single drive mount to a single vhdx.  Instead, every mount is dependent on every vhdx file in the set. 

    Is Microsoft tracking this issue as a bug with intention of fixing in a future patch/hotfix or updated Linux Integration Components? 

    Thanks again for your time.

    James

    Friday, May 10, 2013 2:33 PM
  • Hi James,

    Yes Microsoft has aware of this issue. Our support team has contacted with RedHat. And RedHat has indicated there is a workaround. Here is what they indicated:

    Note you can avoid sending down the WRITE_SAME commands at mkfs time by using the "-K" flag on invocation.

    Thanks.


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Saturday, May 11, 2013 9:06 AM
  • Aaron,

    Using mkfs.ext4 with the -K switch worked.  I am able to successfully create a file system and use the drives.  For reference to others with this issue:

    - Do not attempt to partition and format the drive during installation.  Instead, use parted and mkfs.ext4 to prepare the drive installation.

    - Do not create the file system with parted.  Only use parted to label and carve the drive.  Use mkfs.ext4 -K to independently format the drive after parted.

    Thank you for your help!

    James


    Tuesday, May 28, 2013 8:43 PM
  • Update on this thread:  Microsoft has released a fix to Hyper-V that solves this problem.  See http://support.microsoft.com/kb/3004905.


    Michael Kelley, Lead Program Manager, Open Source Technology Center

    Thursday, November 20, 2014 1:35 AM