[SOLVED] Why does my second drive always has to be "mounted" when starting Linux?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
from a command line to get some complicated instructions.
If you are a total newbie you should probably google for
"/etc/fstab" like I suggested and study what you find there.
I totally agree, ..."your knowledge base on Linux is really lacking". But I know from what I'm seeing, I got a long way to go. And Thanks for all the help and suggestions (reading time for sure).
I did find a way by using the "disk" function from the Accessories menu section:
In my case I selected the second drive - additional partition options - edit mount options. I already had Mount at system startup checked,why it did not mount I don't know. I decided to turn "off" Users Session Defaults. I then restarted (several times) the system and my second drive now always shows up on the desktop and working.
This may not be the overall correct way, but it works for me.
Again, thanks to all for the valuable inputs and I will be reading all the commands and suggestions made here. Thanks!
I actually do not know how you're getting your partiton, perhaps through automount so it shows up, but if that partiton is one you're going to use for your Linux system as say a data storage. I'd mount it in fstab. this is how I mount mine.
My Fstab
Code:
[userx@arcomeo MyTestDir]$ cat /etc/fstab
# /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>
UUID=2d6a4d00-106e-4402-91c4-329a1bbcee85 /media/data1 ext4 defaults,noatime,discard 0 2
UUID=98B63A6AB63A48D0 /media/ntfs1 ntfs defaults,noatime 0 2
UUID=c42aa97b-1daf-4694-97ee-068737cb1e53 / ext4 defaults,noatime,discard 0 1
UUID=275e8ce5-486f-426a-9595-bd36134f8346 /home ext4 defaults,noatime,discard 0 2
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0
where the mounts on /media are my seperate hdd and partitions on that drive. I put them in media because it is a default directory that the a gui file manager will look into and pick up whatever it mounted in it.
So this way I do not have to go through any extra navigation to get to them, I just open a file manager.
you get your UUIDs from running this command.
Code:
sudo blkid
it is this logic that needs to always be applied. Manually, or by a process that automates it.
source -> destination
device partition -> mount point
the fstab. https://help.ubuntu.com/community/Au...ountPartitions
<file system> <mount point> <type> <options> <dump> <pass>
are all covered in that article, link above. It's rather simple really, whence you get the hang of it, you'll see that.
BW-userx,",,,I actually do not know how you're getting your partiton" I don't know either. But I am doing my best to learn.
You showed me your fstab, here's mine
Fstab:
Code:
dave@Linux-Inspiron-620:~$ cat /etc/fstab
# /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/sda1 during installation
UUID=02c8db37-7684-494a-97fc-de88b08cad72 / ext4 errors=remount-ro 0 1
/swapfile none swap sw 0 0
/dev/disk/by-uuid/2558d769-f520-4dd2-b7dc-1e52e1c400a7 /mnt/2558d769-f520-4dd2-b7dc-1e52e1c400a7 auto nosuid,nodev,nofail,x-gvfs-show 0 0
dave@Linux-Inspiron-620:~$
/dev/sda1 is where my Linux is and /dev/sdb1 is my storage drive for misc stuff (books, notes on Linux, etc)
Hopefully, this will answer your question regarding my partitions setup. If you can give me some pointers, I would really appreciate it and thanks for your feedback.
open two terminals, in one,
(You can name your directory whatever you want, it does not have to be 'storage')
Code:
sudo mkdir -p /media/storage
sudo nano /etc/fstab
in fstab, move your cursor down below your fist UUID
starting on a new line, add
in your other terminal
Code:
sudo blkid
to get your UUID or use the one here in your post.
then just add the
Code:
UUID=2558d769-f520-4dd2-b7dc-1e52e1c400a7 /media/storage ext4 defaults 0 0
ctrl+x # to close and save, answer y then enter
sudo mount -a
if you made any screw ups it will tell you after you issued the mount -a(ll) command.
Make sure you do not have the "quote marks" in your fstab on your UUID.
To remove that last line using nano. Put your cursor on the left side of it then hit ^K
^=ctrl and k=k
ctrl+k
to cut that line out of there, before you save and exit nano.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.