Is there a way to change the name of a device? [SOLVED]

Message
Author
relztrah
Posts: 14
Joined: Wed Feb 19, 2020 9:58 pm

Is there a way to change the name of a device? [SOLVED]

#1 Post by relztrah »

This is not a USB flash drive.


Image

How do I change the name? Thanks in advance.

Code: Select all

System:
  Kernel: 6.1.0-32-amd64 [6.1.129-1] arch: x86_64 bits: 64 compiler: gcc v: 12.2.0
    parameters: BOOT_IMAGE=/boot/vmlinuz-6.1.0-32-amd64 root=UUID=<filter> ro quiet splash
  Desktop: Xfce v: 4.20.0 tk: Gtk v: 3.24.38 info: xfce4-panel wm: xfwm v: 4.20.0 vt: 7
    dm: LightDM v: 1.32.0 Distro: MX-23.5_x64 Libretto September 15  2024 base: Debian GNU/Linux 12
    (bookworm)
Machine:
  Type: Laptop System: ASUSTeK product: T100TA v: 1.0 serial: <superuser required>
  Mobo: ASUSTeK model: T100TA v: 1.0 serial: <superuser required> UEFI: American Megatrends
    v: T100TA.304 date: 03/14/2014
Battery:
  ID-1: BATC charge: 29.1 Wh (89.3%) condition: 32.6/30.6 Wh (106.5%) volts: 4.0 min: 3.8
    model: Intel SR 1 SR Real Battery type: Li-ion serial: <filter> status: discharging cycles: 22
CPU:
  Info: model: Intel Atom Z3740 bits: 64 type: MCP arch: Silvermont level: v2 built: 2013-15
    process: Intel 22nm family: 6 model-id: 0x37 (55) stepping: 3 microcode: 0x31E
  Topology: cpus: 1x cores: 4 smt: <unsupported> cache: L1: 224 KiB desc: d-4x24 KiB; i-4x32 KiB
    L2: 2 MiB desc: 2x1024 KiB
  Speed (MHz): avg: 652 high: 767 min/max: 533/1866 scaling: driver: intel_cpufreq
    governor: ondemand cores: 1: 703 2: 767 3: 607 4: 533 bogomips: 10666
  Flags: ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Vulnerabilities:
  Type: gather_data_sampling status: Not affected
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Vulnerable: Clear CPU buffers attempted, no microcode; SMT disabled
  Type: meltdown mitigation: PTI
  Type: mmio_stale_data status: Unknown: No mitigations
  Type: reg_file_data_sampling status: Not affected
  Type: retbleed status: Not affected
  Type: spec_rstack_overflow status: Not affected
  Type: spec_store_bypass status: Not affected
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2 mitigation: Retpolines; STIBP: disabled; RSB filling; PBRSB-eIBRS: Not
    affected; BHI: Not affected
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: Intel Atom Processor Z36xxx/Z37xxx Series Graphics & Display vendor: ASUSTeK
    driver: i915 v: kernel arch: Gen-7 process: Intel 22nm built: 2012-13 ports: active: DSI-1
    empty: DP-1,HDMI-A-1 bus-ID: 00:02.0 chip-ID: 8086:0f31 class-ID: 0300
  Display: x11 server: X.Org v: 1.21.1.7 compositor: xfwm v: 4.20.0 driver: X:
    loaded: modesetting unloaded: fbdev,vesa dri: crocus gpu: i915 display-ID: :0.0 screens: 1
  Screen-1: 0 s-res: 1368x768 s-dpi: 96 s-size: 362x204mm (14.25x8.03") s-diag: 416mm (16.36")
  Monitor-1: DSI-1 res: 1368x768 hz: 60 size: N/A modes: 1368x768
  API: OpenGL v: 4.2 Mesa 22.3.6 renderer: Mesa Intel HD Graphics (BYT) direct-render: Yes
Audio:
  Message: No device data found.
  API: ALSA v: k6.1.0-32-amd64 status: kernel-api tools: alsamixer,amixer
  Server-1: PipeWire v: 1.0.0 status: active with: 1: pipewire-pulse status: active
    2: wireplumber status: active 3: pipewire-alsa type: plugin 4: pw-jack type: plugin
    tools: pactl,pw-cat,pw-cli,wpctl
Network:
  Message: No PCI device data found.
  IF-ID-1: wlan0 state: up mac: <filter>
Drives:
  Local Storage: total: 61.93 GiB used: 11.98 GiB (19.3%)
  ID-1: /dev/mmcblk1 maj-min: 179:0 vendor: SK Hynix model: HCG8e size: 58.25 GiB block-size:
    physical: 512 B logical: 512 B type: SSD serial: <filter> rev: 0x6 scheme: GPT
  SMART Message: Unknown smartctl error. Unable to generate data.
  ID-2: /dev/mmcblk2 maj-min: 179:768 vendor: Toshiba model: SA04G size: 3.68 GiB block-size:
    physical: 512 B logical: 512 B type: SSD serial: <filter> scheme: MBR
  SMART Message: Unknown smartctl error. Unable to generate data.
Partition:
  ID-1: / raw-size: 58 GiB size: 56.79 GiB (97.91%) used: 11.98 GiB (21.1%) fs: ext4
    dev: /dev/mmcblk1p2 maj-min: 179:2
  ID-2: /boot/efi raw-size: 256 MiB size: 252 MiB (98.46%) used: 314 KiB (0.1%) fs: vfat
    dev: /dev/mmcblk1p1 maj-min: 179:1
Swap:
  Kernel: swappiness: 15 (default 60) cache-pressure: 100 (default)
  ID-1: swap-1 type: file size: 1024 MiB used: 143 MiB (14.0%) priority: -2 file: /swap/swap
Sensors:
  System Temperatures: cpu: 6280.4 C mobo: N/A
  Fan Speeds (RPM): cpu: 0
Repos:
  Packages: pm: dpkg pkgs: 2162 libs: 1074 tools: apt,apt-get,aptitude,nala,synaptic pm: rpm
    pkgs: 0 pm: flatpak pkgs: 0
  No active apt repos in: /etc/apt/sources.list
  Active apt repos in: /etc/apt/sources.list.d/brave-browser-release.list
    1: deb [arch=amd64 signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main
  Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list
    1: deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
  Active apt repos in: /etc/apt/sources.list.d/debian.list
    1: deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
    2: deb http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
  Active apt repos in: /etc/apt/sources.list.d/mx.list
    1: deb http://ftp.osuosl.org/pub/mxlinux/mx/repo/ bookworm main non-free
  Active apt repos in: /etc/apt/sources.list.d/spotify.list
    1: deb http://repository.spotify.com stable non-free
Info:
  Processes: 236 Uptime: 43m wakeups: 1 Memory: 1.81 GiB used: 1.29 GiB (71.4%) Init: SysVinit
  v: 3.06 runlevel: 5 default: graphical tool: systemctl Compilers: gcc: 12.2.0 alt: 12
  Client: shell wrapper v: 5.2.15-release inxi: 3.3.26
Boot Mode: UEFI
Last edited by relztrah on Sun Apr 27, 2025 3:15 am, edited 1 time in total.

User avatar
gimcrack
Posts: 296
Joined: Fri Dec 02, 2011 5:17 pm

Re: Is there a way to change the name of a device?

#2 Post by gimcrack »

Yes, it's possible to change the name of a mounted device in Linux. You can do this by unmounting the device, renaming the mount point directory, and then mounting the device to the new directory. If the device is part of a system configuration, you might need to update the relevant configuration files, like /etc/fstab, as well.
Here's a more detailed breakdown:

1. Unmount the device: Use the umount command to unmount the device from its current mount point.
2. Rename the mount point directory: Use the mv command to rename the directory where the device was previously mounted.
3. Mount the device to the new directory: Use the mount command to mount the device to the newly renamed directory.
4. Update configuration files (if necessary): If the device is part of a system configuration, you may need to update files like /etc/fstab to reflect the new mount point.
5. Consider changing partition labels: You can also use tools like GParted or Disks to change the label of the partition itself, which can affect how it's identified by the system.

Example:
Let's say you have a device mounted at /media/old_name and you want to change it to /media/new_name.
# Unmount the device
sudo umount /media/old_name

# Rename the mount point directory
sudo mv /media/old_name /media/new_name

# Mount the device to the new directory
sudo mount /dev/sdX /media/new_name # Replace /dev/sdX with the actual device name

# (Optional) Update /etc/fstab
sudo nano /etc/fstab
# Make sure the mount point in the fstab file is changed to /media/new_name
# Save and close the file

# (Optional) Update partition label using GParted or Disks

Important Notes:

• sudo: Many of these commands require root privileges, so you'll need to use sudo before them.
• Device name: Replace /dev/sdX in the mount command with the actual device name (e.g., /dev/sda1, /dev/sdb, etc.).
• fstab: Be very careful when editing /etc/fstab. Make a backup before making changes and double-check your syntax.
• GUI tools: You can also use GUI tools like GParted or Disks to perform some of these actions, such as renaming the partition and changing mount options.

User avatar
fehlix
Developer
Posts: 12704
Joined: Wed Apr 11, 2018 5:09 pm

Re: Is there a way to change the name of a device?

#3 Post by fehlix »

relztrah wrote: Wed Apr 23, 2025 3:27 am This is not a USB flash drive.
Maybe tell us what it is?
relztrah wrote: Wed Apr 23, 2025 3:27 am How do I change the name? Thanks in advance.
The name is taken from the filesystem label of the partition on the device.
So simply re-label might help:
Either with Gaprted or on command line.
e.g in case of ext4 filesystem you could do it this way:
Display the current label with

Code: Select all

sudo e2label LABEL="USB-DATA"
assign a new label with

Code: Select all

sudo e2label LABEL="USB-DATA" "NewLabel"
Incase of FAT or NTFS, better try with Gparted.
+++EDIT+++
Adjusted the example with the label shown in the picture.

Post Reply

Return to “Hardware /Configuration”