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.
In order to access my 2nd partition via Samba I have to first mount the partition manually and then type in the root password. After that I need to navigate to it and run the command "setsebool -P samba_export_all_rw on". THEN I can read/write to it on Samba.
I would like to make it so CentOS automatically mounts my 2nd partition. The partition name is /media/496GB_Filesystem
you can have this file system automatically mounted by adding a line to your /etc/fstab. You should probably store the samba password in a credentials file.
You only need the "setsebool -P..." once. the -P option directs it to make existing configuration flags persistent across boots.
Oh yes you are correct, I thought I had to do this on startup because (and I noticed now) that my Samba share command had -P on it but for my FTP it didnt, it just had the setseboll command. Alright so basically I need to write somethig on the fstab document? I just want it to simply mount on startup like the main partition does, how do I do this?
Okay, although I'm a bit confused. I need an IP in order to mount it? And then I don't understand the end part either, sorry I am a little new when it comes to commands.
You indicate in your initial post that you want to mount your "2nd partition". Why are you using Samba? Samba is for networking different computers. If the partition is on the same drive and computer you just need to create a mount point for it and mount it. If it is an ntfs partition you can use the search function here at LQ which will show you numerous examples of entries in fstab for a windows partition.
If this isn't the case, same computer/same drive then explain what you are doing.
You indicate in your initial post that you want to mount your "2nd partition". Why are you using Samba? Samba is for networking different computers. If the partition is on the same drive and computer you just need to create a mount point for it and mount it. If it is an ntfs partition you can use the search function here at LQ which will show you numerous examples of entries in fstab for a windows partition.
If this isn't the case, same computer/same drive then explain what you are doing.
I thought I was clear in OP but I shall restate again . So basically I want to be able to access my 2nd partition (which I use to backup my main PC) through Samba (meaning on my main windows PC, clicking "Network" and connecting to the CentOS Server). I can already do this except everytime at boot up on the CentOS computer I need to mount the 2nd partition manually. I just want a way to have CentOS to mount the 2nd partition automatically on bootip. If you still do not understand just forget about the whole Samba thing and just focus on "making CentOS mount a second partition on bootup.
Alright I did it and I had a [FAILED] error on bootup saying that the partition was read-only (I set one of my accounts as the owner is this maybe why?). It then said I couldnt mount it as read-only.
Can you post what you actually put in your /etc/fstab? That might help to debug. What happens when you try to do "mount /media/496GB_Filesystem" from the command line?
Sorry for the super late reply. Here is what I put in my fstab file between the first partition and then the swap. (I have 3 partitions total, two 495GB partitions and 8gb for swap).
UUID=UUIDHERE /dev/sda2 ext4
defaults 0 0
I forgot to mention this but centos requires that the root password be inputted when trying to mount any type of partition. This means that the partitWRT54Gion needs to somehow be mounted as root. I rebooted my centos box and I got an error on the login page saying that only the root could mount /dev/sda2 and that so it was only mounted as read only, the partition does not show up in the file browser and I also can't navigate to it.
I need fstab to mount the partition as root it seems.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.