WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Using TCL to share files over the local network.  (Read 4323 times)

Offline TCErtified

  • Newbie
  • *
  • Posts: 7
Using TCL to share files over the local network.
« on: September 22, 2010, 08:18:33 AM »
Hi all!

I'm pretty new to Linux and all, and I usually get by just fine googling and searching, but, I've got stuck with what I want out of a thin client which I've installed TCL to the internal 128Mb flash disk. I just want to be able to put this thing in the loft and use it as a headless torrent box/media server, which I can ssh/vnc into, and share downloaded files over the network to a Ubuntu desktop, a Xbox 360 and a Nexus One.

Now, I've got this 500Gb usb drive which is currently formatted to NTFS, but I can't seem to get ntfs-3g to automount it by trying both these methods described here (I've tried various sleep states from 5-30 too). I can get it to mount like the OP in that thread described by sudo /tmp/tcloop.... but automounting just won't seem to work.

So I've just backed up all the files to another drive and was wondering if reformatting to a different filesystem would make it easier to auto-mount it. Searching/Googled and CIFS looks like the way to share over the network but I ain't too sure how to do that, and looking at the disk in Ubuntu's Disk Utility I don't see any option to format the drive in CIFS. If I formatted it in ext3/4 would I be able to share (Samba?) it to the 360 still?

It's mainly my music I want to share from this to the 360/Nexus, and as for movies I use ps3mediaserver on the Ubuntu box so I'd just be copying them to the Ubuntu box when and as required.

Any help/ideas would be much appreciated as my head's getting a little fuzzy.  ???
« Last Edit: September 22, 2010, 08:28:33 AM by TCErtified »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10965
Re: Using TCL to share files over the local network.
« Reply #1 on: September 22, 2010, 09:15:08 AM »
CIFS is a network protocol, not a file system. Samba can serve any file system over cifs.
The only barriers that can stop you are the ones you create yourself.

Offline TCErtified

  • Newbie
  • *
  • Posts: 7
Re: Using TCL to share files over the local network.
« Reply #2 on: September 22, 2010, 10:33:54 AM »
Ok got that, and I've formatted it to ext3.

How do I add
Code: [Select]
mount -a -t ext3 to rebuildfstab as stated here to get it to automount?

edit - (More googling ;) Alright, I've
Code: [Select]
sudo su
Code: [Select]
vi /etc/fstab and added
Code: [Select]
mount -a -t ext3 which doesn't make it automount, but it does at least save, unlike when I remove the
Code: [Select]
noauto which I can't seem to comment out? Oh my little head...
« Last Edit: September 22, 2010, 10:56:35 AM by TCErtified »

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Using TCL to share files over the local network.
« Reply #3 on: September 22, 2010, 11:23:37 AM »
TCL does not automount. It does, however add mountable devices to fstab.
You must mount the devices manually.

Offline TCErtified

  • Newbie
  • *
  • Posts: 7
Re: Using TCL to share files over the local network.
« Reply #4 on: September 22, 2010, 11:38:06 AM »
TCL does not automount.

How did papillon get it to automount? Can you run a script after X has loaded or something along them lines?

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Using TCL to share files over the local network.
« Reply #5 on: September 22, 2010, 11:57:38 AM »
I think it is described there well, putting a command into /opt/bootlocal.sh

However, my personal opinion is that mounting drives which do not contain data essential to system (or possibly a swapfile, and only if really needed at this early stage) at boot time is a really bad idea.

Implication with TC in default mode is, that whenever it is in order to boot without mounting the drive, e.g. after unclean shutdown etc. you need to state the boot param
Code: [Select]
norestore and thus remain without any of your personal data and configurations, just to avoid mounting a drive...  :-\

Edit:
On second thought, mounting a filesystem read-only at boot time could be a way to have a certain convenience whilst reducing risks of data loss.
« Last Edit: September 22, 2010, 12:03:13 PM by tinypoodle »
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline TCErtified

  • Newbie
  • *
  • Posts: 7
Re: Using TCL to share files over the local network.
« Reply #6 on: September 22, 2010, 12:24:27 PM »
I think it is described there well, putting a command into /opt/bootlocal.sh

I've just tried
Code: [Select]
mount /dev/sda1 /mnt/sda1 in bootlocal.sh with a
Code: [Select]
sleep 30 with no joy still.

As you mentioned with an unclean shutdown (eg - power outages), this is why I want the disk mounted at boot time as I've added Transmission to ~/.xsession to start at logon and with no mounted disk it's going to have to wait until I manually mount it (Or has a fit trying to save to /hdc1 :D)

I'll have another bash tomorrow night after work and post back here if I have any luck. Mucho thanks for your kind help.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Using TCL to share files over the local network.
« Reply #7 on: September 22, 2010, 01:19:35 PM »
Not sure, but seems like you might have understood the exact opposite of what i meant to say.

My point is, that after an unclean shutdown etc, (read-write) automounting should be prevented by all means, in order to run a proper fsck before next mount.

Did you put the sleep command before the mount?
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Using TCL to share files over the local network.
« Reply #8 on: September 22, 2010, 01:38:09 PM »
If /dev/sda1 was found, you should see a /mnt/sda1.
The only command you should need is "mount /mnt/sda1".
No sleep command is necessary.
If there is no /mnt/sda1, then you possibly need a 'waitusb=10' boot option.
If you run "sudo /mnt/sda1" does the drive mount?
If not what error message do you get.

Offline TCErtified

  • Newbie
  • *
  • Posts: 7
Re: Using TCL to share files over the local network.
« Reply #9 on: September 22, 2010, 01:56:29 PM »
Oh the joys of not been able to sleep......
My point is, that after an unclean shutdown etc, (read-write) automounting should be prevented by all means, in order to run a proper fsck before next mount.

I see. I'm going to be leaving this thing going 24/7 when I manage to suss it, so could I put a fsck before mounting the drive in bootlocal.sh maybe?

Quote
Did you put the sleep command before the mount?

Yup.

If you run "sudo /mnt/sda1" does the drive mount?

Yup. And I changed bootlocal.sh to this, still to no avail.

Code: [Select]
#!/bin/sh
sleep 30
mount /mnt/sda1

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Using TCL to share files over the local network.
« Reply #10 on: September 22, 2010, 02:04:06 PM »
If this is TCL 3.1, try putting 'mount /mnt/sda1' in /opt/bootsync.sh.

Offline TCErtified

  • Newbie
  • *
  • Posts: 7
Re: Using TCL to share files over the local network.
« Reply #11 on: September 22, 2010, 02:22:20 PM »
If this is TCL 3.1, try putting 'mount /mnt/sda1' in /opt/bootsync.sh.

Did this even though ls -lA didn't show any bootsync.sh in the /opt folder

Code: [Select]
root@box:/opt# vi bootsync.sh
mount /mnt/sda1
:x

and it saved it to the /opt folder. Upon rebooting it though the bootsync.sh file is not there and no mount either :(

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Using TCL to share files over the local network.
« Reply #12 on: September 22, 2010, 03:58:18 PM »

I see. I'm going to be leaving this thing going 24/7 when I manage to suss it, so could I put a fsck before mounting the drive in bootlocal.sh maybe?


Good idea. At the cost of time of a fsck at each boot, but I think for 24/7 that makes sense.


Code: [Select]
#!/bin/sh
sleep 30
mount /mnt/sda1

try:
Code: [Select]
/bin/mount /dev/sda1 /mnt/sda1 -t ext3
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Using TCL to share files over the local network.
« Reply #13 on: September 22, 2010, 05:58:54 PM »
Be very careful about auto fsck-ing a partition.  Your tce , opt, and home drives defined in the boot record or found through the scan will be mounted.
You never want to fsck a mounted drive, unless it is mounted read only.  Then you need to unmount and remount before you can write to it.

Offline TCErtified

  • Newbie
  • *
  • Posts: 7
Re: Using TCL to share files over the local network.
« Reply #14 on: September 26, 2010, 02:13:20 PM »
Woohoo! Sorry for not writing up sooner, but this worked. I also took out the 'sleep' altogether and it mounts fine.

try:
Code: [Select]
/bin/mount /dev/sda1 /mnt/sda1 -t ext3

Be very careful about auto fsck-ing a partition.  Your tce , opt, and home drives defined in the boot record or found through the scan will be mounted.
You never want to fsck a mounted drive, unless it is mounted read only.  Then you need to unmount and remount before you can write to it.

I tried running an fsck from a root terminal (with sda1 unmounted ;)) and I'm getting this

Code: [Select]
root@box:~# fsck (/dev/sda(tried without this))
sh: fsck: not found

Can you only run fsck at boot? If so, to run a check at boot, would I be right in putting this in bootlocal.sh?

Code: [Select]
#!/bin/sh
fsck /dev/sda1
/bin/mount /dev/sda1 /mnt/sda1 -t ext3