Change Name of External USB Drive

Questions about applications and software
Forum rules
Before you post please read this

Change Name of External USB Drive

Postby Uncle Tim on Thu Feb 28, 2013 6:58 am

It appears that Linux Mint doesn't allow changing the name of a USB-connected drive without formatting. This can be easily done in Windows with a right click. Mint "ghosts out" the "rename" option. I have gone into Properties and checked other ways but cannot find one. Am I missing the way to do this?

Thank you.
Last edited by Uncle Tim on Thu Feb 28, 2013 8:07 am, edited 1 time in total.
Linux Mint 17 Cinnamon. Linux enthusiast since spring 2012.
Uncle Tim
Level 2
Level 2
 
Posts: 53
Joined: Wed May 09, 2012 8:14 am
Location: Japan

Linux Mint is funded by ads and donations.
 

Re: Change Name of External USB Drive

Postby viking777 on Thu Feb 28, 2013 8:05 am

Sadly you don't tell us what the filesystem is on the drive so I can only guess, so I could be wrong. I will guess it is Fat32 as that is common for this sort of drive. So I will assume that you want to change a usb drive formatted fat32, known to the kernel as /dev/sdc1(another guess) and to call it myusbdrive (a third guess).

1)
Code: Select all
echo mtools_skip_check=1 >> ~/.mtoolsrc


2)
Code: Select all
sudo umount /dev/sdc1


3)
Code: Select all
sudo mlabel -i /dev/sdc1  ::myusbdrive


To check

4)
Code: Select all
sudo mlabel -i /dev/sdc1 -s ::
Fujitsu Lifebook AH532. Intel i5 processor, 6Gb ram, Intel HD3000 graphics, Intel Audio/wifi. Realtek RTL8111/8168B Ethernet.Lubuntu 13.10,Ubuntu12.10 (Unity), Mint16 (Cinnamon), Manjaro (Xfce).
Image
User avatar
viking777
Level 14
Level 14
 
Posts: 5153
Joined: Mon Dec 01, 2008 11:21 am

Re: Change Name of External USB Drive

Postby Uncle Tim on Thu Feb 28, 2013 8:13 am

I thought that it was FAT32. Under Properties the file system type is shown as "msdos."

Thank you.
Linux Mint 17 Cinnamon. Linux enthusiast since spring 2012.
Uncle Tim
Level 2
Level 2
 
Posts: 53
Joined: Wed May 09, 2012 8:14 am
Location: Japan

Re: Change Name of External USB Drive

Postby altair4 on Thu Feb 28, 2013 8:52 am

Install GParted:
Code: Select all
sudo apt-get install gparted

You need to logout and login again for it to show up in the Menu for some reason but you can launch it from the terminal:
Code: Select all
gksu gparted

Then unmount the device through gparted: Right Click > Unmount
Set the new label: Right Click > Label
Remount it
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 16
Level 16
 
Posts: 6029
Joined: Tue Feb 03, 2009 10:27 am

Re: Change Name of External USB Drive

Postby Uncle Tim on Thu Feb 28, 2013 9:55 am

I installed GParted. When I right click on the drive and click Unmount, a small window about a "libparted bug found" pops up, saying something is corrupt with a table, but the main is OK, so it will be used instead. I ciick OK, and GParted closes. (and the drive in question unmounts) That's as far as I can get with it.

Thank you.
Linux Mint 17 Cinnamon. Linux enthusiast since spring 2012.
Uncle Tim
Level 2
Level 2
 
Posts: 53
Joined: Wed May 09, 2012 8:14 am
Location: Japan

Re: Change Name of External USB Drive

Postby altair4 on Thu Feb 28, 2013 12:40 pm

Never, not once, did I ever have a problem with gparted so I've never received an error message. If the table it's referencing is the partition table that's another problem. You might want to plug the USB device in again and post the output of the following commands so people here can see what's up:
Code: Select all
sudo parted -l

Code: Select all
sudo blkid -c /dev/null

Code: Select all
sudo fdisk -l


You might also want to tell us what operating system you are using:

Mint main or LMDE?
Version 13, 14 ?
Cinnamon, MATE, XFCE, .. ?
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 16
Level 16
 
Posts: 6029
Joined: Tue Feb 03, 2009 10:27 am

Re: Change Name of External USB Drive

Postby viking777 on Thu Feb 28, 2013 2:28 pm

Tim, you are perfectly welcome to try Altair4's solution to this if you prefer it, but mtools as described above is equally capable of renaming msdos devices, in fact that is what it is designed for:

Mtools is a collection of tools to allow Unix systems to manipulate MS-DOS files


Did you try it? If so did it fail?
Fujitsu Lifebook AH532. Intel i5 processor, 6Gb ram, Intel HD3000 graphics, Intel Audio/wifi. Realtek RTL8111/8168B Ethernet.Lubuntu 13.10,Ubuntu12.10 (Unity), Mint16 (Cinnamon), Manjaro (Xfce).
Image
User avatar
viking777
Level 14
Level 14
 
Posts: 5153
Joined: Mon Dec 01, 2008 11:21 am

Re: Change Name of External USB Drive

Postby Uncle Tim on Fri Mar 01, 2013 7:25 am

Thank you both for your time and trouble. According to Software Manager, Mtools is installed; but where it is I cannot figure. It is not anywhere in the Menu.

Following altair4's suggestion, the Terrminal returns the following:

tim@tim-G31T-M ~ $ sudo parted -l
[sudo] password for tim:
Model: ATA Hitachi HDP72505 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number Start End Size Type File system Flags
1 1049kB 496GB 496GB primary ext4 boot
2 496GB 500GB 4282MB extended
5 496GB 500GB 4282MB logical linux-swap(v1)


Error: The backup GPT table is corrupt, but the primary appears OK, so that will
be used.
OK/Cancel? OK
Model: I-O DATA HDCR-U (scsi)
Disk /dev/sdb: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number Start End Size File system Name Flags
1 20.5kB 1000GB 1000GB fat32 primary


tim@tim-G31T-M ~ $ sudo blkid -c /dev/null
/dev/sda1: UUID="bc05b019-d439-480d-bee9-73f599886f6f" TYPE="ext4"
/dev/sda5: UUID="a9c3e594-e67c-49dd-906a-fb54772b8f54" TYPE="swap"
/dev/sdb1: LABEL="IO DATA 1TB" UUID="5E62-7CAF" TYPE="vfat"
tim@tim-G31T-M ~ $ sudo fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00020639

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 968404991 484201472 83 Linux
/dev/sda2 968407038 976771071 4182017 5 Extended
/dev/sda5 968407040 976771071 4182016 82 Linux swap / Solaris

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdb1 1 1953525167 976762583+ ee GPT
tim@tim-G31T-M ~ $

*** end of that mess ***

Note the Error message about the GPT table being corrupt. That is the same message that GParted gave me.

This is not a big problem. The other day I simply wanted to change the name of the drive, and could not do so in my Linux system (Mint Main 14 Cinnamon). I then plugged the drive into my notebok with Windows 7 and easily did it. I then wondered what would I have done without Windows. Little things like that bug me :|

I look forward to the day when I do not have to rely on Windows to do something because Mint can't. That will be nice. :)

Thanks again.
Linux Mint 17 Cinnamon. Linux enthusiast since spring 2012.
Uncle Tim
Level 2
Level 2
 
Posts: 53
Joined: Wed May 09, 2012 8:14 am
Location: Japan

Re: Change Name of External USB Drive

Postby altair4 on Fri Mar 01, 2013 9:38 am

According to Software Manager, Mtools is installed; but where it is I cannot figure. It is not anywhere in the Menu.

mtools is a set of command line utilities, they have no gui, so they will not show up in the menu. They were meant to be used they way Viking777 described in his post. Will it work with partitions defined by GPT tables? I don't know - I've never tried. Viking777 no doubt knows however.

fdisk doesn't know how to handle GPT partition tables but ironically GParted does so I'm wondering what the extent of this corruption is that GParted fails on you. No doubt you have a lot of stuff on the disk so if it works then why try to "uncorrupt" it.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 16
Level 16
 
Posts: 6029
Joined: Tue Feb 03, 2009 10:27 am

Re: Change Name of External USB Drive

Postby viking777 on Fri Mar 01, 2013 12:29 pm

Actually I haven't tested mlabel with gpt partitioned disks so it might not work. One question springs to mind and that is why do you need a gpt partitioned disk on an external drive? It is not over 2 Tb so it doesn't need this and I don't really see how it benefits from it.

However if gpt is what you have or what you want then I have another solution for you - gdisk. It isn't installed by default, but it is the package manager, so install it and then run:

Code: Select all
sudo gdisk /dev/sdb


(Make sure your external disk is still called /dev/sdb first).

This will ask you for a command.

The command to change a partitions name is the letter c - so type that and press enter.
It will ask you which partition you want to rename - in this case you only have one so the answer is - 1 (in fact because you only have one partition it might not even ask you this).
It will then ask you to enter a name - your choice.
It will then ask you for another command. In order to proceed you press the letter w (for write) to quit you press the letter q. Nothing has been done until you press the letter w, all changes you have made are saved in memory until you press that key followed by enter.

But as you have already renamed your drive in windows you wont need to do this. But you can make a note of it for another time.
Fujitsu Lifebook AH532. Intel i5 processor, 6Gb ram, Intel HD3000 graphics, Intel Audio/wifi. Realtek RTL8111/8168B Ethernet.Lubuntu 13.10,Ubuntu12.10 (Unity), Mint16 (Cinnamon), Manjaro (Xfce).
Image
User avatar
viking777
Level 14
Level 14
 
Posts: 5153
Joined: Mon Dec 01, 2008 11:21 am

Re: Change Name of External USB Drive

Postby Uncle Tim on Fri Mar 01, 2013 4:13 pm

No, there is no need; I'm just thinking about the future. Anyway, I would really like to avoid using the Terminal and commands unless it's really vital and a last resort. Anyway, I've got to put this on the back burner for now. Thank you again for your time. I do appreciate it.
Linux Mint 17 Cinnamon. Linux enthusiast since spring 2012.
Uncle Tim
Level 2
Level 2
 
Posts: 53
Joined: Wed May 09, 2012 8:14 am
Location: Japan

Linux Mint is funded by ads and donations.
 

Return to Software & Applications

Who is online

Users browsing this forum: bulsatar, capivara, Panther353 and 16 guests