Karl Godt,
Please tell me what you want. I ask, because I'm actually not sure.
Discuss for the sake of discussion technical discussion? Learn? Teach? Refute? Something else?
Bruce
~
fstab mounting is borked in v5.25
Finally I think I found the thread the OP mentioned , and I am astonished ,
that a sophisticated and experienced member started it :
Puppy's fstab + ntfs-3g = error
The thread ended unsolved ....
The unfortunately orphaned
Issue 19: fstab + ntfs-3g = error
pointed me to it .
This bug declaration mentioned this fstab issue also not working on
Puppy 430 and Puppy 431 , but on my full installations of
Macpup Foxy 3 based upon Puppy 430 and
Macpup Opera 2 based upon Puppy 431
the fstab works contrary to the bug submitter.
I also had put the statically ntfs-3g and mount-FULL from 511 into luci-254 and moved the ntfs-3g-libs in /usr/lib and /lib out of their directories
and must confirm , that for whatever cause ,
ntfs-3g gets passed the '-n' option there .
This is unbelieveable to me , though it seems ,
that while development woof DL libs that may create a linux environment , where some things do not work anymore as expected or usual .
I guess many have experienced , that while a script in the terminal works , it may not work with the same syntax in a script .
For anyone interested , this puzzled me in so far :
that a sophisticated and experienced member started it :
Puppy's fstab + ntfs-3g = error
The thread ended unsolved ....
The unfortunately orphaned
Issue 19: fstab + ntfs-3g = error
pointed me to it .
This bug declaration mentioned this fstab issue also not working on
Puppy 430 and Puppy 431 , but on my full installations of
Macpup Foxy 3 based upon Puppy 430 and
Macpup Opera 2 based upon Puppy 431
the fstab works contrary to the bug submitter.
I also had put the statically ntfs-3g and mount-FULL from 511 into luci-254 and moved the ntfs-3g-libs in /usr/lib and /lib out of their directories
and must confirm , that for whatever cause ,
ntfs-3g gets passed the '-n' option there .
This is unbelieveable to me , though it seems ,
that while development woof DL libs that may create a linux environment , where some things do not work anymore as expected or usual .
I guess many have experienced , that while a script in the terminal works , it may not work with the same syntax in a script .
For anyone interested , this puzzled me in so far :
Code: Select all
##echo 'Part -a begin'
if [[ "`echo "$@" | grep -w -E '\-[a-z]*a[a-z]*|\-a[a-z]*|\-[a-z]*a|\-a'`" != "" ]] ; then
### option -a given
##echo 'if #1'
if [ -n `readlink -f /etc/fstab` ] ; then
##echo 'if #2'
FSTAB=`cat $(readlink -f /etc/fstab) | grep '^/dev/' | grep -v 'noauto' | tr '\t' ' ' | tr -s ' '`
MOUNTDIRS=`echo "$FSTAB" | cut -f 2 -d ' '`
for i in $MOUNTDIRS ; do
[ ! -d $i ] && echo 'if #3' && mkdir -p $i
done
for i in $MOUNTDIRS ; do
DEVICE=`echo "$FSTAB" | grep "$i" | cut -f 1 -d ' '`
FSTYPE=`echo "$FSTAB" | grep "$i" | cut -f 3 -d ' '`
OPTION=`echo "$FSTAB" | grep "$i" | cut -f 4 -d ' '`
mount-FULL "$DEVICE" "$i" -t "$FSTYPE" -o "$OPTION"
done
else
echo -e "\\033[0;31m""Error , option '-a' given but fstab does not exists""\\033[0;39m"
exit
fi
else
##echo 'if #1 else'
#v2.12 discovered difference between $@ and $*. Replaced all $@ with $* in this script...
Right. I hope this means you concur there is a bug. I'm not going to debug it unless asked.Karl Godt wrote:I also had put the statically ntfs-3g and mount-FULL from 511 into luci-254 and moved the ntfs-3g-libs in /usr/lib and /lib out of their directories and must confirm , that for whatever cause ,
ntfs-3g gets passed the '-n' option there
My interest is making sure the bug report stays open. If you agree, then we can find something else to argue about :)
~
Here's a little script using mount-FULL as a workaround.
Using this means you don't need to replace your mount program with mount-FULL and so you don't lose your little mount indicators.
I put it on my desktop with the required arguments in the little argument box and away I went, you can use it for as many different drives as you like. (just use different arguments for each 'shortcut').
(I called it "MountByLabel-ntfs")
Using this means you don't need to replace your mount program with mount-FULL and so you don't lose your little mount indicators.
I put it on my desktop with the required arguments in the little argument box and away I went, you can use it for as many different drives as you like. (just use different arguments for each 'shortcut').
(I called it "MountByLabel-ntfs")
Code: Select all
#!/bin/sh
#usage MountByLabel-ntfs [label] [mountpoint]
#eg. MountByLabel Whitey /mnt/whitey
change_icon()
{
#change desktop icons
echo "<?xml version=\"1.0\"?>
<env:Envelope xmlns:env=\"http://www.w3.org/2001/12/soap-envelope\">
<env:Body xmlns=\"http://rox.sourceforge.net/SOAP/ROX-Filer\">
<SetIcon>
<Path>$1</Path>
<Icon>$2</Icon>
</SetIcon>
</env:Body>
</env:Envelope>" | rox -R
}
label=$1
mntpt=$2
mounted=$(mount | grep $mntpt)
#if already mounted, unmount
if [ -n "$mounted" ]; then
umount $mntpt
if [ -z "$(mount | grep $mntpt)" ]; then
icon="/usr/local/lib/X11/pixmaps/usbdrv48.png"
rox -D $mntpt #close window
fi
#mount if not mounted
else
mount-FULL -t ntfs-3g -L $label $mntpt
rox -x $mntpt
if [ -n "$(mount | grep $mntpt)" ]; then
icon="/usr/local/lib/X11/pixmaps/usbdrv_mntd48.png"
rox $mntpt #display mounted drive root
fi
fi
device="$(mount | grep $mntpt | cut -c 6-9)" #get device
change_icon /root/.pup_event/drive_$device $icon
Sorry to revive a thread which seems to have gone quiet, but has this bug ever been solved upstream? (guessing not as I don't see an agreed upon solution here) I discovered this same issue with another user using mpdPup (built from a September woof snapshot) - I've got a wizard there which writes an entry to fstab, e.g.:
And that seems to work great for any drive type except ntfs, which failed for the exact reasons described in this thread. The other user was attempting to work around the problem and he tried a couple things. First he changed fstab to this:
Which still failed. Finally he just edited the /bin/mount script and removed the -n option discussed in this thread. I think that his solution still requires ntfs-3g be used, but I need to do some testing on my own with an ntfs drive. Ideally I'd like a solution that allows 'auto' to be used in fstab if possible to keep my setup scripts simpler.
I was also wondering what the reason was for suppressing writes to mtab with the -n option - the man page mentions it's for dealing with a read only filesystem, but Puppy is always going to be read/write in some manner with any Pupmode, isn't it?
Code: Select all
/dev/sdb1 /mnt/music auto defaults 0 0
Code: Select all
/dev/sda2 /mnt/music ntfs-3g rw 0 0
I was also wondering what the reason was for suppressing writes to mtab with the -n option - the man page mentions it's for dealing with a read only filesystem, but Puppy is always going to be read/write in some manner with any Pupmode, isn't it?
a possible solution
First, thank you Karl Godt. Your careful examination of so much of this helped me think this through.
I looked at the /bin/mount script. As ldolse mentions, the main culprit is the line that passes the "-n" option to mount-FULL, along with, as Kurt says, ntfs-3g being unable to accept that option. A second problem is created with the attempted solution of detecting "ntfs" in the command line, which doesn't seem to work with fstab.
The purpose of the "-n" option in this case is to suppress writing to mtab because Puppy uses a link to /proc/mounts instead of the normal text file. Why the link instead of the standard text file? I have no idea. Letting mount write to the fake mtab doesn't seem to cause any problems so I removed the "-n" option. (Actually I commented out the line and wrote in a copy of the line without the -n option. This makes it easier to roll back changes if I find I need to.)
I would like all the nice error checking that the "else" part of the script does when it detects mention of ntfs in a commandline mount. I'll try some experiments with checking the filesystem of the device and see if I can get it to work... tomorrow. Right now I'm off to bed.
I looked at the /bin/mount script. As ldolse mentions, the main culprit is the line that passes the "-n" option to mount-FULL, along with, as Kurt says, ntfs-3g being unable to accept that option. A second problem is created with the attempted solution of detecting "ntfs" in the command line, which doesn't seem to work with fstab.
The purpose of the "-n" option in this case is to suppress writing to mtab because Puppy uses a link to /proc/mounts instead of the normal text file. Why the link instead of the standard text file? I have no idea. Letting mount write to the fake mtab doesn't seem to cause any problems so I removed the "-n" option. (Actually I commented out the line and wrote in a copy of the line without the -n option. This makes it easier to roll back changes if I find I need to.)
I would like all the nice error checking that the "else" part of the script does when it detects mention of ntfs in a commandline mount. I'll try some experiments with checking the filesystem of the device and see if I can get it to work... tomorrow. Right now I'm off to bed.
[color=blue]A life! Cool! Where can I download one of those from?[/color]