Unmount the partition:
# umount /part
Rename the directory after making sure it's not mounted:
# mountpoint /part &>/dev/null || mv /part /best_name_ever
Edit
/etc/fstab
to replace/part
with/best_name_ever
Remount the partition:
mount /best_name_ever
The #
is of course meant to represent your root
prompt, not actual input to be typed in.
To test the safety of this solution or any other one on dummy data
The following instructions are (in part) stolen from Virtual Filesystem: Building A Linux Filesystem From An Ordinary File.
Create an ordinary file with a size of 20 MB (for example):
$ dd if=/dev/zero of=dummy_fs bs=1k count=20480 # 20480 = 20 * 1024
Create an
ext4
filesystem on your file:$ /sbin/mkfs -t ext4 dummy_fs mke2fs 1.42.5 (29-Jul-2012) dummy_fs is not a block special device. Proceed anyway? (y,n) y ... # Output of mkfs
Mount the filesystem image, create some dummy data on it and test the solution:
# mkdir /tmp/testmount # mount -o loop dummy_fs /tmp/testmount # touch /tmp/testmount/ # Create dummy data # ls /tmp/testmount blah bleh lost+found # umount /tmp/testmount # mountpoint /tmp/sexy_name &>/dev/null || mv /tmp/testmount /tmp/sexy_name # mount -o loop dummy_fs /tmp/sexy_name # ls /tmp/sexy_name # to ensure your data is intact: blah bleh lost+found
================================================================================== In GParted, Unmount it, and then you change the 'Label', which affects the given name and mount point. So if I changed this partition label to 'Data', it would have the label/name 'Data', and the mountpoint would become /media/wmobbs/Data
.
Labels work best without spaces, and any special characters.
I also could do it in command line: If that does not work, change these lines in your /etc/fstab
:
# /part was on /dev/sda7 during installation UUID=47e6e0b1-0e57-4184-a378-375b9ce315c5 /part ext4 defaults 0 2
to:
# /part was on /dev/sda7 during installation - mountpoint changed to /test UUID=47e6e0b1-0e57-4184-a378-375b9ce315c5 /test ext4 defaults 0 2
You can edit the file by running sudo nano /etc/fstab
, then applying the above changes, and saving with Ctrl+O.
You then need to run sudo mkdir /test
to create the needed folder - note that the folder needs to be empty.
You have to reboot for any changes to take effect