WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: probing ram drives  (Read 2316 times)

Offline dufus

  • Newbie
  • *
  • Posts: 12
probing ram drives
« on: December 07, 2010, 08: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).

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
probing ram drives
« Reply #1 on: December 07, 2010, 09:42:22 AM »
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.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10960
probing ram drives
« Reply #2 on: December 07, 2010, 10:15:31 AM »
@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).
The only barriers that can stop you are the ones you create yourself.

Offline SvOlli

  • Full Member
  • ***
  • Posts: 193
  • Linux Developer
probing ram drives
« Reply #3 on: December 07, 2010, 10:19:12 AM »
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.

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
probing ram drives
« Reply #4 on: December 07, 2010, 12: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'.

Offline jur

  • Hero Member
  • *****
  • Posts: 863
    • cycling photo essays
probing ram drives
« Reply #5 on: December 07, 2010, 12: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

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
probing ram drives
« Reply #6 on: December 07, 2010, 01:08:01 PM »
What would be the impact if ntfs partitions would already be mounted either with any of the ntfs or ntfsmount drivers?
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline SvOlli

  • Full Member
  • ***
  • Posts: 193
  • Linux Developer
probing ram drives
« Reply #7 on: December 07, 2010, 02: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.

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
probing ram drives
« Reply #8 on: December 07, 2010, 02: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)

Offline dufus

  • Newbie
  • *
  • Posts: 12
probing ram drives
« Reply #9 on: December 07, 2010, 08: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.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: probing ram drives
« Reply #10 on: December 08, 2010, 09:35:35 AM »
You don't have to have an /etc/fstab entry to mount a device.

Offline SvOlli

  • Full Member
  • ***
  • Posts: 193
  • Linux Developer
Re: probing ram drives
« Reply #11 on: December 08, 2010, 02: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.