Re: Variable path of one-partition devices
- From: Dances With Crows <danSPANceswitTRAPhcrows@xxxxxxxxx>
- Date: Sun, 04 Dec 2005 15:29:11 -0600
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
.
- Follow-Ups:
- Re: Variable path of one-partition devices
- From: Luxman
- Re: Variable path of one-partition devices
- References:
- Variable path of one-partition devices
- From: Luxman
- Variable path of one-partition devices
- Prev by Date: ISA SoundBlaster card with newer distributions?
- Next by Date: Distro that includes beagle?
- Previous by thread: Variable path of one-partition devices
- Next by thread: Re: Variable path of one-partition devices
- Index(es):
Relevant Pages
|