Bug 186994 - [nvme] Not able to create partition and mount the file system on NVMe SSD
Summary: [nvme] Not able to create partition and mount the file system on NVMe SSD
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: Mark Linimon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-24 05:00 UTC by Vijay
Modified: 2018-12-04 12:16 UTC (History)
1 user (show)

See Also:


Attachments
201403171941134_BEI0XT4N.gif (13.71 KB, image/gif)
2014-03-17 10:41 UTC, Vijay
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vijay 2014-02-24 05:00:00 UTC
Hello,

I am trying to create partition and file system, and then mount the device for read/write, on a NVME based SSD. Using FreeBSD 9.2 version. 
Created a loader.config file in /boot. Added
nvme_load="YES"
nvd_load="YES"

lines to the loader.config file. After a reboot I see my device getting listed in /dev. It shows /dev/nvme0 and /dev/nvme0ns1.

After this, basic nvmecontrol commands work fine and provide all the details about the device. 

Next, I used the below commands to create partition and file system. But I get the errors as shown
CODE: SELECT ALL
gpart create -s gpt /dev/nvme0ns1  
Error: Invalid argument

gpart create s gpt /dev/nvme0
Error: Invalid argument

gpart show /dev/nvme0ns1
Error: No such geom.  

newfs /dev/nvme0ns1
Error: reserved not less than device size 0

I followed the same conventions as used for ATA devices as given in some of the examples in freebsd.org. (/dev/ada0). But it does not work for me. Could you please help me to resolve the above errors and let me know how do I give the NVMe based SSD name for the above commands?

Fix: 

-
How-To-Repeat: Just follow the same steps as specified above, the problem will be seen.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2014-02-24 07:10:23 UTC
Responsible Changed
From-To: freebsd-i386->freebsd-bugs

reclassify.
Comment 2 Christian Brueffer freebsd_committer 2014-03-14 13:22:21 UTC
Responsible Changed
From-To: freebsd-bugs->jimharris

Jim, could you have a look at this?
Comment 3 Jim Harris freebsd_committer 2014-03-14 15:34:56 UTC
nvd(4) is the GEOM disk driver for NVMe, and provides the block devices
that can be partitioned.  After loading nvd(4), you should see a /dev/nvd0
device.  Please try partitioning this device, instead of /dev/nvme0ns1.

/dev/nvme0ns1 is a control device, for sending NVMe passthrough commands
(typically via the nvmecontrol utility).

I will take a look at adding some more details to the nvme(4) and nvd(4)
man pages, to make all of this more clear.
Comment 4 Vijay 2014-03-17 10:41:43 UTC
<HTML><HEAD><TITLE>Samsung Enterprise Portal mySingle</TITLE>
<META content=IE=5 http-equiv=X-UA-Compatible>
<META content="text/html; charset=windows-1252" http-equiv=Content-Type>
<STYLE id=mysingle_style type=text/css>P {
	MARGIN-BOTTOM: 5px; FONT-SIZE: 9pt; FONT-FAMILY: Arial, arial; MARGIN-TOP: 5px
}
TD {
	MARGIN-BOTTOM: 5px; FONT-SIZE: 9pt; FONT-FAMILY: Arial, arial; MARGIN-TOP: 5px
}
LI {
	MARGIN-BOTTOM: 5px; FONT-SIZE: 9pt; FONT-FAMILY: Arial, arial; MARGIN-TOP: 5px
}
BODY {
	FONT-SIZE: 9pt; FONT-FAMILY: Arial, arial; MARGIN: 10px; LINE-HEIGHT: 1.4
}
</STYLE>

<META name=GENERATOR content=ActiveSquare></HEAD>
<BODY>
<P>Hello Jim,</P>
<P>Thanks for the info. I'll try this and let you know the results. </P>
<P>&nbsp;</P>
<P>--Thanks</P>
<P>Vijay</P>
<P>&nbsp;</P>
<P>------- <B>Original Message</B> -------</P>
<P><B>Sender</B> : Jim Harris&lt;jimharris@freebsd.org&gt;</P>
<P><B>Date</B> : Mar 15, 2014 00:34 (GMT+09:00)</P>
<P><B>Title</B> : Re: kern/186994: [nvme] Not able to create partition and mount the file system on NVMe SSD</P>
<P>&nbsp;</P>
<DIV dir=ltr>
<DIV>nvd(4) is the GEOM disk driver for NVMe, and provides the block devices that can be partitioned.&nbsp; After loading nvd(4), you should see a /dev/nvd0 device.&nbsp; Please try partitioning this device, instead of /dev/nvme0ns1.<BR><BR></DIV>
<DIV>/dev/nvme0ns1 is a control device, for sending NVMe passthrough commands (typically via the nvmecontrol utility).<BR><BR></DIV>
<DIV>I will take a look at adding some more details to the nvme(4) and nvd(4) man pages, to make all of this more clear.<BR></DIV>
<DIV><BR></DIV><BR></DIV>
<P>&nbsp;</P>
<P>&nbsp;</P><!--SP:v.motagi-->
<P>--Thanks</P>
<P>Vijay Motagi</P><!--v.motagi:EP-->
<P>&nbsp;</P>
<TABLE id=confidentialsignimg>
<TBODY>
<TR>
<TD NAMO_LOCK>
<P><IMG border=0 src="cid:Z5JE7EUABGFC@namo.co.kr" width=520></P></TD></TR></TBODY></TABLE></BODY></HTML><img src='http://ext.samsung.net/mailcheck/SeenTimeChecker?do=6ec7a20cfdabd4efc1aa014e5785c29531eda94a0c8e0a13b121a44c6f3d1e5fe06320f437dc9d0d087c1128377f1699f4bcdeced46ed5ee08cece8541bc14eacf878f9a26ce15a0' border=0 width=0 height=0 style='display:none'>
Comment 5 Alex Frolikov 2014-11-05 19:30:36 UTC
(In reply to Jim Harris from comment #3)
> nvd(4) is the GEOM disk driver for NVMe, and provides the block devices
> that can be partitioned.  After loading nvd(4), you should see a /dev/nvd0
> device.  Please try partitioning this device, instead of /dev/nvme0ns1.
> 
> /dev/nvme0ns1 is a control device, for sending NVMe passthrough commands
> (typically via the nvmecontrol utility).
> 
> I will take a look at adding some more details to the nvme(4) and nvd(4)
> man pages, to make all of this more clear.

Hi Jim,

Thank you for your reply. I followed your instructions by enabling nvd module:
in loader.config I added:
nvd_load="YES"

After a reboot, verified that the module is indeed loaded.
kldstat
*
nvd.ko

However, I do not see /dev/nvd0

I tried on a Samsung SM1715 card and also on an Intel P3700. Both NVMe cards show up in /dev/nvme* but not in /dev/nvd*

This is FreeBSD 10.0, and the workaround above is for FreeBSD 9.2 so should be applicable.

Please advise.
Comment 6 Eitan Adler freebsd_committer freebsd_triage 2018-05-28 19:44:51 UTC
batch change:

For bugs that match the following
-  Status Is In progress 
AND
- Untouched since 2018-01-01.
AND
- Affects Base System OR Documentation

DO:

Reset to open status.


Note:
I did a quick pass but if you are getting this email it might be worthwhile to double check to see if this bug ought to be closed.
Comment 7 Mark Linimon freebsd_committer freebsd_triage 2018-12-04 12:16:21 UTC
Deassign from inactive committer.  Also, this PR is from 2014, and is unlikely to still apply.

To submitter: please let us know if this is still a problem.