Hi,
   I am configuring a Linux under VirtualBox-5.0.0-rc3 and one of the partition 
will be NTFS. The disk is raw disk, on host exposed as /dev/sdc, on guest 
appears as /dev/sda.

It seems detection of virtual drive geometry fails or mkntfs is broken. Seems I 
can provide mkntfs with cyl/head/sect counts but what is the cause?

It seems very dangerous to blindly set starting sector to zero and starting 
zero-ing my drive.

I get same mkntfs results from the host Linux system running 3.10.78 kernel and 
guest linux-4.0.4 (VirtualBox 5.0.0-rc3, 3TB RAW disk used). I don't think it 
is an issue with VirtualBox but with mkntfs. Or, does this happen because I 
created the NTFS partition entry under a "broken" virtualbox (and subsequent 
attempts to run mkntfs will fail in the same way under both host and guest 
operating systems)? I am not sure whether I created the partition table from 
guest or from host, I was fiddling a lot with GPT and MBR tables and am just 
not certain.


linux_host# gdisk /dev/sdc
GPT fdisk (gdisk) version 1.0.0

Partition table scan:
   MBR: protective
   BSD: not present
   APM: not present
   GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): p
Disk /dev/sdc: 5860533168 sectors, 2.7 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): 407277B2-867C-4BB2-A6B1-A8E5102D023D
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 5860533134
Partitions will be aligned on 8-sector boundaries
Total free space is 3951 sectors (1.9 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
    1            2048          602111   293.0 MiB   EF02  BIOS boot partition
    2          602112         1220939   302.2 MiB   EF00  EFI System
    3         1220940      4290238574   2.0 TiB     8300  rootfs
    4      4290240512      4357349375   32.0 GiB    8200  swap
    5      4357349376      5860533134   716.8 GiB   0700  ntfs

Command (? for help): q
linux_host#
linux_host# mkntfs /dev/sdc5 --help

Usage: mkntfs [options] device [number-of-sectors]

Basic options:
     -f, --fast                      Perform a quick format
     -Q, --quick                     Perform a quick format
     -L, --label STRING              Set the volume label
     -C, --enable-compression        Enable compression on the volume
     -I, --no-indexing               Disable indexing on the volume
     -n, --no-action                 Do not write to disk

Advanced options:
     -c, --cluster-size BYTES        Specify the cluster size for the volume
     -s, --sector-size BYTES         Specify the sector size for the device
     -p, --partition-start SECTOR    Specify the partition start sector
     -H, --heads NUM                 Specify the number of heads
     -S, --sectors-per-track NUM     Specify the number of sectors per track
     -z, --mft-zone-multiplier NUM   Set the MFT zone multiplier
     -T, --zero-time                 Fake the time to be 00:00 UTC, Jan 1, 1970
     -F, --force                     Force execution despite errors

Output options:
     -q, --quiet                     Quiet execution
     -v, --verbose                   Verbose execution
         --debug                     Very verbose execution

Help options:
     -V, --version                   Display version
     -l, --license                   Display licensing information
     -h, --help                      Display this help

Developers' email address: ntfs-3g-de...@lists.sf.net
News, support and information:  http://tuxera.com

linux_host# mkntfs -V

mkntfs v2014.2.15 (libntfs-3g)

Create an NTFS volume on a user specified (block) device.

Copyright (c) 2000-2007 Anton Altaparmakov
Copyright (c) 2001-2005 Richard Russon
Copyright (c) 2002-2006 Szabolcs Szakacsits
Copyright (c) 2005      Erik Sornes
Copyright (c) 2007      Yura Pakhuchiy
Copyright (c) 2010-2012 Jean-Pierre Andre

This program is free software, released under the GNU General Public License
and you are welcome to redistribute it under certain conditions.  It comes with
ABSOLUTELY NO WARRANTY; for details read the GNU General Public License to be
found in the file "COPYING" distributed with this program, or online at:
http://www.gnu.org/copyleft/gpl.html

Developers' email address: ntfs-3g-de...@lists.sf.net
News, support and information:  http://tuxera.com

linux_host# mkntfs -n /dev/sdc5
Running in READ-ONLY mode!
The partition start sector specified for /dev/sdc5 and the automatically 
determined value is too large.  It has been set to 0.
Cluster size has been automatically set to 4096 bytes.
To boot from a device, Windows needs the 'partition start sector', the 'sectors 
per track' and the 'number of heads' to be set.
Windows will not be able to boot from this device.
Initializing device with zeroes: 100% - Done.
Creating NTFS volume structures.
mkntfs completed successfully. Have a nice day.
linux_host#



Above I show it with "-n" option but initally I ran the command without it. so, 
maybe beginning of my /dev/sdc drive was deleted?




linux_host# fdisk /dev/sdc

Welcome to fdisk (util-linux 2.26.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk /dev/sdc: 2.7 TiB, 3000592982016 bytes, 5860533168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 407277B2-867C-4BB2-A6B1-A8E5102D023D

Device          Start        End    Sectors   Size Type
/dev/sdc1        2048     602111     600064   293M BIOS boot
/dev/sdc2      602112    1220939     618828 302.2M EFI System
/dev/sdc3     1220940 4290238574 4289017635     2T Linux filesystem
/dev/sdc4  4290240512 4357349375   67108864    32G Linux swap
/dev/sdc5  4357349376 5860533134 1503183759 716.8G Microsoft basic data

Command (m for help): q

linux_host#


linux_host # smartctl -a /dev/sdc
smartctl 6.3 2014-07-26 r3976 [x86_64-linux-3.10.78-default-pciehp] (local 
build)
Copyright (C) 2002-14, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Device Model:     d2 Quadra v3C
Serial Number:    ZA5010JQ
Firmware Version: 31AB223X
User Capacity:    3,000,592,982,016 bytes [3.00 TB]
Sector Size:      512 bytes logical/physical
Rotation Rate:    7200 rpm
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   ATA/ATAPI-6 T13/1410D revision 1
SATA Version is:  SATA 2.6, 3.0 Gb/s
Local Time is:    Sat May 23 15:22:28 2015 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

...

SMART Error Log Version: 0
No Errors Logged

SMART Self-test log structure revision number 0
Warning: ATA Specification requires self-test log structure revision number = 1
No self-tests have been logged.  [To run self-tests, use: smartctl -t]

SMART Selective self-test log data structure revision number 0
Note: revision number not 1 implies that no selective self-test has ever been 
run
  SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
     1        0        0  Not_testing
     2        0        0  Not_testing
     3        0        0  Not_testing
     4        0        0  Not_testing
     5        0        0  Not_testing
Selective self-test flags (0x0):
   After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

linux_host#


lunux_host# fdisk /dev/sdc

Welcome to fdisk (util-linux 2.26.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): x

Expert command (m for help): m

Help (expert commands):

   GPT
    i   change disk GUID
    n   change partition name
    u   change partition UUID
    M   enter protective/hybrid MBR

    A   toggle the legacy BIOS bootable flag
    B   toggle the no block IO protocol flag
    R   toggle the required partition flag
    S   toggle the GUID specific bits

   Generic
    p   print the partition table
    v   verify the partition table
    d   print the raw data of the first sector from the device
    D   print the raw data of the disklabel from the device
    f   fix partitions order
    m   print this menu

   Save & Exit
    q   quit without saving changes
    r   return to main menu


Expert command (m for help): d

First sector: offset = 0, size = 512 bytes.
00000000  eb 63 90 d0 bc 00 7c 8e  c0 8e d8 be 00 7c bf 00
00000010  06 b9 00 02 fc f3 a4 50  68 1c 06 cb fb b9 04 00
00000020  bd be 07 80 7e 00 00 7c  0b 0f 85 0e 01 83 c5 10
00000030  e2 f1 cd 18 88 56 00 55  c6 46 11 05 c6 46 10 00
00000040  b4 41 bb aa 55 cd 13 5d  72 0f 81 fb 55 aa 75 09
00000050  f7 c1 01 00 74 03 fe 46  10 66 00 80 00 08 00 00
00000060  00 00 00 00 ff fa 90 90  f6 c2 80 74 05 f6 c2 70
00000070  74 02 b2 80 ea 79 7c 00  00 31 c0 8e d8 8e d0 bc
00000080  00 20 fb a0 64 7c 3c ff  74 02 88 c2 52 be 80 7d
00000090  e8 17 01 be 05 7c b4 41  bb aa 55 cd 13 5a 52 72
000000a0  3d 81 fb 55 aa 75 37 83  e1 01 74 32 31 c0 89 44
000000b0  04 40 88 44 ff 89 44 02  c7 04 10 00 66 8b 1e 5c
000000c0  7c 66 89 5c 08 66 8b 1e  60 7c 66 89 5c 0c c7 44
000000d0  06 00 70 b4 42 cd 13 72  05 bb 00 70 eb 76 b4 08
000000e0  cd 13 73 0d 5a 84 d2 0f  83 d8 00 be 8b 7d e9 82
000000f0  00 66 0f b6 c6 88 64 ff  40 66 89 44 04 0f b6 d1
00000100  c1 e2 02 88 e8 88 f4 40  89 44 08 0f b6 c2 c0 e8
00000110  02 66 89 04 66 a1 60 7c  66 09 c0 75 4e 66 a1 5c
00000120  7c 66 31 d2 66 f7 34 88  d1 31 d2 66 f7 74 04 3b
00000130  44 08 7d 37 fe c1 88 c5  30 c0 c1 e8 02 08 c1 88
00000140  d0 5a 88 c6 bb 00 70 8e  c3 31 db b8 01 02 cd 13
00000150  72 1e 8c c3 60 1e b9 00  01 8e db 31 f6 bf 00 80
00000160  8e c6 fc f3 a5 1f 61 ff  26 5a 7c be 86 7d eb 03
00000170  be 95 7d e8 34 00 be 9a  7d e8 2e 00 cd 18 eb fe
00000180  47 52 55 42 20 00 47 65  6f 6d 00 48 61 72 64 20
00000190  44 69 73 6b 00 52 65 61  64 00 20 45 72 72 6f 72
000001a0  0d 0a 00 bb 01 00 b4 0e  cd 10 ac 3c 00 75 f4 c3
000001b0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
000001c0  01 00 ee fe ff ff 01 00  00 00 ff ff ff ff 00 00
000001d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
*
000001f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa

Expert command (m for help): D

PMBR: offset = 0, size = 512 bytes.
00000000  eb 63 90 d0 bc 00 7c 8e  c0 8e d8 be 00 7c bf 00
00000010  06 b9 00 02 fc f3 a4 50  68 1c 06 cb fb b9 04 00
00000020  bd be 07 80 7e 00 00 7c  0b 0f 85 0e 01 83 c5 10
00000030  e2 f1 cd 18 88 56 00 55  c6 46 11 05 c6 46 10 00
00000040  b4 41 bb aa 55 cd 13 5d  72 0f 81 fb 55 aa 75 09
00000050  f7 c1 01 00 74 03 fe 46  10 66 00 80 00 08 00 00
00000060  00 00 00 00 ff fa 90 90  f6 c2 80 74 05 f6 c2 70
00000070  74 02 b2 80 ea 79 7c 00  00 31 c0 8e d8 8e d0 bc
00000080  00 20 fb a0 64 7c 3c ff  74 02 88 c2 52 be 80 7d
00000090  e8 17 01 be 05 7c b4 41  bb aa 55 cd 13 5a 52 72
000000a0  3d 81 fb 55 aa 75 37 83  e1 01 74 32 31 c0 89 44
000000b0  04 40 88 44 ff 89 44 02  c7 04 10 00 66 8b 1e 5c
000000c0  7c 66 89 5c 08 66 8b 1e  60 7c 66 89 5c 0c c7 44
000000d0  06 00 70 b4 42 cd 13 72  05 bb 00 70 eb 76 b4 08
000000e0  cd 13 73 0d 5a 84 d2 0f  83 d8 00 be 8b 7d e9 82
000000f0  00 66 0f b6 c6 88 64 ff  40 66 89 44 04 0f b6 d1
00000100  c1 e2 02 88 e8 88 f4 40  89 44 08 0f b6 c2 c0 e8
00000110  02 66 89 04 66 a1 60 7c  66 09 c0 75 4e 66 a1 5c
00000120  7c 66 31 d2 66 f7 34 88  d1 31 d2 66 f7 74 04 3b
00000130  44 08 7d 37 fe c1 88 c5  30 c0 c1 e8 02 08 c1 88
00000140  d0 5a 88 c6 bb 00 70 8e  c3 31 db b8 01 02 cd 13
00000150  72 1e 8c c3 60 1e b9 00  01 8e db 31 f6 bf 00 80
00000160  8e c6 fc f3 a5 1f 61 ff  26 5a 7c be 86 7d eb 03
00000170  be 95 7d e8 34 00 be 9a  7d e8 2e 00 cd 18 eb fe
00000180  47 52 55 42 20 00 47 65  6f 6d 00 48 61 72 64 20
00000190  44 69 73 6b 00 52 65 61  64 00 20 45 72 72 6f 72
000001a0  0d 0a 00 bb 01 00 b4 0e  cd 10 ac 3c 00 75 f4 c3
000001b0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
000001c0  01 00 ee fe ff ff 01 00  00 00 ff ff ff ff 00 00
000001d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
*
000001f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa

GPT Header: offset = 512, size = 512 bytes.
00000200  45 46 49 20 50 41 52 54  00 00 01 00 5c 00 00 00
00000210  27 23 73 66 00 00 00 00  01 00 00 00 00 00 00 00
00000220  af a3 50 5d 01 00 00 00  22 00 00 00 00 00 00 00
00000230  8e a3 50 5d 01 00 00 00  b2 77 72 40 7c 86 b2 4b
00000240  a6 b1 a8 e5 10 2d 02 3d  02 00 00 00 00 00 00 00
00000250  80 00 00 00 80 00 00 00  72 e4 e6 71 00 00 00 00
00000260  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
*

GPT Entries: offset = 1024, size = 16384 bytes.
00000400  48 61 68 21 49 64 6f 6e  74 4e 65 65 64 45 46 49
00000410  ab 70 0e d4 36 1a 38 4a  9e a8 82 7f 9e cb d1 2f
00000420  00 08 00 00 00 00 00 00  ff 2f 09 00 00 00 00 00
00000430  00 00 00 00 00 00 00 00  42 00 49 00 4f 00 53 00
00000440  20 00 62 00 6f 00 6f 00  74 00 20 00 70 00 61 00
00000450  72 00 74 00 69 00 74 00  69 00 6f 00 6e 00 00 00
00000460  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
*
00000480  28 73 2a c1 1f f8 d2 11  ba 4b 00 a0 c9 3e c9 3b
00000490  1d 81 4c 09 85 ae 60 43  86 3b ea 4b b2 70 c6 22
000004a0  00 30 09 00 00 00 00 00  4b a1 12 00 00 00 00 00
000004b0  00 00 00 00 00 00 00 00  45 00 46 00 49 00 20 00
000004c0  53 00 79 00 73 00 74 00  65 00 6d 00 00 00 00 00
000004d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
*
00000500  af 3d c6 0f 83 84 72 47  8e 79 3d 69 d8 47 7d e4
00000510  c4 e4 24 9a 88 28 1f 4e  89 80 43 3f 06 1f 95 b4
00000520  4c a1 12 00 00 00 00 00  6e d8 b7 ff 00 00 00 00
00000530  00 00 00 00 00 00 00 00  72 00 6f 00 6f 00 74 00
00000540  66 00 73 00 00 00 00 00  00 00 00 00 00 00 00 00
00000550  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
*
00000580  6d fd 57 06 ab a4 c4 43  84 e5 09 33 c8 4b 4f 4f
00000590  3e 01 d5 6a f3 f3 0e 42  99 f9 83 41 27 a6 b9 ca
000005a0  00 e0 b7 ff 00 00 00 00  ff df b7 03 01 00 00 00
000005b0  00 00 00 00 00 00 00 00  73 00 77 00 61 00 70 00
000005c0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
*
00000600  a2 a0 d0 eb e5 b9 33 44  87 c0 68 b6 b7 26 99 c7
00000610  91 bc f1 36 c9 43 24 4b  9c f0 b4 28 70 a7 a6 bb
00000620  00 e0 b7 03 01 00 00 00  8e a3 50 5d 01 00 00 00
00000630  00 00 00 00 00 00 00 00  6e 00 74 00 66 00 73 00
00000640  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
*

Expert command (m for help): q

linux_host#




BTW, I found related http://www.fsarchiver.org/forums/viewtopic.php?f=17&t=950 
but I did not use fsarchiver. I just created GPT partition with MBR fallback 
and wanted to create a filesystem from scratch.

Thank you for clues,
Martin

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
ntfs-3g-devel mailing list
ntfs-3g-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ntfs-3g-devel

Reply via email to