If a device has actual partitions, using a standard partitioning scheme,
even if it's just a single partition, then Linux should detect that and
create the appropriate device nodes in /dev. While less common than a
single partition covering most of the disk, some smaller drives or
devices have no partitioning at all, and therefore no partition table at
the start of the drive. In those cases, Linux will set up a node for the
drive, e.g. /dev/sdh, but no nodes for partitions (e.g. no /dev/sdh1, 2,
...). If that's the case, then it's likely that the whole drive is
formatted as a single filesystem, so you can mount /dev/sdh directly, or
use mkfs on it if you want to create a new filesystem. It's also
possible for a drive to have a corrupted partition table which Linux
can't read, so it will create the drive node, but no partition nodes.
So, approach any drive that has no clear partitions with a bit of caution.
On 09/26/2018 12:05 PM, Yasha Karant wrote:
To be clear, I created the partition and the XFS format using gparted,
the gnome GUI interface to parted. My recollection from the past, and
my observation as the drive was "flashing", was that I did not need
manually to invoke mkfs using the GUI. However, rereading the man page
for gparted, this step may have been lacking. I just confirmed by
direct observation what I had forgotten; when a flash drive USB "stick"
is inserted in a "modern" Linux system, at least two entries are created
in /dev. In the immediate test case on the laptop before me, these are
/dev/sdb and /dev/sdb1 (the USB flash drive is a MS Win format) and
/dev/sdb1 is the mounted device. Thus, when the system reports /dev/xyz
appears, the minimal first mount point would be /dev/xyzN as revealed
through a ls of /dev/ .
Question: what does one do if, after inserting a USB storage device,
one gets /dev/xyz, say, but there is no /dev/xyzN despite parted
reporting that the device does indeed have "MS" partitions as well as a
filesystem?
On 09/26/2018 07:47 AM, Gilles Detillieux wrote:
On 09/26/2018 08:34 AM, Howard, Chris wrote:
Why do parted and mount have this difference?
/dev/sdg1 ?
What he said.
/dev/sdg is the whole device
/dev/sdg1 is the first partition on that device.
Partitions have file systems. Partitions with file systems can be
mounted.
parted works on the whole device.
mount works on the partitions with file systems.
Also, if I'm not mistaken, when you create a partition using parted's
mkpart command, you designate which type of partition it is, and that
info is stored in the partition table, but it doesn't format the file
system for you. You have to follow parted with a mkfs command for each
partition you create, e.g.:
mkfs.xfs /dev/sdg1
Then you can mount the partition.
--
Gilles R. Detillieux E-mail: <[email protected]>
Spinal Cord Research Centre WWW:
https://urldefense.proofpoint.com/v2/url?u=http-3A__www.scrc.umanitoba.ca_&d=DwIDaQ&c=gRgGjJ3BkIsb5y6s49QqsA&r=gd8BzeSQcySVxr0gDWSEbN-P-pgDXkdyCtaMqdCgPPdW1cyL5RIpaIYrCn8C5x2A&m=ZAivXWOEa3JkbcTzHi5hhw6pBHoZy9IfMK0OugN0Wvk&s=FO-qkKqF9muQM16pJpkpj0YGAoNlP5AHBIPlNT9GM0I&e=
Dept. of Physiology and Pathophysiology, Rady Faculty of Health Sciences,
Univ. of Manitoba Winnipeg, MB R3E 0J9 (Canada)