References:
Procedure:
For these examples, assume the kernel assigns /dev/sdb to the device.
To find out, do:
fdisk -l
If your distro automatically mounts temporary media, do:
cat /etc/mtab
to see what is mounted. Then unmount it with:
sudo umount /dev/sdb1
sudo umount /dev/sdb2
etc, for each partition that got mounted
For vfat, set the volume label using a MS Windows box properties dialogue or use mlabel from the mtools package
for linux, set the label using e2label
Note, MS Windows will write the label in all caps regardless of how you type it
If your OS doesn't automount, Make /etc/fstab entries:
LABEL=MYLABEL /media/some_dir vfat user,rw 0 0 (MS Windows)
LABEL=mylabel /media/some_other_dir ext2 user,rw 0 0 (Linux)
Make sure that /media/some_dir and /media/some_other_dir exist
If your OS auto mounts it will mount the thumb drive to the specified place regardless of what the device name or label is
If your OS auto mounts, Without the fstab entry, it will mount the thumb drive to /media/LABEL even though that directory doesn't exist, and will remove the directory upon unmounting
Perms differ between /media/some_dir when the drive is unmounted and when it is mounted so if you get a "Unauthorized" or some such error message, check that.
If your OS doesn't automount, you can mount without knowing the device name using:
mount LABEL=mylabel /mnt/some_dir
sudo apt-get -y install dosfstools
mkdosfs -F 32 /dev/sde1
To remove a partition:
fdisk /dev/sdb
Command (m for help): d
Selected partition 1
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1015, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1015, default 1015):
Using default value 1015
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): c
Changed system type of partition 1 to c (W95 FAT32 (LBA))
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.
![]() |
This site best viewed with a browser |
| Warning: This is a Debian centric site and MAY contain peanuts. | |
| Many thanks to Debra Lynn and Ian Murdock for making Debian possible | |
| First created Dec 14, 2008 ~ Last revised December 08, 2010 |