Re: Variable path of one-partition devices



On Sun, 04 Dec 2005 22:14:36 +0100, Luxman staggered into the Black Sun
and said:
> I noticed that hotplugged devices like USB pen drive or flash memory
> which contain a single partition are assigned to either a device file
> like /dev/sda1 or /dev/sda. Why does this happen?

Some USB devices are partitioned. Some aren't.

> Is there a way to know beforehand if the device is going to be
> assigned to sdx rather than sdx1?

Not until the device is plugged in. At that point, you can read the
first 512 bytes and see if a partition table is present. If a table is
present and makes sense, then you'd use /dev/sdX1. If no table or the
table doesn't make sense, you'd use /dev/sdX.

--
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
Brainbench MVP for Linux Admin / mail: TRAP + SPAN don't belong
http://www.brainbench.com / "He is a rhythmic movement of the
-----------------------------/ penguins, is Tux." --MegaHAL
.



Relevant Pages

  • Re: reboot after creating partiotion
    ... When i create a new partition using cfdisk, parted or fdisk i need to ... reboot in order to see the device file in /dev. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: How to determine the partition for a file
    ... >> How do you get from the file name to the corresponding partition name ... be in the same filesystem. ... because that device file is the partition. ... the inode resides in, then which device in the volume ...
    (comp.unix.admin)
  • Re: How to determine the partition for a file
    ... >> How do you get from the file name to the corresponding partition name ... be in the same filesystem. ... because that device file is the partition. ... the inode resides in, then which device in the volume ...
    (comp.unix.programmer)
  • reboot after creating partiotion
    ... When i create a new partition using cfdisk, parted or fdisk i need to ... reboot in order to see the device file in /dev. ...
    (Debian-User)
  • Re: Partitioning my hard drive
    ... big advantage of a single partition per physical drive is simplicity. ... hard disk. ... will include your partition that you install to). ...
    (microsoft.public.windowsxp.general)