Tiny Core Linux
Tiny Core Extensions => TCE Q&A Forum => Topic started by: TCErtified on September 22, 2010, 11: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 (http://www.hitachigst.com/simpledrive-rev3) 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 (http://forum.tinycorelinux.net/index.php?topic=5638.0) (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 (http://i.imgur.com/v5iBl.png) 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 (http://code.google.com/p/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. ???
-
CIFS is a network protocol, not a file system. Samba can serve any file system over cifs.
-
Ok got that, and I've formatted it to ext3.
How do I add mount -a -t ext3
to rebuildfstab as stated here (http://forum.tinycorelinux.net/index.php?topic=1889.0) to get it to automount?
edit - (More googling ;) Alright, I've sudo su
vi /etc/fstab
and added mount -a -t ext3
which doesn't make it automount, but it does at least save, unlike when I remove the noauto
which I can't seem to comment out? Oh my little head...
-
TCL does not automount. It does, however add mountable devices to fstab.
You must mount the devices manually.
-
TCL does not automount.
How did papillon (http://forum.tinycorelinux.net/index.php?topic=5638.msg29914#msg29914) get it to automount? Can you run a script after X has loaded or something along them lines?
-
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 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.
-
I think it is described there well, putting a command into /opt/bootlocal.sh
I've just tried mount /dev/sda1 /mnt/sda1
in bootlocal.sh with a 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.
-
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?
-
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.
-
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?
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.
#!/bin/sh
sleep 30
mount /mnt/sda1
-
If this is TCL 3.1, try putting 'mount /mnt/sda1' in /opt/bootsync.sh.
-
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
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 :(
-
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.
#!/bin/sh
sleep 30
mount /mnt/sda1
try:
/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.
-
Woohoo! Sorry for not writing up sooner, but this worked. I also took out the 'sleep' altogether and it mounts fine.
try:
/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
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?
#!/bin/sh
fsck /dev/sda1
/bin/mount /dev/sda1 /mnt/sda1 -t ext3
-
fsck.ext3 [options]
Better check the options, as well for manual but especially for automated use.
Many distros (e.g. slackware) would do a fsck on boot on the root fs, and the mechanism seems to be rather complex, e.g. in case of changes having to be made, an automatic reboot would be necessary; so it is a matter of scripting.
Basically you can run filesystem checks whenever, only precondition to be unmounted.
-
If you are SURE your etc, opt, and home directories are not on /dev/hda1, and you still insist on running fsck,
make sure you run in in bootsync.sh BEFORE it calls bootlocal.sh.