Your mounting board should be roughly the same length as the track but a little wider.
Installing sliding barn door track.
Double barn doors require open wall space on both sides of the doorway.
Custom barn doors are a lot of fun with the right help.
Sliding barn doors work best when there is enough empty wall space next to the opening that the door can slide completely open.
If only installing one door the track need only be as wide as the door but keep in mind that you will want the track to be about twice the length of the door so that you can open it completely.
To secure the track to the wall and add support for the heavy barn door cut a 1 x 4 mounting board the same length as but a little wider than the track.
Use the drywall anchors spacers and lag bolts to secure the mounting board.
Keep in mind that light switches electrical outlets and heating and cooling registers on the walls next to the opening could be in the way.
To do this add support by attaching a mounting board to the wall that s approximately 1x4 inches.
Here is the link to build one.
If installing two sliding doors remember that the tracks should be twice as wide as each door so that you can slide two doors together on one track.