LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 11-08-2016, 03:56 PM   #1
agarwaldvk
LQ Newbie
 
Registered: Oct 2016
Posts: 27

Rep: Reputation: Disabled
What have I done with my Ubuntu Desktop Server - Pleeeeeeeeeease Help!


Hi Everyone


I recently made a file and media server using Ubuntu Desktop 16.04 LTS. I thought it was all working well with the shares showing all the media files as they should with the only concern being the 777 permissions currently granted to everything. The intent was to change that later once everything worked fine. But I don't believe my system is working as it should and I would like to fix it so that it works as it is supposed to be and I don't have issues later with loads of data on it.

This is what I find :-

When I access this Ubuntu server computer from my windows PC, I see a folder called "mediafiles" with 2 sub-folders viz "share4media" and "share4data". These sub-folders, however, correctly show all the files and folders therein. No problem. I see exactly the same structure when I access this server computer from my WD Live TV.

The problem is that the folder structure that I see from my Windows PC is not the folder structure thought I created in my Ubuntu server computer. If you look at these attachments, it will become clearer.

I, in Ubuntu server computer, created a sub-folder under the "/media" folder called "/mediafiles" (this was supposed to be titled "dataplusmediafiles" but nevertheless - I will change it later if I can but no big deal). The original intent was to create 2 sub-fodlers under this folder ("/media/mediafiles"). These were to be named "share4media" and "share4data" - these 2 sub-folders were supposed to be the mount points for the 2 physical hard drives that I currently have - one dedicated to the data files and the other to the media files. I am very sure that I didn't actually end up creating these 2 sub-folders ("share4media" and "share4data") on the server computer.

I then specified the mount definitions in the fstab file for these hdd's are as follows :-
/dev/sda1 /media/share4media ntfs defaults 0 0
/dev/sdb1 /media/share4data ntfs defaults 0 0

Maybe because of what I have so far done, I am seeing the folder structure differently on the Ubuntu computer from within the Ubuntu PC and from within the Windows PC. I would like to correct this situation though.

With my current setup (incorrect as it is), is it now possible to change things so that the original intent can be met or is it too late. There is about 1.4 tb if data in the ""/share4media" folder at the moment. The "/share4date" is empty at the moment.

I think this is what is required to be done but I am not sure if I can do them (without losing data on the "share4media" folder) :-
1. Unmount both these hdd's (I don't how to do that yet but hopefully someone can show me how to)
2. Create these 2 sub-directories called "share4data" and "share4media" under the /media/mediafiles (it would be great if I could rename this share as "dataplusmediafiles" at this stage - as was the originally intended)
3. Change the mount definition again in the fstab file like so :-

/dev/sda1 /media/mediafiles/share4media ntfs defaults 0 0
/dev/sdb1 /media//mediafiles/share4data ntfs defaults 0 0

(this is assuming the folder name "/mediafiles" cannot be changed to "dataplusmediafiles")

4. Reboot to fix everything up hopefully!



Any help here on a slightly higher priority would be greatly appreciated.



Best regards


Deepak
Attached Files
File Type: pdf Server Information.pdf (126.0 KB, 12 views)
 
Old 11-08-2016, 04:36 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
The share name in your smb.conf file i.e. [mediafiles] has nothing to do with the actual directory path you want to share i.e /media (path = /media).

To rename the directory just use the mv command i.e.
cd /media
sudo mv mediafiles dataplusmediafiles

Now you can create the desired media and directories in the dataplusmediafiles directory.
umount sda1 and sdb1 and remount to /media/dataplusmediafiles/share4media and /media/dataplusmediafiles/share4data.

Change the share path directory to path = /media/dataplusmediafiles and when you access the mediafiles share from the windows computer you should see just the two media directories.

You should use ntfs-3g instead of ntfs to mount NTFS filesystems.
 
Old 11-08-2016, 06:40 PM   #3
agarwaldvk
LQ Newbie
 
Registered: Oct 2016
Posts: 27

Original Poster
Rep: Reputation: Disabled
hi MichaelK


Thank you so much for your immediate response. I am so grateful. I will try and implement all of these tonight when I get home and hopefully things should be all good. Despite my extremely limited knowledge of linux, I am quite liking it and hopefully be able to improve upon it in the near future.

Whilst your instructions are quite succinct and clear, but because of limited knowledge of the linux system at this stage and I am dead scared of stuffing things up again and want to ensure that this time around I get it perfectly right, I am just summarizing the steps that I need to take to fix up my system (could you please have a cursory glance at them and advise if I have got it all OK?) :-

1. Rename my current "mediafiles " directory to "dataplusmediafiles" using the commands :-
cd /media
sudo mv mediafiles dataplusmediafiles

This directory as such is currently empty, so that shouldn't be an issue at all.


2. Create 2 sub-directories inside the now renamed "dataplusmediafiles" directory with the names "share4date" and "share4media" using the following commands :-
cd /media/dataplusmediafiles
sudo mkdir /media/dataplusmediafiles/share4data
sudo mkdir /media/dataplusmediafiles/share4media

These should result in two empty subdirectories with the following paths :-
/media/dataplusmediafiles/share4data
/media/dataplusmediafiles/share4media


3. Unmount the two currently mounted hard disk drives using the following commands (I had mounted these drive with "ntfs" file system type but it shows as "fuseblk" type. Do I need to specify the file system type in the unmount command at all? If yes, do I specify as "fuseblk" or "ntfs" as was specified in the mount command in the fstab file?):-
umount -v -t ntfs /media/share4data|/dev/sda1
umount -v -t ntfs /media/share4media|/dev/sdb1

These drive were mounted with the following commands in the fstab file :-
/dev/sda1 on /media/share4media
/dev/sdb1 on /media/share4data

I am assuming here that unmounting a drive doesn't affect the data on them, hence I wouldn't lose any data on them - One of them is empty anyway, the other has 1.4 tb of data.


4. Remount these drive with the following command in the fstab file :-
mount /dev/sda1 /media/dataplusmediafiles/share4media ntfs-3g defaults 0 0
mount /dev/sdb1 /media/dataplusmediafiles/share4data ntfs-3g defaults 0 0


5. Rename the share "dataplusmediafiles" in the smb.conf file to path = "/media/dataplusmediafiles". Whilst, as you said, the share name has nothing to do with the directory path, just for the sake of consistency, I would like to see "dataplusmediafiles" as the parent folder name with "share4date" and "share4media" as the the 2 subdirectories under it.


6. Restart Samba service for all of these changes to take effect

7. Reboot the server for all of these changes to take effect


One more question - hopefully, this should be the last question in this context :-

As you saw the share definition in the smb.conf file, I have specified the 'create mask = 777' for the mediafiles (now dataplusmediafiles) share, but I want myself (agarwaldvk user) to be the only one to be able to edit the 'share4media' sub-folder in the future on a permanent basis. How can this be realized?


Sorry for being a pest but I am so apprehensive about get it wrong again, hence the over caution.


Best regards


Deepak
 
Old 11-08-2016, 08:21 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Change [mediafiles] to [dataplusmediafiles] in your smb.conf file and restart samba. What you see under the network will now be dataplusmediafiles and when you click on the icon you will see the other directories.

Since the partition is NTFS you can change how share4media is mounted using uid,gid,umask and dmask options.
 
Old 11-11-2016, 02:13 PM   #5
agarwaldvk
LQ Newbie
 
Registered: Oct 2016
Posts: 27

Original Poster
Rep: Reputation: Disabled
Hi michaelK


Thanks a lot for these instructions. I did implement them and they worked perfectly!


Best regards


Deepak

Last edited by agarwaldvk; 11-11-2016 at 02:14 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I install LAMP on my Ubuntu desktop and use my Ubuntu desktop as a Server? doctorkenny Linux - Newbie 14 01-06-2014 06:32 PM
Remotely access Kubuntu (Ubuntu Server with KDE Desktop) with windows Remote Desktop brunellehomenet Linux - Newbie 3 10-21-2012 09:20 AM
[SOLVED] "Installed" Ubuntu 10.10 server on Ubuntu 10.10 desktop. How to get desktop v. back? nax123 Ubuntu 4 08-21-2011 08:29 PM
Ubuntu Server Vs. Ubuntu Desktop for home file server rhodes50 Ubuntu 28 12-19-2010 08:22 AM
Need Help With Sound Pleeeeeeeeeease bvav22 Linux - Software 5 04-25-2005 08:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 04:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration