Изменить имя флешки linux

unixforum.org

Как можно изменить имя флешки то, которое показывается на раб.столе? Если поменять точку монтирования, то ничего не меняется. «Переход»-«Компьютер»-ПКМ-Переименовать — пишет, что данное действие не поддерживается драйвером. Есть ещё варианты?

nesk Сообщения: 2268 Статус: Линукссаксовец ОС: MS Windows XP Home SP3 Контактная информация:

Re: Имя флешки

Сообщение nesk » 11.04.2009 15:48

Внимание: У меня под рукой нет машины с Linux. Я не использую эту ОС. Ответы я даю либо по памяти, либо мне помогает гугл. Тщательно читайте маны по тем командам и конфигурационным файлам, которые я упоминаю.

Re: Имя флешки

Сообщение piter » 11.04.2009 15:54

Re: Имя флешки

Сообщение Slimy » 12.04.2009 19:01

Верно если отсутствует метка тогда по побъему. Если задать метку тома тогда отображаеться метка. В кедах так было в гноме не знаю. Так что вполне очевидно нужна утилитка меняющая метку тома.

Если уже ничего не помогает — прочти инструкцию.
sysinstall — гадость 🙂
ASUS A6q00Vm Pentium-M 1.7 GHz, 2Gb RAM, 160Gb HDD,
GeForce Go 7300 64Mb video

Re: Имя флешки

Сообщение t2a » 12.04.2009 23:38

«Как можно изменить имя флешки то, которое показывается на раб.столе?»

Вариант:
sysfs + udevinfo + udev

Описано в статье «Файловая система-призрак» (журнал Linux Format февраль 2009г. №2 (115), стр. 51)

Источник

How to edit label of USB drive?

How to edit label of USB drive easily without formatting it? I tried right clicking the device and go to the properties but cannot find anything to edit.

6 Answers 6

From Terminal

You have to use the mlabel command.

  • First type the mount command to find out the device location of you pen drive. Find the line which goes like “/dev/sdc1 on /media/disk …”.
  • This means the device sdc1 which is my pen drive is mounted on /media/disk.
  • Next unmount the device. sudo umount /media/disk
  • Next use this command. sudo mlabel -i /dev/sdc1 ::

If you get a message like:

Total number of sectors (7831520) not a multiple of sectors per track (63)! You can easily ignore the check by running this command:

echo mtools_skip_check=1 >> ~/.mtoolsrc

Try again and it should work.

  • The name of the USB should have changed. Unplug and Plug the pen drive back in and it will be mounted with the new label name.
Читайте также:  Can ipad run linux

The GUI way

  • For this you need the Gparted software. Install it if you don’t have it already.
  • Open the software as a super user, and select the pen drive from GParted>Devices>
  • Unmount the device if it hasn’t been, by right clicking on it.
  • After unmounting, right click on it and select “Label” and change it to whatever you want it to be. And then Apply it, by clicking the Edit>Apply All Operations.
  • Your pendrives label should be changed now.

Источник

RenameUSBDrive

This guide is primarily for external drives such as USB hard drives, USB flash drives, and flash memory cards. You can label internal disks, but to change their mount points, use MoveMountpointHowto which uses the file called Fstab. This guide covers editing partition labels (disk names) for FAT16/FAT32, NTFS, ext2/ext3, JFS, ReiserFS, and XFS filesystems.

IconsPage/tip.png

By default, external drives automatically mounted at /media/disk then /media/disk-1 and so on. This is not very helpful when trying to find the drive you are looking for, especially if you have multiple devices plugged in. Labeled devices that are automatically mounted will be mounted in the /media directory using their label as the mount point, /media/ . ex: /media/my_external .

IconsPage/warning.png

When choosing labels, be sure that the new mount point /media/ does not already exist since the directory will be created when the disk is mounted.

Using the Partition Editor

  1. Open the System >Administration menu and see if there's an entry for GParted (previously Partition Editor).
  2. If there is, launch it. If there isn't, install the "gparted" package and it should now appear in the menu. Enter your password when prompted.
  3. Disk drives are divided up into partitions. To find the partition you want to re-label, you first have to find the disk drive that contains it, using the drop-down menu in the upper right. It will show a device name like /dev/sdb and the drive's total size in parentheses. After selecting a drive, you will see a list of all partitions on that drive.
  4. If the partition is mounted (has a key icon next to it), right-click on the partition and select Unmount.
  5. With the key icon gone, right-click on the partition and select Label. If you can't select it, install the ntfsprogs package.
  6. Enter the new partition name and press Ok.
  7. The label change is now pending, but has not been completed. Press the Apply button near the top of the window. After confirming, it should say "All operations successfully completed". The drive now has a new label.

Using the Command line

  • For FAT16 and FAT32 partitions, use mlabel from the mtools package.
  • For NTFS partitions, use ntfslabel from the ntfs-3g package.
  • For ext2, ext3, or ext4 partitions, use e2label.
  • For JFS partitions, use jfs_tune.
  • For ReiserFS (v3) partitions, use reiserfstune.
  • For XFS partitions, use xfs_admin
Читайте также:  Linux на hdd 2gb

Identify your Partition

IconsPage/terminal.png

For help with the terminal, see UsingTheTerminal.

Plug in your USB device and list your partitions with:

You can also list your mounted devices and their descriptions with:

IconsPage/example.png

For the rest of this tutorial we will use the following:

  • = your device /dev/sdxy, ex: /dev/sdb1
  • = your desired (new) label, ex: my_external

Install the Labeling Program

Based on the package names listed above for each filesystem type, install the correct package for your partition:

sudo apt-get install mtools sudo apt-get install ntfsprogs sudo apt-get install e2fsprogs sudo apt-get install jfsutils sudo apt-get install reiserfsprogs sudo apt-get install xfsprogs

or install the appropriate package from Synaptic.

Unmount the Partition

Partitions generally need to be unmounted before you can fiddle with them, so unmount the partition of the device you want to change the label for:

If it was automounted, you can also unmount the drive by right clicking the desktop icon and clicking Unmount (or Eject in some cases).

Changing the Label

After you complete the appropriate porition for your filesystem, jump to the next section to verify the change.

Filesystems

FAT16 and FAT32

These filesystems are most often found on USB thumb drives, flash cards (like for a camera or cell phone), and older external USB hard drives.

Check the current label

Note that we're using the special "::" drive which allows us to specify the device descriptor on the command line; otherwise we'd have to edit ~/.mtoolsrc to assign a drive letter (see Option 2 under "Change the label").

Change the label

Option 1

After unmounting and checking the current label (above), use

sudo mlabel -i /dev/sdb1 ::my_external

Ignore the "Volume label is XYZ" output as this is the old label. Jump to the Verify the Change section below.

Option 2

For Ubuntu 8.10 and up, edit mtools.conf as sudo

drive p: file="/dev/sdb1" drive q: file="/dev/sdb2"

(note the underscore _ should be used, as spaces are not allowed)

Error message

If you get a message like this:

Total number of sectors (7831520) not a multiple of sectors per track (63)!

You can easily ignore the check by running this command:

echo mtools_skip_check=1 >> ~/.mtoolsrc

NTFS

This filesystem is most often found on external USB and firewire hard drives or other Windows formatted disks.

Check the current label

Change the label

Note: 128 characters maximum.

sudo ntfslabel /dev/sdb1 my_external

Ubuntu caches the drive's label so to see the full affects of the change it is not enough just to umount and mount it again. You have to umount, remove, put back, mount again.

ext2, ext3, and ext4

These filesystems are most often found on linux formatted drives.

Check the current label

Change the label

Note: 16 characters maximum.

sudo e2label /dev/sdb1 my_external

JFS

These filesystems are most often found on IBM and some linux formatted disks.

Check the current label

Change the label

Note: 16 characters maximum.

sudo jfs_tune -L my_external /dev/sdb1

ReiserFS (v3)

This filesystem is most often found on linux formatted disks.

Читайте также:  Linux определить размер папки

Note: this could work with ReiserFS 4 too, I have not tried.

Change the label

Note: 16 characters maximum.

sudo reiserfstune -l my_external /dev/sdb1

XFS

This filesystem is most often found on UNIX formatted disks.

Check the current label

Change the label

Note: 12 characters maximum.

xfs_admin -l my_external /dev/sdb1

Verify the Change

Now for the easiest part: unplug the drive, wait a second, then plug it back in. It should appear on your desktop with the new label and have its new mount point.

Without unplugging and having the device remount, you can also just run:

Other Resources

IconsPage/resources.png

Some other related material:

  • MoveMountpointHowto
  • LinuxFilesystemsExplained
  • Fstab
  • MountingWindowsPartitions

RenameUSBDrive (последним исправлял пользователь knome 2013-12-14 11:20:15)

The material on this wiki is available under a free license, see Copyright / License for details
You can contribute to this wiki, see Wiki Guide for details

Источник

How do I rename a USB drive?

How exactly would I rename a USB drive? I've read that you can go into the Disk Utility, click on Edit Partition, and there is an option to rename the label but I can't click in the area to rename. Is there any other way?

5 Answers 5

  1. Open "Disks" application
  2. Select the flash drive in the panel on the left
  3. Press the Unmount button (should look like a "stop button")
  4. Click on the gears icon ("More actions") and choose "Edit filesystem"

On Ubuntu 16.04 you find the unmount button on the right side panel, after you select your flash drive, below the list of volumes. It should look like a square (like a "stop button"), and when you click it it will change in a triangle (like a "play button"). To change the flash drive label click on the gears icon and then on "edit file system".

First, obtain the location of your USB drive:

Assuming that your device location is /dev/sdb1/ :

You can safely check the current label without any side effects by issuing the following command:

Most USB sticks are formatted using FAT16/FAT32. To change the label via the prompt, use the mlabel command. The label of a FAT filesystem requires to be exactely 11 characters. No more, no less. When characters are omitted, spaces are added at the beginning, and seemingly random characters are appended at the end.

Install the mtools package (GNU Tools for MSDOS filesystems):

sudo apt-get install mtools 

Then you might need to configure the mtools drives settings, hence add the following two lines to /etc/mtools.conf (you will need sudo to edit)

# second and third drives, first partition drive u: file="/dev/sdb1" drive v: file="/dev/sdc1" 

Having saved, you should then be able to look at your USB drive in (say) /dev/sdb1 as drive u:

(See comments . ) Then relabel:

sudo mlabel -i /dev/sdb1 -s ::"LABEL HERE " 

For other filesystems (rarely used for USB sticks), see this page.

Источник

Оцените статью
Adblock
detector