Author Topic: [SOLVED] Changing How USB Flash Drive Is Recognized  (Read 779 times)

skyhawk

  • Guest
[SOLVED] Changing How USB Flash Drive Is Recognized
« on: October 02, 2010, 03:55:53 PM »

I have three USB flash drives (all PNY Mini-Attaches; one 16GB, one 8GB, and one 4GB) used as dedicated storage for my PCLinuxOS local repository. If I mount the 8GB first, it is recognized as "/media/disk". Then, if I mount the 4GB second, it is recognized as "/media/disk-1". The 16GB is different, however; when mounted, whether alone or with the other flash drives, it is always recognized as "/media/.22.0-16pcl".

Is there a way I can change how the 16GB drive is recognized, so that mounted first it would be "/media/disk" ... then the other drives "/media/disk-1", "/media/disk-2"? What command-line application would be best to use, without wiping the flash drive's contents clean in the process? "The Linux Command Line" by William E. Shotts offers no hints on how this can be done.

I have experimented with the 4GB and have given it the volume label, "tertiary", by doing this:

Code: [Select]
[root@localhost rg]# mlabel -i /dev/sdb1 ::tertiary

Code: [Select]
[root@localhost rg]# blkid
/dev/sda1: UUID="22889cd7-d67d-4466-b1d1-b9a8875f339c" TYPE="ext4"
/dev/sda5: UUID="1e60af4d-cf7b-4553-a065-b99912d43d2d" TYPE="swap"
/dev/sda6: UUID="88081151-11cb-46bd-b2d3-d96833653c6d" TYPE="ext4"
/dev/sdb1: LABEL="TERTIARY" UUID="775C-7856" TYPE="vfat"

Changing the volume label has no effect on the 4GB being recognized as "/media/disk". Maybe what I want to do with the 16GB is something associated with partitioning the flash drive. Some "guru" guidance would be appreciated.

This topic fits into the "I just want to know" category. The 16GB drive works fine, no usage problems whatsoever.
« Last Edit: October 03, 2010, 08:59:15 AM by rg »

Online Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11589
  • ----IOFLU----
Re: Changing How USB Flash Drive Is Recognized
« Reply #1 on: October 02, 2010, 04:45:29 PM »


I have three USB flash drives (all PNY Mini-Attaches; one 16GB, one 8GB, and one 4GB) used as dedicated storage for my PCLinuxOS local repository. If I mount the 8GB first, it is recognized as "/media/disk". Then, if I mount the 4GB second, it is recognized as "/media/disk-1". The 16GB is different, however; when mounted, whether alone or with the other flash drives, it is always recognized as "/media/.22.0-16pcl".

Is there a way I can change how the 16GB drive is recognized, so that mounted first it would be "/media/disk" ... then the other drives "/media/disk-1", "/media/disk-2"? What command-line application would be best to use, without wiping the flash drive's contents clean in the process? "The Linux Command Line" by William E. Shotts offers no hints on how this can be done.

I have experimented with the 4GB and have given it the volume label, "tertiary", by doing this:

Code: [Select]
[root@localhost rg]# mlabel -i /dev/sdb1 ::tertiary

Code: [Select]
[root@localhost rg]# blkid
/dev/sda1: UUID="22889cd7-d67d-4466-b1d1-b9a8875f339c" TYPE="ext4"
/dev/sda5: UUID="1e60af4d-cf7b-4553-a065-b99912d43d2d" TYPE="swap"
/dev/sda6: UUID="88081151-11cb-46bd-b2d3-d96833653c6d" TYPE="ext4"
/dev/sdb1: LABEL="TERTIARY" UUID="775C-7856" TYPE="vfat"

Changing the volume label has no effect on the 4GB being recognized as "/media/disk". Maybe what I want to do with the 16GB is something associated with partitioning the flash drive. Some "guru" guidance would be appreciated.

This topic fits into the "I just want to know" category. The 16GB drive works fine, no usage problems whatsoever.


I label all my partitions, whether USB or internal, and list them in my /etc/fstab so they always mount at the same mount point directory, of my choosing. All you need is an actual directory of the correct name at the location specified. Those are all created as root, except the ones in my home directory.

[root@littleboy ~]# cat /etc/fstab
Code: [Select]
# Entry for /dev/sdc14 :
LABEL=minime2010        /                       ext4    defaults,noatime                1 1
LABEL=TR5-Documents     /home/polack/Documents  ext3    rw,user,noauto,exec,noatime     0 0
LABEL=Documents2        /home/polack/Documents2 ext3    rw,user,noauto,exec,noatime     0 0
LABEL=share7            /share7                 ext3    rw,user,auto,exec,noatime       0 0
LABEL=share9            /share9                 ext3    rw,user,auto,exec,noatime       0 0
LABEL=movies            /movies                 ext3    rw,user,auto,exec,noatime       0 0
LABEL=movies2           /movies2                ext3    rw,user,auto,exec,noatime       0 0
LABEL=TV-1              /tv                     ext3    rw,user,auto,exec,noatime       0 0
LABEL=storage00         /zstorage00             ext3    rw,user,noauto,exec,noatime     0 0
LABEL=120backup         /zbackup                ext3    rw,user,noauto,exec,noatime     0 0
LABEL=boot200           /mnt/boot               ext3    rw,user,noauto,exec,noatime     0 0
none                    /proc                   proc    defaults                        0 0
# Entry for /dev/sda2 :
LABEL=swap200           swap                    swap    sw,pri=3                        0 0
# Entry for /dev/sdc2 :
LABEL=swap1000          swap                    swap    sw,pri=3                        0 0
# Entry for /dev/sde2 :
LABEL=swap750           swap                    swap    sw,pri=3                        0 0
none                    /dev/pts                devpts  mode=0620                       0 0
/dev/fd0                /mnt/floppy             auto    rw,user,noauto,exec             0 0
/dev/sr0                /mnt/cdrom              auto    ro,user,noauto                  0 0
/dev/sr1                /mnt/dvd                auto    ro,user,noauto                  0 0
# none                  /dev/shm                tmpfs   defaults                        0 0

Note that none mount in /media, which is entirely bare.

[root@littleboy ~]# ls -l /media
total 0   

[root@littleboy ~]# blkid
Code: [Select]
                                                                                                                                   
/dev/sda1: LABEL="boot200" UUID="6e33d09e-b09d-49da-bae7-c7a40a0b6671" TYPE="ext3" SEC_TYPE="ext2"                                                           
/dev/sda5: LABEL="TV-1" UUID="2be4fddf-f783-4449-bf36-2dff451c9ab9" TYPE="ext3"                                                                             
/dev/sdc14: LABEL="minime2010" UUID="ab32e99a-5bb8-4360-b75d-e13df5412608" TYPE="ext4"                                                                       
/dev/sda2: LABEL="swap200" UUID="63298e54-0115-44cc-bd22-16ded462cffb" TYPE="swap"                                                                           
/dev/sda3: LABEL="TR5-2" UUID="3b7d8a95-2144-431c-ae9e-935a9e40b5f1" SEC_TYPE="ext2" TYPE="ext3"                                                             
/dev/sdb1: LABEL="usb_boot" UUID="77ad8b9e-39cf-4ff6-88e4-6c4fe1cd33f9" SEC_TYPE="ext2" TYPE="ext3"                                                         
/dev/sdb2: LABEL="swap160" UUID="b69ed243-1225-4fc2-be9f-6637c9108391" TYPE="swap"                                                                           
/dev/sdb3: LABEL="usb_root" UUID="3d637e7e-0844-4edb-a85e-d5a9e45fd8cf" SEC_TYPE="ext2" TYPE="ext3"                                                         
/dev/sdb5: LABEL="usb_home" UUID="d4df1799-91e0-4946-9bd7-526ea1989f8f" SEC_TYPE="ext2" TYPE="ext3"                                                         
/dev/sdb6: LABEL="share7" UUID="ff1937e8-f0ba-4a33-a544-ddfb3fd7a269" TYPE="ext3"
/dev/sdb7: LABEL="minime160" UUID="33fde9f7-aec2-44cc-8ae4-c32749414220" SEC_TYPE="ext2" TYPE="ext3"
/dev/sdc1: LABEL="boot1000" UUID="10165aee-8b41-4c52-aa7e-c6b0d6d17eeb" SEC_TYPE="ext2" TYPE="ext3"
/dev/sdc2: LABEL="swap1000" UUID="8b44f813-fd45-4f94-b519-28300b4791ad" TYPE="swap"
/dev/sdc3: LABEL="TR5" UUID="6ae6cf37-7fd2-4b9c-86dc-f037141745bb" SEC_TYPE="ext2" TYPE="ext3"
/dev/sdc5: LABEL="TR5-Documents" UUID="9c1bbdf4-5f3c-4d70-b03a-983504da6c15" TYPE="ext3"
/dev/sdc6: LABEL="tmpback" UUID="dcf02721-aca8-494f-8182-cc8ab1df8430" SEC_TYPE="ext2" TYPE="ext3"
/dev/sdc7: LABEL="TR6" UUID="36feb97d-2f61-4709-b6f5-8e8d8fee3370" SEC_TYPE="ext2" TYPE="ext3"
/dev/sdc8: LABEL="fullmonty" UUID="872d45ed-de83-4e97-88a8-a4c9e48b96c2" TYPE="ext4"
/dev/sdc9: LABEL="mmbuild" UUID="003077db-2988-4dcf-9baa-58e1798a4a85" SEC_TYPE="ext2" TYPE="ext3"
/dev/sdc10: LABEL="st-backup" UUID="7b1f293e-8deb-49de-adbf-db9173fd2599" SEC_TYPE="ext2" TYPE="ext3"
/dev/sdc11: LABEL="os-backups" UUID="3d1692bb-afe0-4648-b5be-d30f1eca32e7" SEC_TYPE="ext2" TYPE="ext3"
/dev/sdc12: LABEL="movies2" UUID="fad35a11-5738-401e-88b6-56b78dfeb15a" TYPE="ext3" SEC_TYPE="ext2"
/dev/sdc13: LABEL="openbox" UUID="98eedd96-8d4a-4098-aa53-c57f0333ed89" TYPE="ext4"
/dev/sdc15: LABEL="kde2010" UUID="f5b15060-9731-4dd8-9250-3d347b883295" TYPE="ext4"
/dev/sdc16: LABEL="gnome-07" UUID="1940cfcb-a101-46b1-b3ec-ed4b0550836c" TYPE="ext4"
/dev/sdc17: LABEL="test17" UUID="5319bdcb-b9eb-48e3-9033-a21549f1477c" TYPE="ext4"
/dev/sdd1: LABEL="750boot" UUID="985efd35-13a4-4279-8129-0f9552d95ccb" TYPE="ext3" SEC_TYPE="ext2"
/dev/sdd2: LABEL="swap750" UUID="0ccd09b0-ebb4-4f78-8c73-632232adf438" TYPE="swap"
/dev/sdd3: LABEL="750pclos" UUID="ace4498d-cd4b-458b-9b0c-853c0679fe70" SEC_TYPE="ext2" TYPE="ext3"
/dev/sdd5: LABEL="Documents2" UUID="d9550e51-e2e6-4b48-b382-d491ab0bc1ea" TYPE="ext3" SEC_TYPE="ext2"
/dev/sdd6: LABEL="share9" UUID="3abe7220-57d1-40c8-acb3-b8d13585577f" TYPE="ext3"
/dev/sdd7: LABEL="Documents" UUID="6c984560-d3bc-4ea9-b2ad-62586c662bcf" SEC_TYPE="ext2" TYPE="ext3"
/dev/sdd8: LABEL="750mm" UUID="b512d57e-3c7a-4226-96ea-98ba93d5d486" SEC_TYPE="ext2" TYPE="ext3"
/dev/sdd9: LABEL="movies" UUID="90ae3f6a-46b2-485a-886d-e4c203491907" TYPE="ext3"
/dev/sdd10: LABEL="120backup" UUID="3dff9abc-88c0-47dc-bd2c-f3f991acab69" SEC_TYPE="ext2" TYPE="ext3"
/dev/sdd11: LABEL="storage00" UUID="f0320f20-48d5-4ddb-89ed-9da4676aefa4" SEC_TYPE="ext2" TYPE="ext3"
                                                                                                                                                   
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

skyhawk

  • Guest
Re: [SOLVED] Changing How USB Flash Drive Is Recognized
« Reply #2 on: October 03, 2010, 09:02:11 AM »
Thanks for the reply and the solution. I am waiting for the massive tome to be published, entitled "How to Do Everything Linux" by Old-Polack.