Need to mount a shared ext3 data partition (SOLVED)

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Fred

Re: Need to mount a shared ext3 data partition

Post by Fred »

kirsch92,

Sure, you can do what you are wanting. If you are going to have one large partition with folders for Music, Documents, Photos, Videos, etc., I would use symlinks. On the laptop I would use symlinks also.

You said it was sdb4 so to set it up, open a terminal and type:

sudo mkdir /media/sdb4

gksu gedit /etc/fstab

This will open your fstab file for editing. Put the below stanza at the end of that file.

/dev/sdb4 /media/sdb4 ext3 auto,users,rw,exec,noatime,nodiratime 0 2

Don't confuse word wrap with returns. There isn't a return in the stanza above except at the end. Save and close that file and the terminal. Reboot the computer so this can take effect.

Open a terminal and type:

sudo mkdir /media/sdb4/Music
sudo mkdir /media/sdb4/Documents
audo mkdir /media/sdb4/Photos
sudo mkdir /media/sdb4/Videos

sudo ln -sf /media/sdb4/Music /Music
sudo ln -sf /media/sdb4/Documents /Documents
sudo ln -st /media/sdb4/Photos /Photos
sudo ln -sf /media/sdb4/Videos /Videos

Continue this pattern for however many folders you want to create and link to. Then close the terminal and reboot. That's it.

This should do the trick for you. :-)

Fred
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Fred

Re: Need to mount a shared ext3 data partition

Post by Fred »

kirsch92,

I apologize for the mistake. I was very tired when I responded to your post.

it should be:

sudo ln -sf /media/sdb4/Music Music

You don't need the last / before Music. The way it works is you make a folder on the drive to link to. Then you make a link. The link is created in the folder you are in, in the terminal. By default you are in your home folder when you open a terminal. So all you need is the name of the link, which in this case is Music. Below is the syntax. Note there is a space between the target and the link name. If you were in another directory in the terminal you would first use the cd command to go to the directory you wanted to make a link in.

cd /home/User_Name

ln -sf Target_Folder/File Link_Name

Let me go through the chain a little better.

1.) You have a partition on a drive. It must have a mount point to be used.

2.) You create one or more mount points, (folders), in your system for that partition. Let's say one in /media called sda4 and another in your /home folder called Data

3.) You then have to mount the partition to the desired mount points or folders when the system boots. You do this in the /etc/fstab file. In that file you have a mounting stanza for each folder that is associated with a partition. This is where the partition is bound or mounted to the folder you have created in /media. You have another stanza to mount the partition to any other folder you may have created, possibly in /home, to access that same partition through.

4.) The folder names you are using as mount points must match what you have in the /etc/fstab mounting stanzas.

That is how the partition mounting works. Here you are using symlinks. Symlinks are just pointers to a another file or folder. and use the syntax I showed you above. The path to the target file or folder is referenced first. Then a space and the name you wish to give the link. The link is always created in the folder you are currently in. So if you wanted to create a link called "Help" in the /home/fred/Documents/Business folder to a helpme.odt document in your /home/fred/Misc folder. It would look like the below.

cd /home/fred/Documents/Business

then
.................Target.................... Link Name
ln -sf /home/fred/Misc/helpme.odt Help

As far as the chmod line:

sudo chmod -hR 755 /media/Files

The -h instructs to give a help message on fail, but does nothing now. The -h is depreciated and a help message is given by default now. So there is no need for the h in the above command. The -R is the recursive command to apply to all files and folders below in the folder tree.

Again, I apologize for confusing you.

Fred
Fred

Re: Need to mount a shared ext3 data partition

Post by Fred »

kirsch92,

In a word, yes. This is a good way to go, especially on a wireless network, if Windows is not involved. And that is a good how-to. :-)

Fred
Locked

Return to “Storage”