LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-03-2016, 04:36 PM   #1
henrig
Member
 
Registered: Jan 2016
Location: UK
Distribution: Linux Mint
Posts: 44

Rep: Reputation: Disabled
Drive name changed!


I have one HDD which I've split up into various partitions, one for Linux Mint 17.3, one for storing my files and others...
The one I use for storing my file, I call it Data. I wanted to automount it at start-up and followed some instructions off the net which I can't find again unfortunately.

Now Data has changed to Data1. This is the path:
/media/hh/Data1
However, in file manager where I have Home, File System listed, it says Data and in Gparted, the label is still Data.
If just the name had changed, I wouldn't be bothered but now Dropbox isn't working and I had to fix my torrent client too.
I'd like to know how I can change the name back to Data. Just going to the file system and changing the name in there doesn't work.

Now that Mint 18 is coming out, I'm tempted to wipe my HDD clean and start afresh but I've got too much data stored on it and would take too long to do a backup of everything and move it back again.

Last edited by henrig; 07-03-2016 at 04:37 PM.
 
Old 07-03-2016, 06:03 PM   #2
tayfie
LQ Newbie
 
Registered: Jun 2016
Posts: 5

Rep: Reputation: 0
Quote:
Just going to the file system and changing the name in there doesn't work.
Can you be more specific? What happens when you do something like:
Code:
mv Data1 Data
Does the automounting work correctly when you first boot and change later, or is it incorrect from boot?
 
Old 07-03-2016, 06:37 PM   #3
sgosnell
Senior Member
 
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian Stable and Unstable
Posts: 1,943

Rep: Reputation: 538Reputation: 538Reputation: 538Reputation: 538Reputation: 538Reputation: 538
The disk label and the mount point are different things. In media/hh/ you may have two different directories - Data and Data1. With the data drive not mounted, remove the Data1 directory, and mount the drive. You may need to reboot.

Did those lost instructions on the internet involve editing /etc/fstab? Blindly following instructions on random websites can be dangerous. If you can post the contents of your /etc/fstab file we might be able to give better advice.
 
1 members found this post helpful.
Old 07-04-2016, 02:40 AM   #4
henrig
Member
 
Registered: Jan 2016
Location: UK
Distribution: Linux Mint
Posts: 44

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by tayfie View Post
Can you be more specific? What happens when you do something like:
Code:
mv Data1 Data
Does the automounting work correctly when you first boot and change later, or is it incorrect from boot?
Forgot to mention that the automount did not work and that I nearly broke my PC. It could not start because it could not find a program or file or path. Fortunately, I also had Salix installed, so I booted to that, then retrieved the file in Mint and undid the changes. Looks like I did not undo everything.
By going to the file system, I mean, in file manager, going to the hh folder and changing the name of Data1 there. I'm not sure what or how I did it before but now if the Data drive is not mounted, it doesn't appear there. There is just an empty Data folder. If Data1 is mounted, the rename option is disabled.

mv Data1 Data yields:
mv: cannot stat 'Data1': no such file or directory
I get this before and after mounting the Data drive.
 
Old 07-04-2016, 02:44 AM   #5
henrig
Member
 
Registered: Jan 2016
Location: UK
Distribution: Linux Mint
Posts: 44

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by sgosnell View Post
The disk label and the mount point are different things. In media/hh/ you may have two different directories - Data and Data1. With the data drive not mounted, remove the Data1 directory, and mount the drive. You may need to reboot.

Did those lost instructions on the internet involve editing /etc/fstab? Blindly following instructions on random websites can be dangerous. If you can post the contents of your /etc/fstab file we might be able to give better advice.
Only Data appears in media/hh until I mount Data1 and when this is mounted, the option to rename is disabled.

Yes, those instructions involved editing fstab. Here's the content of the file:


# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda2 during installation
UUID=c1d0916c-ba98-4aa0-b961-3e9f2997c126 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=c053ba08-5827-47f0-a09f-a4624d12146a none swap sw 0 0
 
Old 07-04-2016, 04:59 AM   #6
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 20 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924
Try unmounting the filesystem, renaming /media/hh/Data to something else, then mounting the system. I suspect that the system is auto mounting the filesystem in Data1 because the folder Data, whatever it is, already exists.
 
Old 07-04-2016, 02:11 PM   #7
sgosnell
Senior Member
 
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian Stable and Unstable
Posts: 1,943

Rep: Reputation: 538Reputation: 538Reputation: 538Reputation: 538Reputation: 538Reputation: 538
You're not mounting the drive in fstab. The only thing there is the root filesystem and swap. If you edited that file, there is no evidence of it. Remove all the directories under /media and see what happens. If it's not satisfactory, you may need to edit fstab. That's easy enough to do, and we can help you with that if you provide the correct information. The device name of the partition is essential, and is probably something like /dev/sda#, where the pound sign would be replaced by a number, whatever the number of the partition named Data might be. You can also use the UUID, which can be more robust, but we don't know what that is. Do some study of the mount command and the syntax of fstab, and it shouldn't be difficult.

Last edited by sgosnell; 07-04-2016 at 02:13 PM.
 
Old 07-04-2016, 03:19 PM   #8
henrig
Member
 
Registered: Jan 2016
Location: UK
Distribution: Linux Mint
Posts: 44

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by sgosnell View Post
You're not mounting the drive in fstab. The only thing there is the root filesystem and swap. If you edited that file, there is no evidence of it. Remove all the directories under /media and see what happens. If it's not satisfactory, you may need to edit fstab. That's easy enough to do, and we can help you with that if you provide the correct information. The device name of the partition is essential, and is probably something like /dev/sda#, where the pound sign would be replaced by a number, whatever the number of the partition named Data might be. You can also use the UUID, which can be more robust, but we don't know what that is. Do some study of the mount command and the syntax of fstab, and it shouldn't be difficult.
I cannot delete anything in /media or delete the data folder. The rename and delete options for both are greyed out.
I edited fstab but after it broke my PC, I undid the changes. But I probably didn't undo them properly or maybe the edited fstab file changed something else on my PC then.
I was never able to automount my drive.

sda4
uuid=24F0077CF0075388

I don't need to automount anything now, just get Data1 changed to Data.
 
Old 07-04-2016, 03:28 PM   #9
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 20 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924
Quote:
Originally Posted by henrig View Post
I cannot delete anything in /media or delete the data folder. The rename and delete options for both are greyed out.
I edited fstab but after it broke my PC, I undid the changes. But I probably didn't undo them properly or maybe the edited fstab file changed something else on my PC then.
I was never able to automount my drive.

sda4
uuid=24F0077CF0075388

I don't need to automount anything now, just get Data1 changed to Data.
You may need to have superuser permissions to delete the Data folder (or, safer, to rename it). Have you tried that?
 
Old 07-04-2016, 03:50 PM   #10
henrig
Member
 
Registered: Jan 2016
Location: UK
Distribution: Linux Mint
Posts: 44

Original Poster
Rep: Reputation: Disabled
Yesss. It worked! I renamed Data to Data2 in the CLI using superuser permissions. It worked. Then I mounted the Data drive and it mounted as Data. Data1 is now gone.
However, I'm now left with Data2.
It doesn't bother me, I'll just forget about it but why do I have 2 Data folders? Is it safe to delete Data2, which is empty by the way? How did a 2nd Data folder get created?
These just help me understand what happened, if you can answer them, but my problem is solved.
Thanks guys.
 
Old 07-04-2016, 04:12 PM   #11
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 20 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924
Quote:
Originally Posted by henrig View Post
Yesss. It worked! I renamed Data to Data2 in the CLI using superuser permissions. It worked. Then I mounted the Data drive and it mounted as Data. Data1 is now gone.
However, I'm now left with Data2.
It doesn't bother me, I'll just forget about it but why do I have 2 Data folders? Is it safe to delete Data2, which is empty by the way? How did a 2nd Data folder get created?
These just help me understand what happened, if you can answer them, but my problem is solved.
Thanks guys.
Great! Without knowing the specifics, I reckon that the operating system tries to auto mount the filesystem from the partition that is named Data.

It first tries to mount it in /media/hh/Data. If that folder already exists (or perhaps exists but is locked or otherwise inaccessible), it then tries to create a new folder called Data1 and mount it in that. Etc. etc...

This is a slight problem with leaving it to the operating system to auto mount filesystems on its own initiative. It's better, in my opinion, to specify in /etc/fstab exactly where you want your folders mounted. You have more control that way.

Anyway, at some point something appears to have gone wrong and /media/hh/Data was locked in some way so that the operating system couldn't mount your filesystem there.

If Data2 is truly empty (check it for hidden files), then you should be safe to delete it.

You should keep an eye on your system to ensure that this was a one-off.

P.S. If you so wish, you can mark the thread as "Solved". Yay!

Last edited by hydrurga; 07-04-2016 at 04:15 PM.
 
1 members found this post helpful.
Old 07-05-2016, 11:22 AM   #12
sgosnell
Senior Member
 
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian Stable and Unstable
Posts: 1,943

Rep: Reputation: 538Reputation: 538Reputation: 538Reputation: 538Reputation: 538Reputation: 538
Try this for the line in /etc/fstab:
Code:
LABEL=Data /media/Data ext4  users,owner,auto	0	0
Or you can replace the LABEL part with /dev/sda4, it's your choice. If you use the UUID, copy and paste the UUID string from blkid, or wherever you got it, to prevent typos. For these types of mounts, I tend to make a mountpoint somewhere else, either in my home directory or the root. It could be /Data, or /home/hh/Data,or wherever you want it to be. The primary goal is to have it someplace where it's easy for you to get to it and use it. I have an external HDD that mounts to a subdirectory in my home, because that's the easiest way for me. I don't have to muck around with permissions, etc, because it's my home. YMMV.

Last edited by sgosnell; 07-05-2016 at 11:29 AM.
 
1 members found this post helpful.
Old 07-06-2016, 05:04 AM   #13
henrig
Member
 
Registered: Jan 2016
Location: UK
Distribution: Linux Mint
Posts: 44

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by sgosnell View Post
Try this for the line in /etc/fstab:
Code:
LABEL=Data /media/Data ext4  users,owner,auto	0	0
Or you can replace the LABEL part with /dev/sda4, it's your choice. If you use the UUID, copy and paste the UUID string from blkid, or wherever you got it, to prevent typos. For these types of mounts, I tend to make a mountpoint somewhere else, either in my home directory or the root. It could be /Data, or /home/hh/Data,or wherever you want it to be. The primary goal is to have it someplace where it's easy for you to get to it and use it. I have an external HDD that mounts to a subdirectory in my home, because that's the easiest way for me. I don't have to muck around with permissions, etc, because it's my home. YMMV.
Tried that with UUID and it worked! Now my drive automounts and my PC didn't get broken in the process. Amazing powerful single line of code.
 
Old 07-06-2016, 01:47 PM   #14
sgosnell
Senior Member
 
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian Stable and Unstable
Posts: 1,943

Rep: Reputation: 538Reputation: 538Reputation: 538Reputation: 538Reputation: 538Reputation: 538
UUID and LABEL will both work fine. I prefer LABEL because it's almost always shorter and easier than UUID, which is a long string of random characters, thus less subject to typos. But that's a personal preference, and UUID certainly works.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mdadm cannot remove failed drive, drive name changed. touser Linux - Newbie 4 08-26-2012 07:39 PM
My hard drive has spontaneously changed is manufacturer Richie55 Linux - Hardware 2 10-03-2010 01:58 PM
Changed Motherboard, now have CD/DVD drive issues terry-duell Fedora 5 03-30-2010 05:11 AM
Maxtor Drive Capacity Maybe Changed? des_a Linux - Hardware 2 05-06-2008 12:46 PM
Drive Order changed: freaky crash alar Fedora 2 02-24-2007 07:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration