Which device assigned to removable media

Jerry Feldman gaf at blu.org
Tue May 4 16:58:27 UTC 2010


On 05/04/2010 11:37 AM, roland wrote:
> On Tue, 04 May 2010 16:26:42 +0200, Jerry Feldman <gaf at blu.org> wrote:
>
>   
>> On 05/03/2010 06:28 PM, g wrote:
>>     
>>> Geoffrey Leach wrote:
>>> <snip>
>>>
>>>
>>>       
>>>> My original post was somewhat unclear. The question was which device is
>>>> assigned to the disk when it's plugged in so I can know which device to
>>>> mount.
>>>>
>>>> It appears that if I look at /dev/disk/by-label, the device name --
>>>> Sansa\x20e250 for example, is a symbolic link to the device -- ../../
>>>> sdb1 for example. I can then mount /dev/sdb1.
>>>>
>>>>         
>>> so what happens when you use commands 'df' or 'mount'?
>>>
>>> i do not have an eSATA drive to check with, but i do know that when plug
>>> in a usb memory stick, i get following.
>>>
>>> +++
>>> $ mount|grep /dev|sort
>>> /dev/hda1 on / type ext3 (rw)
>>> /dev/hda3 on /home type ext3 (rw)
>>> /dev/hdb6 on /hd/b/06 type ext3 (rw)
>>> devpts on /dev/pts type devpts (rw,gid=5,mode=620)
>>> /dev/sde on /media/disk type vfat
>>> (rw,noexec,nosuid,nodev,noatime,uid=500,utf8,shortname=lower)
>>> tmpfs on /dev/shm type tmpfs (rw)
>>>
>>> $ df|sort
>>> /dev/hda1              8076508   3842888   3816736  51% /
>>> /dev/hda3             10721904   6261968   3906500  62% /home
>>> /dev/hdb6              4814936    140776   4429572   4% /hd/b/06
>>> /dev/sde                254218      3208    251010   2% /media/disk
>>> Filesystem           1K-blocks      Used Available Use% Mounted on
>>> tmpfs                   192676         0    192676   0% /dev/shm
>>> +++
>>>
>>>
>>> therefore, i tend to presume that if you set up your eSATA drive in
>>> '/etc/fstab' for auto mount and connected it, then 'mount' and 'df'
>>> should show you your eSATA drive.
>>>
>>> as i said, i do not have a eSATA to try and i may be wrong.
>>>
>>> [and yes, i am not currently under f12. having too many problems with
>>> kde at this time.]
>>>
>>>
>>>       
>> As Geoff said previously, if you use /dev/disk/by-label in fstab, then
>> it does not matter where the disk is inserted in relation to the other
>> drives. Since eSata drives may be hot pluggable, this is the best option
>> as the physical device (/dev/sdx) may change. Additionally, the newer
>> Linux releases now use the SCSI designation, even for IDE drives so you
>> should not see and /dev/hdx designations any longer.
>>
>>     
> I you plug in a new device why don't you do:
> dmesg |tail
>
>
>   
This does not address the OP's issue. You need to have a persistent
method if you want to place that device into fstab. Take the
hypothetical case of a drive used for backups. Assume that you have a
/backups directory and you want that drive always to be mounted on
/backup. Or lets say you are rotating drives. By using the drive's label
you will always get things done correctly. Certainly dmesg will tell you
the scsi id, and where rdev decided to mount it. But another example.
Let's say I shutdown my system, remove all my drives because I want to
vacuum out the dust or for some other reason, but insert the drives in a
different order, when I reboot, my system will boot from the correct
drive because that is the drive specified in grub.conf, and will mount
the other drives properly. As an example:
UUID=5ad225ca-c0a3-4654-bd8b-3354c99b0bd8 /.snapshots            
ext4    defaults        1 2
UUID=e4f00e44-5803-4602-b3cf-8f4f3dcbcd17 /boot                  
ext4    defaults        1 2

In this case my backup volume will always be mounted on /.snapshots and
my boot drive on /boot. Everything else on my system is LVM.

-- 
Jerry Feldman <gaf at blu.org>
Boston Linux and Unix
PGP key id: 537C5846
PGP Key fingerprint: 3D1B 8377 A3C0 A5F2 ECBB  CA3B 4607 4319 537C 5846


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 253 bytes
Desc: OpenPGP digital signature
Url : http://lists.fedoraproject.org/pipermail/users/attachments/20100504/f25235ce/attachment.bin 


More information about the users mailing list