Tiny Core Linux

Tiny Core Base => TCB Talk => Topic started by: dufus on December 07, 2010, 11:36:35 AM

Title: probing ram drives
Post by: dufus on December 07, 2010, 11:36:35 AM
Just a spurious thought here. If you guys are working inside rebuildfstab, it sure would be nice (for `ol dufus a least) if it would probe for mounted ram drives and add them. If it  already does probe, please disregard this post ( you're all going to fast for me to keep up with).
Title: probing ram drives
Post by: tinypoodle on December 07, 2010, 12:42:22 PM
I'd say to mount/umount ramdisks (if that is what you mean by "ram drives") seems kind of redundant, when TC by default runs in a tmpfs (which I think has a max. size of 90% of usable RAM.

Except if you have a certain usage in mind which might have benefits I might have overlooked.
Title: probing ram drives
Post by: curaga on December 07, 2010, 01:15:31 PM
@dufus

Could you explain how it would be useful to add already mounted ramdisks to fstab? They're gone after a reboot, and AFAIK formatting one does not cause an udev event (so rebuildfstab wouldn't run on such a time, only after the next "proper device" event).
Title: probing ram drives
Post by: SvOlli on December 07, 2010, 01:19:12 PM
While we are on rebuildfstab, please include the following:

if ntfs-3g is installed replace the "ntfs" filesystem type with "ntfs-3g", so that write access is possible just by mounting without any big hassle.
Title: probing ram drives
Post by: maro on December 07, 2010, 03:13:11 PM
if ntfs-3g is installed replace the "ntfs" filesystem type with "ntfs-3g", so that write access is possible just by mounting without any big hassle.

I'd support that request, but I'd like to suggest a minor enhancement of it: Have a check in the startup script of the 'ntfs-3g.tcz' extensions which forces a re-run of 'rebuildfstab' if any 'ntfs' file systems are already in '/etc/fstab'.

The impact of this variation should be that as soon as 'ntfs-3g.tcz' is installed all NTFS file systems become tagged with 'ntfs-3g' in '/etc/fstab'.
Title: probing ram drives
Post by: jur on December 07, 2010, 03:45:39 PM
While we are on rebuildfstab, please include the following:

if ntfs-3g is installed replace the "ntfs" filesystem type with "ntfs-3g", so that write access is possible just by mounting without any big hassle.
+1
Title: probing ram drives
Post by: tinypoodle on December 07, 2010, 04:08:01 PM
What would be the impact if ntfs partitions would already be mounted either with any of the ntfs or ntfsmount drivers?
Title: probing ram drives
Post by: SvOlli on December 07, 2010, 05:21:50 PM
Have a check in the startup script of the 'ntfs-3g.tcz' extensions which forces a re-run of 'rebuildfstab' if any 'ntfs' file systems are already in '/etc/fstab'.
How about the other way round: ntfs-3g will call rebuildfstab on load via /usr/local/tce.installed/ntfs-3g ? Easier to implement and the call will be done at the right time.
Title: probing ram drives
Post by: maro on December 07, 2010, 05:59:51 PM
Have a check in the startup script of the 'ntfs-3g.tcz' extensions which forces a re-run of 'rebuildfstab' if any 'ntfs' file systems are already in '/etc/fstab'.
How about the other way round: ntfs-3g will call rebuildfstab on load via /usr/local/tce.installed/ntfs-3g ? Easier to implement and the call will be done at the right time.
I might have had a slow start today but isn't '/usr/local/tce.installed/ntfs-3g' what I'm referring to as the "startup script of the 'ntfs-3g.tcz' extension"?

With that I meant something like grep -q ntfs '/etc/fstab' && rebuildfstab in '/usr/local/tce.installed/ntfs-3g', plus something along the lines of
Code: [Select]
  [ "$FSTYPE" = "ntfs" -a -n "$( which ntfs-3g )" ] && FSTYPE="ntfs-3g"
  OPTIONS="noauto,users,exec"
  case "$FSTYPE" in
    ntfs-3g) OPTIONS="$OPTIONS,rw,umask=000" ;;
    ntfs) OPTIONS="$OPTIONS,ro,umask=000" ;;
instead of
Code: [Select]
  OPTIONS="noauto,users,exec"
  case "$FSTYPE" in
    ntfs) OPTIONS="$OPTIONS,ro,umask=000" ;;
in '/usr/bin/rebuildfstab'

(WARNING: code has not been really tested)
Title: probing ram drives
Post by: dufus on December 07, 2010, 11:28:45 PM
I run what I call "http-thin-mode" (I call it that because.... well what's my name). My backup "mydata.tgz" gets pulled in through httplist boot option. Then on shutdown, I do backup to ram-drive and post it back out to the server through shutdown.sh. But it takes an extra cpio.gz file to do it because ram-drives are not detected as devices. I'm just lazy, that's all. Don't want to have to write it into fstab myself.
Title: Re: probing ram drives
Post by: gerald_clark on December 08, 2010, 12:35:35 PM
You don't have to have an /etc/fstab entry to mount a device.
Title: Re: probing ram drives
Post by: SvOlli on December 08, 2010, 05:08:35 PM
I might have had a slow start today but isn't '/usr/local/tce.installed/ntfs-3g' what I'm referring to as the "startup script of the 'ntfs-3g.tcz' extension"?
Never post a topic just before going to bed... I read it as "the (global) startup script should check for ntfs-3g.tcz". :-| Sorry.

After taking a quick look at it, I'd say that your modification should work, but I've got a suggestion for a small improvement: instead of
Code: [Select]
  [ "$FSTYPE" = "ntfs" -a -n "$( which ntfs-3g )" ] && FSTYPE="ntfs-3g"
I'd go for
Code: [Select]
  [ "$FSTYPE" = "ntfs" -a -f "/usr/local/tce.installed/ntfs-3g" ] && FSTYPE="ntfs-3g"
It should be slightly faster.