The basic problem is that in the GUI shows a directory name with no space but when I cd to it in the terminal, the directory name has a space in it. What would cause the names to be different?

The full story is:

I have been trying to backup my computer to a WD hard drive that I was previously using when I used Windows. When I initially mounted the hard drive it named itself "My Book". I changed the name of the mounted file to MyBook through GParted as explained on Ubuntu Wiki. I also reformatted the hard drive file system to ext3. I navigated to the media directory where it is now mounted, and the directory name was still "My Book". So I changed the name from the command line with (also according to the instructions on Ubuntu Wiki). The directory name still has a space in the terminal but not in the GUI.

I am using Ubuntu 14.04.

More info:

I ran the 2 commands requested by mikeserv.

~>$ lsblk -f

├─sda1                     /
└─sda5                     [SWAP]
└─sdb1                     /media/cynthia/MyBook
sr1    udf    WD SmartWare /media/cynthia/WD SmartWare

~>$ findmnt

TARGET                        SOURCE                           FSTYPE   OPTIONS
/                             /dev/disk/by-uuid/1871174a-d18f-4f97-921c-428a917e4851
                                                               ext4     rw,relat
├─/sys                        sysfs                            sysfs    rw,nosui
│ ├─/sys/fs/cgroup                                             tmpfs    rw,relat
│ │ └─/sys/fs/cgroup/systemd  systemd                          cgroup   rw,nosui
│ ├─/sys/fs/fuse/connections                                   fusectl  rw,relat
│ ├─/sys/kernel/debug                                          debugfs  rw,relat
│ ├─/sys/kernel/security                                       security rw,relat
│ └─/sys/fs/pstore                                             pstore   rw,relat
├─/proc                       proc                             proc     rw,nosui
│ └─/proc/sys/fs/binfmt_misc  binfmt_misc                      binfmt_m rw,nosui
├─/dev                        udev                             devtmpfs rw,relat
│ └─/dev/pts                  devpts                           devpts   rw,nosui
├─/run                        tmpfs                            tmpfs    rw,nosui
│ ├─/run/lock                                                  tmpfs    rw,nosui
│ ├─/run/shm                                                   tmpfs    rw,nosui
│ └─/run/user                                                  tmpfs    rw,nosui
│   └─/run/user/1000/gvfs     gvfsd-fuse                       fuse.gvf rw,nosui
├─/media/cynthia/WD SmartWare /dev/sr1                         udf      ro,nosui
└─/media/cynthia/MyBook       /dev/sdb1                        ext3     rw,nosui
  • 2
    Which filesystem is this? NTFS? Can you do the following two commands in the terminal and paste their output into the question please?: lsblk -f; findmnt – mikeserv Aug 19 '14 at 11:32
  • please give us more data.... – PersianGulf Aug 19 '14 at 12:05

If you are using a GPT partition table, there are two labels involved and different filemanagers may show either label:

Partition Label

parted /dev/sdb name 1 MyBook

will rename the first partition on /dev/sdb to MyBook.

Filesystem Label

e2label /dev/sdb1 MyBook

will rename the filesystem label on ext2/3/4 installed on /dev/sdb1. Different utilites are needed for other filesystems.

MSDOS partition tables only have filesystem labels though.

  • GPT partitions have names, but old-style PC partitions don't. – Gilles Aug 19 '14 at 22:32
  • I received this error when I entered the parted /dev/sdb name 1 MyBook command. Error: msdos disk labels do not support partition names. – MimiBambino Aug 21 '14 at 7:45
  • As Giles mentions in the comment above, MSDOS partition tables do not support labels. The lsblk output you added to your post suggests it's a MSDOS table, which explains why you won't be able to add/change the partition name with the parted. – garethTheRed Aug 21 '14 at 8:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.