[Solved] Renaming an external hard drive

  • I've just added a hard drive to my Pi2 running LE 7.0.2 (via a USB-SATA interface, although it's built into the case). It's being detected and running fine, the only problem is it's being given a very long name. I'd like to change that to something more manageable/typeable, but I'm not sure how to go about it.

    When I set the drive up (partitioned as ext4 using Minitool Parition Wizard on my PC) I'm sure I gave it a more sensible name, but that doesn't seem to have transferred across. Are there any tools within LE (or that can be installed via add-on) which would allow the drive to be renamed to something more sensible?

    Edited once, last by DarrenHill (July 21, 2016 at 10:32 AM).

  • Get us the output via SSH if you can, of the following commands:

    Code
    blkid | pastebinit
    mount | pastebinit

    Renaming the label of a EXT4 partition is done via

    Code
    e2label /dev/sdX "name"

    where sdX is the device drive/partition you want to rename

  • OK, as requested:

    blkid
    mount

    The drive is /dev/sda5, so with the e2label command I've successfully renamed it to KodiHDD. It appears that way under the files list in videos, which is fine.

    It still appears in its old long name in /var/media if I look via ssh, but that's no problem.

    So all sorted, thanks for the help. e2label was what I was looking for.