using Linux Mint KDE.
I have a ext 4 partition labled (Data). What line do I have to add to the fstab file to auto mount on startup ?
fstab file (solved)
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
fstab file (solved)
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: fstab file
A little bit more about automounting can be found here:
http://community.linuxmint.com/tutorial/view/1513
I've chosen an article where fstab is talked about in a more general way, not just automounting. Getting to know fstab will save you time later on when you want to add, for example, a network share, or an NTFS partition. Any questions, please ask!
http://community.linuxmint.com/tutorial/view/1513
I've chosen an article where fstab is talked about in a more general way, not just automounting. Getting to know fstab will save you time later on when you want to add, for example, a network share, or an NTFS partition. Any questions, please ask!
Re: fstab file
There's a couple of things wrong with that HowTo:
*** It's best to mount using UUID's ( or LABEL's ) to identify the partition not /dev/sdxy.
*** You really don't want to mount anything to /media/user/label - that's for system use.
My suggestion:
[1] Run the following command to find the UUID for your partition:
[2] Make a permanent mount point:
[3] Add the following line to the end of /etc/fstab:
Substitute the UUID you found in step [1].
[4] If you currently have the partition mounted unmount it.
[5] Then run this command to remount it which uses the new line in fstab:
*** It's best to mount using UUID's ( or LABEL's ) to identify the partition not /dev/sdxy.
*** You really don't want to mount anything to /media/user/label - that's for system use.
My suggestion:
[1] Run the following command to find the UUID for your partition:
Code: Select all
sudo blkid -c /dev/null
Code: Select all
sudo mkdir /media/Data
Code: Select all
UUID=076426af-cbc5-4966-8cd4-af0f5c879646 /media/Data ext4 defaults,noatime 0 2
[4] If you currently have the partition mounted unmount it.
[5] Then run this command to remount it which uses the new line in fstab:
Code: Select all
sudo mount -a
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
Re: fstab file
altair4
*** It's best to mount using UUID's ( or LABEL's ) to identify the partition not /dev/sdxy.
I use labels because they mean something when you see them.
*** You really don't want to mount anything to /media/user/label - that's for system use.
At first I was mounting data partitions to something like /DATA, /WINE, but it's better to put them under /mnt.
I run "finds" a lot and have a script that excludes /mnt, namely all non-system files.
I have a ext 4 partition labled (Data). What line do I have to add to the fstab file to auto mount on startup ?
FWIW: Partition label = "DATA" = mp3s, movies, pics, etc
$ sudo mkdir /mnt/DATA
$ sudo chown username /mnt/DATA
fstab line:
LABEL=DATA /mnt/DATA ext4 defaults 0 0
I made //mnt/DATA/music .../pics etc bookmarks in thunar, so one-click to navigate there, and made a couple of scripts to make it easy to "cd" there:
$ data download/mp3
then PWD = /mnt/DATA/download/mp3
*** It's best to mount using UUID's ( or LABEL's ) to identify the partition not /dev/sdxy.
I use labels because they mean something when you see them.
*** You really don't want to mount anything to /media/user/label - that's for system use.
At first I was mounting data partitions to something like /DATA, /WINE, but it's better to put them under /mnt.
I run "finds" a lot and have a script that excludes /mnt, namely all non-system files.
I have a ext 4 partition labled (Data). What line do I have to add to the fstab file to auto mount on startup ?
FWIW: Partition label = "DATA" = mp3s, movies, pics, etc
$ sudo mkdir /mnt/DATA
$ sudo chown username /mnt/DATA
fstab line:
LABEL=DATA /mnt/DATA ext4 defaults 0 0
I made //mnt/DATA/music .../pics etc bookmarks in thunar, so one-click to navigate there, and made a couple of scripts to make it easy to "cd" there:
$ data download/mp3
then PWD = /mnt/DATA/download/mp3
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
Your data and OS are backed up....right?
Re: fstab file Solved
fred0843 wrote:using Linux Mint KDE.
I have a ext 4 partition labled (Data). What line do I have to add to the fstab file to auto mount on startup ?
Re: fstab file (solved)
Thanks Guys
Re: fstab file
Depends on what you want it to do. On most DE's if you mount a partition under /home/$USER or /media it will produce a mount icon on the desktop and other places. This is what happens when the system mounts to /media/$USER/LABEL. If you mount it under /mnt or anywhere else it will not. It's up to the user.Flemur wrote: *** You really don't want to mount anything to /media/user/label - that's for system use.
At first I was mounting data partitions to something like /DATA, /WINE, but it's better to put them under /mnt.
I run "finds" a lot and have a script that excludes /mnt, namely all non-system files.
It's a pet peeve of mine and in this particular case it really doesn't matter since the ownership / permissions issue has already been resolved but if this was a newly formated partition or a partition where you wanted to change ownership / permissions your steps are backwards:I have a ext 4 partition labled (Data). What line do I have to add to the fstab file to auto mount on startup ?
FWIW: Partition label = "DATA" = mp3s, movies, pics, etc
$ sudo mkdir /mnt/DATA
$ sudo chown username /mnt/DATA
fstab line:
LABEL=DATA /mnt/DATA ext4 defaults 0 0
** create the mount point
** add the line in fstab
** mount the partition
** then and only then change ownership / permissions.
Partitions don't "inherit" the permissions from the mount point. It's the other way around. The permissions of the mount point are always overridden by the permissions that exist on the partition when mounted or in the case of ntfs explicitly defined in fstab.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
Re: fstab file
I disagree. There is no "best", they're two different ways. I also use UUID's in fstab but for normal mounting it's easier to use /dev/sdxy. Using the latter in fstab has no advantages and it takes a longer time, since you can't tell from heart what UUID /dev/sda3 is.altair4 wrote:There's a couple of things wrong with that HowTo:
*** It's best to mount using UUID's ( or LABEL's ) to identify the partition not /dev/sdxy.
*** You really don't want to mount anything to /media/user/label - that's for system use.
Also, blkid? why? You need root-acces for that.. Just use:
ls -la /dev/disk/by-uuid/
Re: fstab file (solved)
Just within the last 5 days or so there was a post where I observed the following:
The /media/$USER/Label mount point is self explanatory.
Once you are loged in if you want to do a temporary mount using sdxy that's fine but for automounting though fstab there really is a best way - actually two of them - UUID or LABEL. After all that's how your system partition is mounted.altair4 wrote:A modern PC has become so complex that sda, sdb, sdc have become relative terms since depending on temperature, humidity, and sunspot activity what the system sees as sda on one boot it may see as sdb the next. For example:
When you installed Linux the partition you installed it to was sda2:Now it's at sdc2:# / was on /dev/sda2 during installation
UUID=f33ddffe-bf98-4ad6-a3fa-f7ce0ed6a6f5 / ext4 errors=remount-ro 0 1That's why we all use UUID's today - although if you keep your wits about you LABEL can also be used./dev/sdc2: UUID="f33ddffe-bf98-4ad6-a3fa-f7ce0ed6a6f5" TYPE="ext4"
The /media/$USER/Label mount point is self explanatory.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.