How do I change the “label” reported by lsblk? [duplicate]












3
















This question already has an answer here:




  • How do I rename a USB drive?

    4 answers




I have a USB stick that once-upon-a-time contained Ubuntu installation media. I have repurposed the device, but the original label has stuck despite my efforts to change it.



lsblk -o label reports that the name is Ubuntu 16.10 amd64 (from prior use). lsblk reports this same label for each of its 4 new partitions, and this label shows up as a mountpoint each time I insert the disk. This is confusing from many perspectives.



I have tried the following, unsuccessfully:




  • changing partition names using parted

  • re-partitioning

  • new disk label (gpt)

  • new UUIDs for disk and partitions

  • different computers.


Where is this "label" coming from, and how do I change it?










share|improve this question















marked as duplicate by George Udosen, Zanna, karel, Kulfy, Charles Green Dec 21 '18 at 14:31


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
















  • With new UEFI systems using gpt there are two labels. Label & partlabel. Label is part of file system and partlabel is part of gpt's data on partition. I try to remember to change when creating partitions with gparted. Otherwise I use Disks (about only thing Disks is good for). to see both: lsblk -f -o +partlabel In disks you can use the gears icon to select edit of labels.

    – oldfred
    Dec 21 '18 at 15:23
















3
















This question already has an answer here:




  • How do I rename a USB drive?

    4 answers




I have a USB stick that once-upon-a-time contained Ubuntu installation media. I have repurposed the device, but the original label has stuck despite my efforts to change it.



lsblk -o label reports that the name is Ubuntu 16.10 amd64 (from prior use). lsblk reports this same label for each of its 4 new partitions, and this label shows up as a mountpoint each time I insert the disk. This is confusing from many perspectives.



I have tried the following, unsuccessfully:




  • changing partition names using parted

  • re-partitioning

  • new disk label (gpt)

  • new UUIDs for disk and partitions

  • different computers.


Where is this "label" coming from, and how do I change it?










share|improve this question















marked as duplicate by George Udosen, Zanna, karel, Kulfy, Charles Green Dec 21 '18 at 14:31


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
















  • With new UEFI systems using gpt there are two labels. Label & partlabel. Label is part of file system and partlabel is part of gpt's data on partition. I try to remember to change when creating partitions with gparted. Otherwise I use Disks (about only thing Disks is good for). to see both: lsblk -f -o +partlabel In disks you can use the gears icon to select edit of labels.

    – oldfred
    Dec 21 '18 at 15:23














3












3








3









This question already has an answer here:




  • How do I rename a USB drive?

    4 answers




I have a USB stick that once-upon-a-time contained Ubuntu installation media. I have repurposed the device, but the original label has stuck despite my efforts to change it.



lsblk -o label reports that the name is Ubuntu 16.10 amd64 (from prior use). lsblk reports this same label for each of its 4 new partitions, and this label shows up as a mountpoint each time I insert the disk. This is confusing from many perspectives.



I have tried the following, unsuccessfully:




  • changing partition names using parted

  • re-partitioning

  • new disk label (gpt)

  • new UUIDs for disk and partitions

  • different computers.


Where is this "label" coming from, and how do I change it?










share|improve this question

















This question already has an answer here:




  • How do I rename a USB drive?

    4 answers




I have a USB stick that once-upon-a-time contained Ubuntu installation media. I have repurposed the device, but the original label has stuck despite my efforts to change it.



lsblk -o label reports that the name is Ubuntu 16.10 amd64 (from prior use). lsblk reports this same label for each of its 4 new partitions, and this label shows up as a mountpoint each time I insert the disk. This is confusing from many perspectives.



I have tried the following, unsuccessfully:




  • changing partition names using parted

  • re-partitioning

  • new disk label (gpt)

  • new UUIDs for disk and partitions

  • different computers.


Where is this "label" coming from, and how do I change it?





This question already has an answer here:




  • How do I rename a USB drive?

    4 answers








partitioning usb-drive






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 21 '18 at 12:24









Zanna

50.4k13133241




50.4k13133241










asked Dec 21 '18 at 11:12









JeQFBuJeQFBu

161




161




marked as duplicate by George Udosen, Zanna, karel, Kulfy, Charles Green Dec 21 '18 at 14:31


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






marked as duplicate by George Udosen, Zanna, karel, Kulfy, Charles Green Dec 21 '18 at 14:31


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.















  • With new UEFI systems using gpt there are two labels. Label & partlabel. Label is part of file system and partlabel is part of gpt's data on partition. I try to remember to change when creating partitions with gparted. Otherwise I use Disks (about only thing Disks is good for). to see both: lsblk -f -o +partlabel In disks you can use the gears icon to select edit of labels.

    – oldfred
    Dec 21 '18 at 15:23



















  • With new UEFI systems using gpt there are two labels. Label & partlabel. Label is part of file system and partlabel is part of gpt's data on partition. I try to remember to change when creating partitions with gparted. Otherwise I use Disks (about only thing Disks is good for). to see both: lsblk -f -o +partlabel In disks you can use the gears icon to select edit of labels.

    – oldfred
    Dec 21 '18 at 15:23

















With new UEFI systems using gpt there are two labels. Label & partlabel. Label is part of file system and partlabel is part of gpt's data on partition. I try to remember to change when creating partitions with gparted. Otherwise I use Disks (about only thing Disks is good for). to see both: lsblk -f -o +partlabel In disks you can use the gears icon to select edit of labels.

– oldfred
Dec 21 '18 at 15:23





With new UEFI systems using gpt there are two labels. Label & partlabel. Label is part of file system and partlabel is part of gpt's data on partition. I try to remember to change when creating partitions with gparted. Otherwise I use Disks (about only thing Disks is good for). to see both: lsblk -f -o +partlabel In disks you can use the gears icon to select edit of labels.

– oldfred
Dec 21 '18 at 15:23










2 Answers
2






active

oldest

votes


















6














Since the label is a property of the filesystem there are individual ways to set the label for different file systems.



for ext2/ext3/ext4 filesystems you use:



e2label /dev/XXX <label>


for btrfs:



btrfs filesystem label /dev/XXX <label>


for reiserfs:



reiserfstune -l <label> /dev/XXX


for jfs:



jfs_tune -L <label> /dev/XXX


for xfs:



xfs_admin -L <label> /dev/XXX


for fat/vfat (using dosfstools):



fatlabel /dev/XXX <label> 


OR (using mtools):



mlabel -i /dev/XXX ::<label>


for exfat:



exfatlabel /dev/XXX <label>


for ntfs:



ntfslabel /dev/XXX <label>


for swap:



swaplabel -L <label> /dev/XXX


source: https://wiki.archlinux.org/index.php/persistent_block_device_naming#by-label






share|improve this answer



















  • 1





    Welcome to Ask Ubuntu! :-) Excellent first answer! +1 Please do take the tour to familiarize yourself with how this site works as it's something like the star in the middle of this... ;-)

    – Fabby
    Dec 21 '18 at 14:02





















6














The easy way is to start gparted and in the top right go to /dev/XdYand select the disk you want to edit:



enter image description here



The options are:





  1. right-click the partition you want to rename and click Label file system



    Then type the name you want the partition to have and press OK



    Repeat for the other partitions.



    Click the little green check-mark, applying all operations




If that would fail, take option 2:



This will destroy everything on the USB stick!





  1. Go to the menu Device - Create Partition Table - msdos



    This will wipe everything from the USB stick including the partitions with their silly names.




Note¹: If you would want to do this from the command line the hard way, use parted instead of gparted. ;-)
Note²: For an unmounted USB stick, that's all you need, but if you do this on a mounted internal disk, better use gparted live






share|improve this answer





















  • 2





    ... or fairly easy via the command line with tune2fs for ext2/ext3/ext4 file systems. (+1 by the way)

    – sudodus
    Dec 21 '18 at 13:58




















2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









6














Since the label is a property of the filesystem there are individual ways to set the label for different file systems.



for ext2/ext3/ext4 filesystems you use:



e2label /dev/XXX <label>


for btrfs:



btrfs filesystem label /dev/XXX <label>


for reiserfs:



reiserfstune -l <label> /dev/XXX


for jfs:



jfs_tune -L <label> /dev/XXX


for xfs:



xfs_admin -L <label> /dev/XXX


for fat/vfat (using dosfstools):



fatlabel /dev/XXX <label> 


OR (using mtools):



mlabel -i /dev/XXX ::<label>


for exfat:



exfatlabel /dev/XXX <label>


for ntfs:



ntfslabel /dev/XXX <label>


for swap:



swaplabel -L <label> /dev/XXX


source: https://wiki.archlinux.org/index.php/persistent_block_device_naming#by-label






share|improve this answer



















  • 1





    Welcome to Ask Ubuntu! :-) Excellent first answer! +1 Please do take the tour to familiarize yourself with how this site works as it's something like the star in the middle of this... ;-)

    – Fabby
    Dec 21 '18 at 14:02


















6














Since the label is a property of the filesystem there are individual ways to set the label for different file systems.



for ext2/ext3/ext4 filesystems you use:



e2label /dev/XXX <label>


for btrfs:



btrfs filesystem label /dev/XXX <label>


for reiserfs:



reiserfstune -l <label> /dev/XXX


for jfs:



jfs_tune -L <label> /dev/XXX


for xfs:



xfs_admin -L <label> /dev/XXX


for fat/vfat (using dosfstools):



fatlabel /dev/XXX <label> 


OR (using mtools):



mlabel -i /dev/XXX ::<label>


for exfat:



exfatlabel /dev/XXX <label>


for ntfs:



ntfslabel /dev/XXX <label>


for swap:



swaplabel -L <label> /dev/XXX


source: https://wiki.archlinux.org/index.php/persistent_block_device_naming#by-label






share|improve this answer



















  • 1





    Welcome to Ask Ubuntu! :-) Excellent first answer! +1 Please do take the tour to familiarize yourself with how this site works as it's something like the star in the middle of this... ;-)

    – Fabby
    Dec 21 '18 at 14:02
















6












6








6







Since the label is a property of the filesystem there are individual ways to set the label for different file systems.



for ext2/ext3/ext4 filesystems you use:



e2label /dev/XXX <label>


for btrfs:



btrfs filesystem label /dev/XXX <label>


for reiserfs:



reiserfstune -l <label> /dev/XXX


for jfs:



jfs_tune -L <label> /dev/XXX


for xfs:



xfs_admin -L <label> /dev/XXX


for fat/vfat (using dosfstools):



fatlabel /dev/XXX <label> 


OR (using mtools):



mlabel -i /dev/XXX ::<label>


for exfat:



exfatlabel /dev/XXX <label>


for ntfs:



ntfslabel /dev/XXX <label>


for swap:



swaplabel -L <label> /dev/XXX


source: https://wiki.archlinux.org/index.php/persistent_block_device_naming#by-label






share|improve this answer













Since the label is a property of the filesystem there are individual ways to set the label for different file systems.



for ext2/ext3/ext4 filesystems you use:



e2label /dev/XXX <label>


for btrfs:



btrfs filesystem label /dev/XXX <label>


for reiserfs:



reiserfstune -l <label> /dev/XXX


for jfs:



jfs_tune -L <label> /dev/XXX


for xfs:



xfs_admin -L <label> /dev/XXX


for fat/vfat (using dosfstools):



fatlabel /dev/XXX <label> 


OR (using mtools):



mlabel -i /dev/XXX ::<label>


for exfat:



exfatlabel /dev/XXX <label>


for ntfs:



ntfslabel /dev/XXX <label>


for swap:



swaplabel -L <label> /dev/XXX


source: https://wiki.archlinux.org/index.php/persistent_block_device_naming#by-label







share|improve this answer












share|improve this answer



share|improve this answer










answered Dec 21 '18 at 13:42









qwertzqwertz

612




612








  • 1





    Welcome to Ask Ubuntu! :-) Excellent first answer! +1 Please do take the tour to familiarize yourself with how this site works as it's something like the star in the middle of this... ;-)

    – Fabby
    Dec 21 '18 at 14:02
















  • 1





    Welcome to Ask Ubuntu! :-) Excellent first answer! +1 Please do take the tour to familiarize yourself with how this site works as it's something like the star in the middle of this... ;-)

    – Fabby
    Dec 21 '18 at 14:02










1




1





Welcome to Ask Ubuntu! :-) Excellent first answer! +1 Please do take the tour to familiarize yourself with how this site works as it's something like the star in the middle of this... ;-)

– Fabby
Dec 21 '18 at 14:02







Welcome to Ask Ubuntu! :-) Excellent first answer! +1 Please do take the tour to familiarize yourself with how this site works as it's something like the star in the middle of this... ;-)

– Fabby
Dec 21 '18 at 14:02















6














The easy way is to start gparted and in the top right go to /dev/XdYand select the disk you want to edit:



enter image description here



The options are:





  1. right-click the partition you want to rename and click Label file system



    Then type the name you want the partition to have and press OK



    Repeat for the other partitions.



    Click the little green check-mark, applying all operations




If that would fail, take option 2:



This will destroy everything on the USB stick!





  1. Go to the menu Device - Create Partition Table - msdos



    This will wipe everything from the USB stick including the partitions with their silly names.




Note¹: If you would want to do this from the command line the hard way, use parted instead of gparted. ;-)
Note²: For an unmounted USB stick, that's all you need, but if you do this on a mounted internal disk, better use gparted live






share|improve this answer





















  • 2





    ... or fairly easy via the command line with tune2fs for ext2/ext3/ext4 file systems. (+1 by the way)

    – sudodus
    Dec 21 '18 at 13:58


















6














The easy way is to start gparted and in the top right go to /dev/XdYand select the disk you want to edit:



enter image description here



The options are:





  1. right-click the partition you want to rename and click Label file system



    Then type the name you want the partition to have and press OK



    Repeat for the other partitions.



    Click the little green check-mark, applying all operations




If that would fail, take option 2:



This will destroy everything on the USB stick!





  1. Go to the menu Device - Create Partition Table - msdos



    This will wipe everything from the USB stick including the partitions with their silly names.




Note¹: If you would want to do this from the command line the hard way, use parted instead of gparted. ;-)
Note²: For an unmounted USB stick, that's all you need, but if you do this on a mounted internal disk, better use gparted live






share|improve this answer





















  • 2





    ... or fairly easy via the command line with tune2fs for ext2/ext3/ext4 file systems. (+1 by the way)

    – sudodus
    Dec 21 '18 at 13:58
















6












6








6







The easy way is to start gparted and in the top right go to /dev/XdYand select the disk you want to edit:



enter image description here



The options are:





  1. right-click the partition you want to rename and click Label file system



    Then type the name you want the partition to have and press OK



    Repeat for the other partitions.



    Click the little green check-mark, applying all operations




If that would fail, take option 2:



This will destroy everything on the USB stick!





  1. Go to the menu Device - Create Partition Table - msdos



    This will wipe everything from the USB stick including the partitions with their silly names.




Note¹: If you would want to do this from the command line the hard way, use parted instead of gparted. ;-)
Note²: For an unmounted USB stick, that's all you need, but if you do this on a mounted internal disk, better use gparted live






share|improve this answer















The easy way is to start gparted and in the top right go to /dev/XdYand select the disk you want to edit:



enter image description here



The options are:





  1. right-click the partition you want to rename and click Label file system



    Then type the name you want the partition to have and press OK



    Repeat for the other partitions.



    Click the little green check-mark, applying all operations




If that would fail, take option 2:



This will destroy everything on the USB stick!





  1. Go to the menu Device - Create Partition Table - msdos



    This will wipe everything from the USB stick including the partitions with their silly names.




Note¹: If you would want to do this from the command line the hard way, use parted instead of gparted. ;-)
Note²: For an unmounted USB stick, that's all you need, but if you do this on a mounted internal disk, better use gparted live







share|improve this answer














share|improve this answer



share|improve this answer








edited Dec 21 '18 at 16:11

























answered Dec 21 '18 at 11:31









FabbyFabby

26.6k1360159




26.6k1360159








  • 2





    ... or fairly easy via the command line with tune2fs for ext2/ext3/ext4 file systems. (+1 by the way)

    – sudodus
    Dec 21 '18 at 13:58
















  • 2





    ... or fairly easy via the command line with tune2fs for ext2/ext3/ext4 file systems. (+1 by the way)

    – sudodus
    Dec 21 '18 at 13:58










2




2





... or fairly easy via the command line with tune2fs for ext2/ext3/ext4 file systems. (+1 by the way)

– sudodus
Dec 21 '18 at 13:58







... or fairly easy via the command line with tune2fs for ext2/ext3/ext4 file systems. (+1 by the way)

– sudodus
Dec 21 '18 at 13:58