How to mount BTRFS volume at start up?

Ok, I have been trying to make this work for the last 2 weeks on and off
so far no luck despite many help posts found and tried.
I have an OpenSuse 13.1 64 bit server install with LXDE + Xen + Samba
boots from a BTRFS “/” 1TB disk BTRFS “/home” is on a second 1TB disk
I have a 2TB HDD with single BTRFS partition setup (/dev/sdc1) with mount point as (/DataStore1)
I also have 2x3TB HDD (/dev/sdd and /dev/sde ) that have multi-device BTRFS volume ,as DataStore2, setup on raw devices(no partitions predefined)
manually I can mount any of this just fine but I want to mount them on boot as my samba setup to share them. and it is not working.

#1. I am not sure if I mount them properly to begin with as I mount them in /media/dataStore###
#2. how can I make them auto-mount on boot? right now my shares are empty, showing me that I am not mounting the media as each of this volumes have test data on them. I do not get any errors when try to access them from my winPC but no data is there either.

I added them to fstub but it did nothing.

any suggestions are welcome

thank you.

Please show more computer evidence of what you are telling. Like fstab listings, partition tales and more you say you have, but you do not show.

BTW, it is not recommended to go for yourself and create mountpoints (and then use them for mountiing) in /media. It is for the system (more precise the desktop mounts). Use /mnt instead (or of course any other placve that might seem logical to you).

[quote=“hcvv,post:2,topic:99391”]
Please show more computer evidence of what you are telling. Like fstab listings, partition tales and more you say you have, but you do not show.
\QUOTE]

what evidence do you need? and on the same note why do I need to “show any evidence”? and evidence of what exactly ? I am not accusing anyone of anything. I am asking a question that I can not find a solution for.

I am giving a lot of information that should be enough to give a suggestion or at least
point me to the right direction. at the moment I do not have access to the machine to give a print out of fstab.

as for partition tables :
I have 5 HDD in the system. I originally planed to have a bootable BTRFS RAID1 configuration but it did not worked as I expected so scraped the plan
here is my hardware and partitioning :

SYSTEM DRIVES : split root"/" and “/home” partitions among 2 drives
sda - 1TB WD drive
|-> sda1 1TB BTRFS label <ROOT> mountpoint “/”

sdb - 1TB WD drive
|-> sdb1 1TB BTRFS label <HOME> mountpoint “/home”

sdc 2TB hitachi drive
|-> sdc1 2TB BTRFS label<DATA1> mountpoint “/DATASTORE1”

– this drives are setup from CLI as a BTRFS multidevice volume on raw devices no partitions defined, and appear empty from Yast/partitioner (Yast does not support multidevice BTRFS setup. single drive only). however “btrfs fi show” returns a 3TB BTRFS volume in RAID1 configration for Data and MetaData
sdd - 3TB WD drive
sde - 3TB WD drive

code used to setup the 3TB

 mkfs.btrfs  -m raid1 -d raid1 label MEDIA1  /dev/sdd /dev/sde 

this creates a single volume spread across 2 drives.

I have seen many examples where /media is used to create a mountpoints for drives that need to be mounted on startup by the system. I do not want to mount this manually I want to set it up and forget it untl I need to add more drives or such.

I thought that “/mnt” was used for temporary mounting of devices and/or file systems not for permanent mounts.
am I wrong in that assumptions?

I am building a file server / VM server
all data volumes, and the plan is to have at least 3 main data stores, will be shared via Samba to be accessible to any device on the network and any VM that needs it. (plan to build out a owncloud VM to share things over the Internet. maybe even use that as main share hub for everything.)

so I want to automount all data volumes that I plan to be shareable on start up so samba can find them and present it as shares.

can you suggest something constructive for this scenario?

To make a simple ecample. I do not tell a long story about my partitioning if I want it to be seen by forum members, I do:

boven:~ # fdisk -l

Disk /dev/sda: 320.1 GB, 320072933376 bytes, 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x1549f232

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1              63     4209029     2104483+  82  Linux swap / Solaris
/dev/sda2   *     4209030    46154744    20972857+  83  Linux
/dev/sda3        46154745   240974999    97410127+  83  Linux
/dev/sda4       240975000   625137344   192081172+   f  W95 Ext'd (LBA)
/dev/sda5       240975063   282920714    20972826   83  Linux
/dev/sda6       282920778   492633224   104856223+  83  Linux
boven:~ #

Including prompts, command and output. And then I can comment that I use /dev/sda2 for my root, etc., but I better show:

boven:~ # df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2        20G  5.3G   14G  29% /
devtmpfs        987M   40K  987M   1% /dev
tmpfs           999M  156K  999M   1% /dev/shm
tmpfs           999M  3.4M  996M   1% /run
tmpfs           999M     0  999M   0% /sys/fs/cgroup
tmpfs           999M  3.4M  996M   1% /var/run
tmpfs           999M  3.4M  996M   1% /var/lock
/dev/sda5        20G  5.3G   14G  29% /mnt/B                                                           
/dev/sda3        92G   52G   40G  57% /home
/dev/sda6        99G   68G   26G  73% /mnt/B/home
boven:~ #

For setting mounts do be done at boot there is /etc/fstab. You can edit that manualy, but you can also use YaST > System > Partitioning. That does much more then partitioning alone and in this case the partitioning is allready done, so you only have to tell there where you want it mounted (YaST will even create the mount point for you).

The story about /mnt being for “temporary” mounts is most probably because the mounts belonging to a system in it’s day to day functioning all have their places where the system/architect/manager/administrator thinks they belong (e.g. for /home or /database or /home/henk/music, or …). And the system administrator will then use /mnt during maintenance to temporary mounting file system that he is organising/copying/whatever.

But there is a tendency to mount partitions on mount points in /mnt and then, when needed, use symbolic links from e.g. /home/henk/music to the mount point.

/media is for what the end-user calls “media”. Cds, DVDs, USB sticks, memory cards. All those devices that ar not permanent part of the system, but are spontanious connected by the end-user where that end-user expects them to become available for usage on his desktop.
In some systems /media is even a tmpfs file system. That will clean it on a shutdown, which is good because sloppy media handling by end-users can leave old mount points there.

And seeing things done does not contradict the fact that it is not recommended (at least by me).

so if I understand your point correctly,

  1. I should not be using /media to mount my data stores.
  2. I can create folder in “/” for example “/MyDataStoreMounts”
    and mount all my storage there. and this is proffered method
  3. I have seen some examples using something like “/mnt/mymount”
    should I do this instead of #2?

as for [QUOTE] I do not tell a long story about my partitioning if I want it to be seen by forum members\QUOTE]
I do not have access to my server at the moment so I can not do fdisk or anything to provide the output from.

as for using “Yast/partitioner” as I already point out it does not work with BTRFS multidevice setup.
you can only work with single disk at a time. also it actually create a partition on the disk which at this time I am thinking is not a bad idea at all.
I may just do that. create a partition on one of the 3TB disks in yast with a mount point and all and then just expand it onto second drive via CLI.
it should setup auto-mount and all.

Indeed better not use /media.
What you see doing others all different here is showing the fact that it is the system manage that decides. The one is as good as the other (though I would not use a strange name like that one with all the Caps in it).
The idea behind mounting in Unix/Linux is that the user is not aware of it. Thus if /home is on a different disk (partition) or not does not matter. Same for /var or /tmp or /mnt/databases/byers-database or /home/<user>/Documents/thebookIamwriting or /srv/www.
It is normaly the same place as where you would put that data if it wasn’t on a separate partition.

Names like mymount only hints to me that the administrator there does not understand this. Who’ mount? Who is my? Unix/Linux is a multi-user system. The data is either for the system in general (for web-server, database, music/movies to be seen by all users, …) or it is to be owned by a particular user and thus most likely mounted inside his home directory. In the last case, it is of course his/hers, no need to name it my…
BTW in that last case, many prefer (attention: preference, no must) to mount in e.g. /mount/<user>music or /userdata/<usr>/music and then make a symbolic link from /home/<user>/music to it. More or less the same result.

Variations are endless. But one should understand the idea behind Unix/Linux mounting in the one directory tree (other systems have the concept of more directory trees, don’t let eralier experiences fool you).

Almost the only place you should not use is /media or something in it. It is there for a soecial purpose.


And we come back to your original problem. Can I compress your problem to:
I can mount it.
But I am not able to create an fstab entry to let that happen at boot.
When that is correct, we come back to my earlier complaint. When you say you can mount it, that is story telling. Showing which is the statment you use is computer facts. And we have to start from that statement to navigate to a working fstab entry.

We can realy not “guess” what you do. We have to see it to come as near as possible to the situation where we can look over your shoulder.

nice summary,

so to answer you :
when I say I can mount it, I mean
if I open file manger or dolphin
I see entries for the Datastore1(2TB drive)
and entry for 2 3TB drives (some how the manager knows that my BTRFS volume spans on both drives as I see both drives referred to by volume label(in this case MEDIA1))
if I click on any of the drivers it mounts and all data is visible to me at the time.
I can click on any of the 2 3TB drives and that mounts the full BTRFS volume span on them.
however a. it mounts as /user/uuid it is only visible from my session. can not share it. as it will unmount when I log out.

now if I run

 # mount  /dev/sdd  /media/DATASTORE2 

for example in terminal under root
(which what I have been using so far and this is the path I used in my SAMBA share config.) the share is available and shareable until next reboot.
I have added lines to fstab but they did not work.
however I have found a recent post on this board that might solve the issue for me. it is for network drives mount but I believe it points to whats wrong with my fstab entires. I think I screwed up the entry format. will try to fix and if it works will close this thread.

You do not add mount commands to your fstab. And the other entries there should have warned you that they are not mount commands.

Read

man fstab

The entry must be something like this:

/dev/sdd /media/DATASTORE2 btrfs defaults 1 2

Try this. It could be that we have to use other options then defaults, but this is a good starting point.

thanks,

I think I figured out what the problem was. I had fixed the fstab and it looks like the mount survived the reboot. I will test some more during this week when I have some free time.
I put mount by UUID in fstab (I know that you do not put mount command into fstab BTW).
what happened was I used wrong UUID, I used UUID for the hard drive instead of file system. need to be careful when copy/paste stuff all over the place.

On 2014-04-04 17:06, vl1969 wrote:
>
> hcvv;2634998 Wrote:
>> Please show more computer evidence of what you are telling. Like fstab
>> listings, partition tales and more you say you have, but you do not
>> show.
>
>
> what evidence do you need? and on the same note why do I need to “show
> any evidence”? and evidence of what exactly ? I am not accusing anyone
> of anything. I am asking a question that I can not find a solution for.

We are not accusing anyone :slight_smile:

It is simply easier for us to interpret the output of some commands, and
draw our own conclusions, than read a description which we may not
understand, or which may be a biased interpretation of the facts.

Thus, for instance, instead of replying to your first post, I delayed
till seeing your answer to Henk. :slight_smile:

So, for instance, I would like the output of this command:


> lsblk --output NAME,KNAME,SIZE,TYPE,MOUNTPOINT,LABEL,UUID,PARTLABEL,PARTUUID

and the contents of fstab. It would also be usefult to see the output of
the command “mount” after you mounted the thing in dolphin, to see how
the system sees it.

Finaly, please use code tags. The ‘#’ button - for command outputs and
listings See how


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

Hi, I didn’t say that you, or anyone else, were accusing anyone, I was just referring to hcvv use of word “evidence” in the post.

as for my initial post, I was posting from work computer and did not have access to my server than.
I was working on my server the night before till late and was very frustrated that things did not work. as I was driving to work I thought that I should ask here if anyone can give me some guidance on what to do next to figure out the issue.

BTW how do you get the mount command in Dolphin? when I say I can mount it in Dolphin I mean
I see the drives in the left pane of the file browser and if I click on it it ask me if I want to mount the drive and for password, I type the password and the drive become mounted.

On 2014-04-07 15:26, vl1969 wrote:

> BTW how do you get the mount command in Dolphin? when I say I can mount
> it in Dolphin I mean
> I see the drives in the left pane of the file browser and if I click on
> it it ask me if I want to mount the drive and for password, I type the
> password and the drive become mounted.

No, you can not get to it. GUIs are made to hide details. You can find
out, after it is mounted, how it was mounted, just by running “mount” in
a terminal and looking at the output.


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))