parted and mount
I have attempted to mount USB external formatted media on a SL7 system. One was a flash drive with a MS format (reported by parted as FAT32); the other was a 2 Tbyte hard drive XFS formatted on a different SL7 system. In both cases, the system automatically generated /dev/sdg when the USB device was connected through a USB port. parted on each device reported the correct file system and size/partition. As root, I created /mount/mnt1, but all attempts to mount /dev/sdg /mount/mnt1 failed with an unknown file system, even with the modifier -t (e.g., -t xfs for the xfs format USB hard drive). Why do parted and mount have this difference? Yasha Karant
Re: parted and mount
On Wed, Sep 26, 2018 at 8:38 AM Yasha Karant wrote: > > I have attempted to mount USB external formatted media on a SL7 > system. One was a flash drive with a MS format (reported by parted as > FAT32); the other was a 2 Tbyte hard drive XFS formatted on a > different SL7 system. > > In both cases, the system automatically generated /dev/sdg when the > USB device was connected through a USB port. parted on each device > reported the correct file system and size/partition. As root, I created > /mount/mnt1, but all attempts to mount /dev/sdg /mount/mnt1 failed with > an unknown file system, even with the modifier -t (e.g., -t xfs for > the xfs format USB hard drive). > > Why do parted and mount have this difference? /dev/sdg1 ?
Re: parted and mount
On Wed, Sep 26, 2018 at 2:38 AM Yasha Karant wrote: > > I have attempted to mount USB external formatted media on a SL7 system. > One was a flash drive with a MS format (reported by parted as FAT32); > the other was a 2 Tbyte hard drive XFS formatted on a different SL7 > system. /dev/sdg1 would be the first "partition" on the device. "parted -l /dev/sdg" will report partitions. There need not to be partitions. It is also possible to write a filesystem directly on the whole device, which may be the case for whatever formatted it, in which case it would be on /dev/sdg. Partition tables are an old, extremely lightweight system written into a very few blocks at the beginning of the disk for *ancient* disk controllers. As such, it is *extremely* limited. In fact, by the standard, a disk can only have 4 partitions: set up some space as extended partitions, and then a kernel can get fancy and do LVM, software RAID, etc. There is a byte or two set aside for labeling the "type" of the partition, but there ae many more types of filesystems now, so tools like parted cannot really keep up: it's why there is not an "ext4" option for making partions in parted, and why we typically use "ext2" for that. gparted, while a fine and useful tool, is a graphical wrapper for "parted", and "mkfs" of various flavors. Like many open source GUI's, it hides options available from the command line. But I'm surprised if you can't run "parted -l" to get a listing of all the partitions on all your attached devices that are detected, including "/dev/sdg" if that is indeed your attached device with data on it. You know I'm wondering if you inadvertently set up volume group and logical volumes on your drive, activating them with gparted without even realizing it. What does "pvscan" and "vgscan" say? I remember that gparted supports those, and if you'd not even installed the LVM tools on your second system, you wouldn't have those scanning tools available.
Re: parted and mount
Thank you for your clarifications. As I recalled, gparted is a GUI that does both parted and mkfs -- my memory was correct that by using gparted as I did, there not only was some header claiming a XFS format, but the drive was in fact so formatted. Although I fully agree that the CLI commands (parted and xfs) are more versatile with more options than gparted, I have found both in teaching students and training technicians that for most purposes, gparted is sufficient and is less prone to human error (including typing errors). I suggest that you might comment upon the actual output from parted and mount that I included in a related thread on this list: ( Re: parted and mount ** EXTERNAL ** ) and thus I am not reproducing that information here. What the outputs seemed to show was that parted found that /dev/sdg was XFS and thus I assume "mountable" by root, but that mount refused to accept the same device. As you point out, /dev/xyz can be mounted, not just /dev/xyzN . As for the concerns that these might be part of a LVM or some other file/disk/storage logical structure beyond the original (and very limited) partition scheme adopted for MS-DOS on very limited (pre-demand-page-virtual-memory) X86 machines (and much more limited than current X86-64 machines), I will do as you suggest; but as I formatted the external USB 2 Tbyte drive with gparted, I suspect that the drive has the "simple" partition format (from an epoch with much more limited disk controllers and disk types than currently available on "small systems" -- e.g., IDE or even SCSI contrasted with SATA, but not "mainframe" technology of that epoch). The partition scheme of MS DOS type machines is relatively simple and limited, but likewise, more easily recovered and manipulated; in my opinion (no flame wars, please), the current disk/file system structures often are more fragile for "simple" applications such as a standalone but Internet capable workstation. This is not to state that I prefer MS FAT or EXT2 file system formats -- given the current stability and capabilities of XFS, that is the file system (not partition, etc., scheme) that I prefer. Aside (not SL): Does anyone know: is XFS available for MS Win, Mac OS X, or Android? If so, is it licensed for free, or is it only through a proprietary application for fee? Yasha Karant On 09/27/2018 05:01 AM, Nico Kadel-Garcia wrote: > On Wed, Sep 26, 2018 at 2:38 AM Yasha Karant wrote: >> I have attempted to mount USB external formatted media on a SL7 system. >> One was a flash drive with a MS format (reported by parted as FAT32); >> the other was a 2 Tbyte hard drive XFS formatted on a different SL7 >> system. > /dev/sdg1 would be the first "partition" on the device. "parted -l > /dev/sdg" will report partitions. > > There need not to be partitions. It is also possible to write a > filesystem directly on the whole device, which may be the case for > whatever formatted it, in which case it would be on /dev/sdg. > > Partition tables are an old, extremely lightweight system written into > a very few blocks at the beginning of the disk for *ancient* disk > controllers. As such, it is *extremely* limited. In fact, by the > standard, a disk can only have 4 partitions: set up some space as > extended partitions, and then a kernel can get fancy and do LVM, > software RAID, etc. There is a byte or two set aside for labeling the > "type" of the partition, but there ae many more types of filesystems > now, so tools like parted cannot really keep up: it's why there is not > an "ext4" option for making partions in parted, and why we typically > use "ext2" for that. > > gparted, while a fine and useful tool, is a graphical wrapper for > "parted", and "mkfs" of various flavors. Like many open source GUI's, > it hides options available from the command line. But I'm surprised if > you can't run "parted -l" to get a listing of all the partitions on > all your attached devices that are detected, including "/dev/sdg" if > that is indeed your attached device with data on it. > > You know I'm wondering if you inadvertently set up volume group > and logical volumes on your drive, activating them with gparted > without even realizing it. What does "pvscan" and "vgscan" say? I > remember that gparted supports those, and if you'd not even installed > the LVM tools on your second system, you wouldn't have those scanning > tools available.
RE: parted and mount ** EXTERNAL **
> 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. *** This email is from an EXTERNAL sender *** Use caution before responding. DO NOT open attachments or click links from unknown senders or unexpected email. If this email appears to be sent from a Platte River Power Authority employee or department, verify its authenticity before acting or responding. Contact the IT Help Desk with any questions.
Re: parted and mount ** EXTERNAL **
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: 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=kHIwLV7GEvlQ7BsFbN-khVlm2Jk3eNpdwHa3-CU-mO4&s=KqeP2Q6oibvXAtGzrqiHduxB129MkpySzDVazbtVcFw&e= Dept. of Physiology and Pathophysiology, Rady Faculty of Health Sciences, Univ. of Manitoba Winnipeg, MB R3E 0J9 (Canada)
Re: parted and mount ** EXTERNAL **
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. >
Re: parted and mount ** EXTERNAL **
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: 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)
Re: parted and mount ** EXTERNAL **
Thank you for you comments. Below is the output from mount /dev/sdc1 on /run/media/ykarant/USB20FD type vfat (rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0077,codepage=437,iocharset=ascii,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2) /dev/sdb on /run/media/ykarant/e8df2b54-0637-4570-868b-9e542bf9a21f type xfs (rw,nosuid,nodev,relatime,seclabel,attr2,inode64,noquota,uhelper=udisks2) both of the /dev devices mentioned above are "automatic" from insertion into a USB jack (port) on a SL7 machine. The first is a 32 Gbyte flash drive "stick" with a works-installed MS file system, the second is an external 2 Tbyte USB harddrive with a XFS file system that is a dd copy of a partition from another SL 7 machine (that is having difficulties -- the partition is /home and the data is important). Note that the second is mounted as /dev/sdb (it was inserted before the flash drive), not as /dev/sdb1 . 2 Tbyte presumably is not "small", but nonetheless is mounted as /dev/xyz not /dev/xyzN . parted and gparted have no difficulties with either external USB drive once /dev/xyz "automatically" is created. The relevant outputs from parted run as root on the devices -- these contain/are mounted partitions: Using /dev/sdc Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) print Model: PNY USB 2.0 FD (scsi) Disk /dev/sdc: 31.0GB Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags: Number Start End Size Type File system Flags 1 4129kB 31.0GB 31.0GB primary fat32 lba Using /dev/sdb Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) print Model: WD My Passport 25E1 (scsi) Disk /dev/sdb: 2000GB Sector size (logical/physical): 512B/512B Partition Table: loop Disk Flags: Number Start End Size File system Flags 1 0.00B 2000GB 2000GB xfs Note that mount on the system reporting the above has no issue with mounting a /dev/xyz device not as /dev/xyzN Yasha Karant On 09/26/2018 10:34 AM, Gilles Detillieux wrote: > 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. >>>>
Re: parted and mount ** EXTERNAL **
On 09/26/2018 07:51 PM, Yasha Karant wrote: > the second is an > external 2 Tbyte USB harddrive with a XFS file system that is a dd copy > of a partition from another SL 7 machine (that is having difficulties -- > the partition is /home and the data is important). Wouldn't a dd copy wipe out any partition table or filesystem on the target device?