Make sure the device you want to label is not mounted!
TL;DR version:
Make sure you know which /dev/sdX1 your USB device is. No tips on how to determine that, read the long version if unsure, you could create a data loss at worst case scenario when you try it on a wrong device!
Use this command as root, as example I use /dev/sdd1 - the label I want to give is "FUJICA":
Code: Select all
mlabel ::FUJICA -i /dev/sdd1
Code: Select all
Total number of sectors (62325760) not a multiple of sectors per track (63)!
Add mtools_skip_check=1 to your .mtoolsrc file to skip this test
Code: Select all
root@porteus:/some/path# cd
root@porteus:~# echo mtools_skip_check=1 >.mtoolsrc
Code: Select all
root@porteus:~# mlabel ::FUJICA -i /dev/sdd1
root@porteus:~#
Your DE file browser now should the updated label.
__________________________________________
Long Version:
Example: the partition is /dev/sdd1
● 1. ● Either check as root your /var/log/messages when you plug in the device what drive name gets reported.
In my case:
Code: Select all
Dec 26 18:50:12 porteus mtp-probe: checking bus 2, device 27: "/sys/devices/pci0
000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1.3"
Dec 26 18:50:12 porteus mtp-probe: bus: 2, device: 27 was not an MTP device
Dec 25 21:59:32 porteus kernel: usb 2-1.1.2: new high-speed USB device number 28 using ehci-pci
Dec 25 21:59:32 porteus kernel: usb 2-1.1.2: New USB device found, idVendor=05e3, idProduct=0727, bcdDevice= 2.07
Dec 25 21:59:32 porteus kernel: usb 2-1.1.2: New USB device strings: Mfr=3, Product=4, SerialNumber=2
Dec 25 21:59:32 porteus kernel: usb 2-1.1.2: Product: USB Storage
Dec 25 21:59:32 porteus kernel: usb 2-1.1.2: Manufacturer: Generic
Dec 25 21:59:32 porteus kernel: usb 2-1.1.2: SerialNumber: 000000000207
Dec 25 21:59:32 porteus kernel: usb-storage 2-1.1.2:1.0: USB Mass Storage device detected
Dec 25 21:59:32 porteus kernel: scsi host8: usb-storage 2-1.1.2:1.0
Dec 26 18:51:06 porteus mtp-probe: checking bus 2, device 28: "/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1.2"
Dec 26 18:51:06 porteus mtp-probe: bus: 2, device: 28 was not an MTP device
Dec 25 21:59:33 porteus kernel: scsi 8:0:0:0: Direct-Access Generic STORAGE DEVICE 0207 PQ: 0 ANSI: 0
Dec 25 21:59:33 porteus kernel: sd 8:0:0:0: [sdd] 62333952 512-byte logical blocks: (31.9 GB/29.7 GiB)
Dec 25 21:59:33 porteus kernel: sd 8:0:0:0: [sdd] Write Protect is off
Dec 25 21:59:33 porteus kernel: sdd: sdd1
Dec 25 21:59:33 porteus kernel: sd 8:0:0:0: [sdd] Attached SCSI removable disk
● 2. ● And / or check previously as root via fdisk -l /dev/sdd
In my case fdisk reports this:
Code: Select all
Disk /dev/sdd: 29.72 GiB, 31914983424 bytes, 62333952 sectors
Disk model: STORAGE DEVICE
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000
Device Boot Start End Sectors Size Id Type
/dev/sdd1 8192 62333951 62325760 29.7G c W95 FAT32 (LBA)
The drive is called generic STORAGE DEVICE since it is a MicroSDHC card accessed via a USB card reader.
The almost 32 GB is what I expected, so my recently present drive is indeed the microSDHC card at /dev/sdd1
● 3. ● You can also just mount the drive via your DE file browser and let the browser tell you where it is mounted. When it is mounted at /mnt/sdd1 then /dev/sdd1 is the device.
When it is mounted elsewhere use the df command to get to know what device is the one of the just mounted folder via your DE file browser.
Cave! df shows lots of less helpful stuff - the command name means "disk free" - so showing squashfs (all mounted modules) is usually not something you would be interested in since all of these always have 0 byte free. That is the reason I usually always use my dx command instead of df itself:
Code: Select all
root@porteus:~# type dx
dx is a function
dx ()
{
echo $(date +%d.%m.%Y\ %H:%M:%S) ____________________________________________________________;
/bin/df -Tm $* | grep -vE 'tmpfs|/mnt/live/run|squashfs'
}
Cave! Umount the vfat USB device prior executing the command to label the partition!
Then we go on just like in the TL;DR above:
Use this command as root, as example I use /dev/sdd1 - the label I want to give is "FUJICA":
Code: Select all
mlabel ::FUJICA -i /dev/sdd1
Code: Select all
Total number of sectors (62325760) not a multiple of sectors per track (63)!
Add mtools_skip_check=1 to your .mtoolsrc file to skip this test
Code: Select all
root@porteus:/some/path# cd
root@porteus:~# echo mtools_skip_check=1 >.mtoolsrc
Code: Select all
root@porteus:~# mlabel ::FUJICA -i /dev/sdd1
root@porteus:~#
Code: Select all
mtools_skip_check=1
Finished!
Your DE file browser now should the updated label.