GNOME Bugzilla – Bug 755022
gparted doesn't recognize nvme devices
Last modified: 2015-10-27 17:02:22 UTC
Running gparted 22 on Fedora 22. It doesn't see nvme devices. I have an Intel 750 SSD, gparted doesn't see it, gnome-disks and parted do. The device name is /dev/nvme0, parted shows it as follows, Model: Unknown (unknown) Disk /dev/nvme0n1: 400GB Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags: Number Start End Size Type File system Flags 1 1049kB 2049kB 1000kB primary ext2 boot 4 2097kB 32.0GB 32.0GB primary ext4 2 32.0GB 64.0GB 32.0GB primary ext4 3 64.0GB 400GB 336GB primary ext4
Hi Joshua, Can you run a couple of experiments for me please, because I don't have an NVMe device. 1) Get parted to find the first disk device and print it's contents: (Please detach all other drives apart from the NVMe one) parted print quit 2) Run GParted specifying the name of the NVMe device on the command line: gparted /dev/nvme0 Thanks, Mike Analysis: You information showed that parted, and therefore libparted, can query the device, I assume when parted is told the device name "parted /dev/nvme0 print". GParted can also work with specified device names so it should be able to display and manage the NVMe device given it's name. This suggests that it is listing available devices that is not finding the NVMe device. GParted also uses libparted for this too, but the bug could be either in libparted or GParted. Hopefully the result from test (1) above will narrow down which.
print all Model: ATA Samsung SSD 840 (scsi) Disk /dev/sda: 250GB Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags: Number Start End Size Type File system Flags 1 1049kB 34.4GB 34.4GB primary ext4 boot 2 34.4GB 250GB 216GB primary ext4 Model: ATA Hitachi HDS72302 (scsi) Disk /dev/sdb: 2000GB Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags: Number Start End Size Type File system Flags 1 1049kB 25.8GB 25.8GB primary ext4 boot 2 25.8GB 51.5GB 25.8GB primary linux-swap(v1) 3 51.5GB 2000GB 1949GB primary ext4 raid Model: ATA Hitachi HDS72302 (scsi) Disk /dev/sdc: 2000GB Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags: Number Start End Size Type File system Flags 1 1049kB 25.8GB 25.8GB primary ext4 boot 2 25.8GB 51.5GB 25.8GB primary ext4 3 51.5GB 2000GB 1949GB primary ext4 raid Model: Linux Software RAID Array (md) Disk /dev/md127: 3898GB Sector size (logical/physical): 512B/512B Partition Table: loop Disk Flags: Number Start End Size File system Flags 1 0.00B 3898GB 3898GB ext4 Model: Unknown (unknown) Disk /dev/nvme0n1: 400GB Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags: Number Start End Size Type File system Flags 1 1049kB 2049kB 1000kB primary ext2 boot 4 2097kB 32.0GB 32.0GB primary ext4 2 32.0GB 64.0GB 32.0GB primary ext4 3 64.0GB 400GB 336GB primary ext4 -------------------------------------------------------------------------- gparted /dev/nvme0 Error fsyncing/closing /dev/nvme0: Invalid argument
The message "Error fsyncing/closing /dev/nvme0: Invalid argument" is coming from libparted. Can occur when opening, closing or syncing a device. GParted needs this to work as it ensures Linux kernel cache coherency between the cached data from the device and the partitions it contains. The GParted and libparted code is complicated enough that I need to debug this to work out what is exactly happening and how it might be fixed. Unfortunately I don't have a NVMe device or access to one. At the moment I'm not sure how to solve this bug.
Where's the source code. If you like I could step through the code in GDB. You might want to contact Intel and tell them who you are, they might be willing to send you a 750 so that you can get gparted working with it. Intel has been really good about supporting Linux and given that NVME devices are primarily for enterprise and HPC use where Linux dominates they have an incentive to give you one.
Hi Mike and Joshua, From a quick Internet search, it appears that Intel has an new optimized PCI Express SSD Interface for their Solid State Drives. http://www.nvmexpress.org/ On the code side of things, GParted uses it's own device parsing from the /proc/partitions file. This was due to historical problems with excessive time delays when libparted probed floppy devices. Currently there is no pattern match for "nvme..." in the /proc/partitions file so that would explain why GParted does not automatically detect the device. The relevant code section is Proc_Partitions_Info::load_proc_partitions_info_cache() https://git.gnome.org/browse/gparted/tree/src/Proc_Partitions_Info.cc?id=GPARTED_0_23_0#n90 If Intel uses standard Linux conventions for this new NVME driver, then it might be a simple case of adding a regular expression to match with the way NVME devices are named. @Joshua, to test if GParted already works with NVME devices would you be able to try passing the NVME device path to gparted on the command line (as root)? For example: gparted /dev/nvme0n1 NOTE: From the first post it appears that the device path name is "/dev/nvme0n1" <-- note the "n1" on the end. Thanks, Curtis
It works when I do, gparted /dev/nvme0n1 So it looks like adding the regular expression search should work. Make the change and point me to the source code or a binary built for F22 and I'll try it out for you.
Sorry for my misinterpretation of the data earlier. For some reason I looked at: Model: Unknown (unknown) Disk /dev/nvme0n1: 400GB and though that was a partition name and that the disk name was /dev/nvme0 and went down a blind ally. Joshua, Can you show me the output of: grep nvme /proc/partitions So that I can make sure I get the regular expression correct to match disks and not partitions. Thanks, Mike
grep nvme /proc/partitions 259 0 390711384 nvme0n1 259 1 977 nvme0n1p1 259 2 31250000 nvme0n1p2 259 3 328209496 nvme0n1p3 259 4 31249408 nvme0n1p4
Thanks Joshua for testing and confirming that the work-around of passing the NVME device name works for you. Did you name the device "nvme0n1" or some portion of that name? @Mike, I made the same mistake when I first looked at the device path. ;-) We should try to determine how the naming conventions work for the NVME driver in order to add the correct regular expression. If you have a chance to look into this enhancement then please feel free to create the patch. After that Joshua's offer to test will be greatly appreciated. Curtis
Created attachment 311505 [details] [review] Recognise NVME devices (v1) Attached is the patch for this. Joshua, You can either build GParted from the last release or use current head from Git. From source release ------------------- Get GParted application 0.23.0 source from the download page: http://gparted.org/download.php Apply attached code using patch. Build following the instructions on the development page, section "Building GParted": http://gparted.org/development.php From Git -------- Clone GIT repo, use "git am ..." to apply the patch and then build. Find all the details in the Developing GParted using Git page: http://gparted.org/git.php Thanks, Mike
There is a problem with configure, configure: error: *** libuuid not found. The library is present, /usr/lib/libuuid.so.1 /usr/lib/libuuid.so.1.3.0 /usr/lib64/libuuid.so.1 /usr/lib64/libuuid.so.1.3.0
Hi Joshua, You need the libuuid development package too, to compile the code. On Fedora it's called: libuuid-devel. N.B. The README file lists the needed packages, including this one. Thanks, Mike
Created attachment 311522 [details] [review] Recognise NVME devices (v2) Hi Curtis, Here's patch v2. The only difference are minor changes to the commit message. Thanks, Mike
Good news, the patch works.
Let me know when the RPM is in the Fedora testing repo. On an unrelated note, I have a feature request. It would be nice if Gparted could edit /etc/fstab and add the mount point for the partition that you just created. Currently I either use Webmin or just do it in Xemacs, but it would be better if Gparted could handle the whole job.
Letting you know when down stream distros updates their gparted package with the latest release is outside our power. However we won't close this bug report until we make the next release including this code, so at least GNOME Bugzilla will send you an email when that happens.
Thank you Joshua and Mike for your work to add support for NVME devices. I have committed patch set v2 from comment #13 for inclusion in the next release of GParted. The relevant git commit can be viewed at the following link: Recognise NVME devices (#755022) https://git.gnome.org/browse/gparted/commit/?id=66bb88abf7c3ef33445f8eaa1d3fa6f00950bde3
This enhancement was included in the GParted 0.24.0 release on October 27, 2015.