Unfortunately no one can be told what fun_plug is - you have to see it for yourself.
You are not logged in.
perhaps after writing the partition table you may want to verify it is stored as Linux not FAT. Maybe your thumbdrive auto-rename it back to FAT
#fdisk -l
you can run this on another telnet session while you are formating
Offline
quekky wrote:
perhaps after writing the partition table you may want to verify it is stored as Linux not FAT. Maybe your thumbdrive auto-rename it back to FAT
Code:
#fdisk -lyou can run this on another telnet session while you are formating
Interesting. The DNS-323 seems to ignore the partition type. My fdisk partition was still set to FAT even though it was formatted and mounted as EXT2. You can update the partition type without reformatting the by using the "t" option of fdisk. (not that it seems to matter on 1.04 or 1.05)
Cheers!
k
Offline
bspvette86 wrote:
quekky wrote:
perhaps after writing the partition table you may want to verify it is stored as Linux not FAT. Maybe your thumbdrive auto-rename it back to FAT
Code:
#fdisk -lyou can run this on another telnet session while you are formating
Interesting. The DNS-323 seems to ignore the partition type. My fdisk partition was still set to FAT even though it was formatted and mounted as EXT2. You can update the partition type without reformatting the by using the "t" option of fdisk. (not that it seems to matter on 1.04 or 1.05)
Cheers!
k
A similar scenario happened to me. I partitioned & formatted as ext2, but then when trying to mount the drive in auto mode the DNS-323 kept thinking it was FAT. My problem was that either the partitioning or the formatting wasn't completing successfully due to lack of power, even though it seemed to finish. Maybe the box defaults to FAT if it can't determine what FS it is due to corruption?
Offline
halfsoul, glad to hear you solved your problem--I was gone all weekend, so I didn't see your post until today. I added this thread to my instructions since it provides yet more symptoms of the weird compatibility issue with the USB port on the DNS-323.
Offline
grmek wrote:
Okay, I've tried SilentException's script now, of course changing the UUID to the proper value, but still:
**** fun_plug script for DNS-323 (2008-04-13 tp@fonz.de) ****
Thu May 15 13:10:02 GMT 2008
Found usb-storage.ko module. Copying...
insmod usb-storage.ko
ln -snf /mnt/HD_a2/ffp /ffp
Waiting for F486-21D2 (up to 30 seconds) ...
/dev/sdc1: LABEL="JUMPDRIVE" UUID="F486-21D2" TYPE="vfat"
/dev/sdc1: LABEL="JUMPDRIVE" UUID="F486-21D2" TYPE="vfat"
Success. Found F486-21D2.
Mounting /dev/sdc1 on /mnt/USB
USB stick mounted
* Found FFP on USB device
ln -snf /mnt/USB/ffp /ffp
* Running /ffp/etc/rc ...
./fun_plug: /ffp/etc/rc: No such file or directory
* OK
That's it... rc doesnt get run and ffp is not started..
I've just gone through the exact same problem. That is until I realized the file attributes associated with the fun_plug files were not copied to the USB drive when I copied the files over from the harddive. To be exact, the execute attribue was lost. Using the -p switch (preserve mode, ownership, timestamps) with the copy command resolved the problem.
I now have ffp and my model railroad web (afticarr.com) running from the USB key.
Bob Blackwell
Pickering, ON
Last edited by rcblackwell (2008-06-20 00:12:28)
Offline
SilentException wrote:
thanks. i did something similar using your first script as a template..
then, with help from uf0un from irc channel i modified fun_plug that mounts the usb partition using UUID instead of fixed device name.
attached is my current fun_plug
One question on the use of UUID. DOes it make it more robust from the point of view of locating the right stick (in case you have many attached)? Also, if I were to use your script, do I need to change the UUID to something else? If so, how do I find out what UUID to use for my stick? TIA
Offline
bfg100k wrote:
SilentException wrote:
thanks. i did something similar using your first script as a template..
then, with help from uf0un from irc channel i modified fun_plug that mounts the usb partition using UUID instead of fixed device name.
attached is my current fun_plugOne question on the use of UUID. DOes it make it more robust from the point of view of locating the right stick (in case you have many attached)? Also, if I were to use your script, do I need to change the UUID to something else? If so, how do I find out what UUID to use for my stick? TIA
exactly, so far i have only one usb device connected so it was always sdc1 but that might change. and the script will still be working after that, as planned in this case, there are no other reasons for mounting using UUID..
you can find UUID using command 'blkid'
Offline
Thanks for the reply. I managed to figure out the blkid command after looking through your script. One more question though... I was under the impression that after ffp is moved to the USB stick, I should then be able to umount HD_a2 once I shutdown all services (except ssh of cuz) right? I can't seem to get to that stage for my box. FYI, I need to unmount it so that I can run e2fsck on it. The cleanboot script doesn't seem to work for me and I was hoping that by moving ffp to the USB stick, I will no longer have problems with the umounting of HD_a2!
Offline
try reading here and forward if you'd like to chk your disks:
http://dns323.kood.org/forum/p14563-200 … tml#p14563
i've quickly made a small pack for booting into e2fsck mode. hope it helps!
Offline
SilentException wrote:
try reading here and forward if you'd like to chk your disks:
http://dns323.kood.org/forum/p14563-200 … tml#p14563
i've quickly made a small pack for booting into e2fsck mode. hope it helps!
Yeah, I've been using that for running e2fsck on HD_a2. but booting into an alternative mode is a pain that I'm trying to avoid. (yeah, I'm lazy! )
Offline
bfg100k wrote:
SilentException wrote:
try reading here and forward if you'd like to chk your disks:
http://dns323.kood.org/forum/p14563-200 … tml#p14563
i've quickly made a small pack for booting into e2fsck mode. hope it helps!Yeah, I've been using that for running e2fsck on HD_a2. but booting into an alternative mode is a pain that I'm trying to avoid. (yeah, I'm lazy! )
bfg100k,
Are you sure your USB-storage support is starting from someplace like /tmp instead of /mnt/HD_a2?
ie:
cp /mnt/HD_a2/lnx_bin/usb-storage.ko /tmp
insmod /tmp/usb-storage.ko
If it is being loaded from /mnt/HD_a2, it will prevent the FS from being unmounted. Also, what does a "ps -ef" show?
Cheers!
bspvette
Offline
bspvette86 wrote:
bfg100k wrote:
SilentException wrote:
try reading here and forward if you'd like to chk your disks:
http://dns323.kood.org/forum/p14563-200 … tml#p14563
i've quickly made a small pack for booting into e2fsck mode. hope it helps!Yeah, I've been using that for running e2fsck on HD_a2. but booting into an alternative mode is a pain that I'm trying to avoid. (yeah, I'm lazy! )
bfg100k,
Are you sure your USB-storage support is starting from someplace like /tmp instead of /mnt/HD_a2?
ie:
cp /mnt/HD_a2/lnx_bin/usb-storage.ko /tmp
insmod /tmp/usb-storage.ko
If it is being loaded from /mnt/HD_a2, it will prevent the FS from being unmounted. Also, what does a "ps -ef" show?
Cheers!
bspvette
yeah, if you take a look at my fun_plug, it copies the module to ram drive, then loads it
usbmod_loaded=no #copy usb-storage module if [ -e $FFP_HD/lib/modules/$(uname -r)/usb-storage.ko ]; then echo "Found usb-storage.ko module. Copying..." mkdir -p /lib/modules/$(uname -r)/ cp $FFP_HD/lib/modules/$(uname -r)/usb-storage.ko /lib/modules/$(uname -r)/ #load usb-storage module insmod /lib/modules/$(uname -r)/usb-storage.ko echo "insmod usb-storage.ko" sleep 2 usbmod_loaded=yes fi
i made sure *nothing* runs on the hdd as i'm alergic to disk spin-ups
you should be able to umount hdds. if you want to debug, get a copy of lsof for arm (i could send you one) and do:
#lsof |grep HD_
(this will show you open files on HDDs)
also, before umount try this:
#swapoff /dev/sda1
#swapoff /dev/sdb1
Offline
SilentException wrote:
if you want to debug, get a copy of lsof for arm (i could send you one) and do:
#lsof |grep HD_
(this will show you open files on HDDs)
I've just added lsof to ffp 0.5. It's small enough and definitely a useful debugging tool.
Offline
not exactly sure what happened last night but after a reboot today, i'm able to unmount the partition and run e2fsck successfully... new (but expected) problem though... my usb stick is not able to unmount properly on shutdown/reboot (even after applying cleanboot)
Offline
i have same problem and havent been able to figure it out yet.
the cleanboot script i'm using should be able to stop all the stuff and umount cleanly but it fails. funny thing is that you cannot debug it easily (maybe with another usb stick on which you'll write the log file)...
@ fonz: yeah, realy useful utility. thanks for including it in ffp
edit: now i got the idea of logging over network. will redirect the cleanboot script output to /tmp/cleanboot.log, then netcat the file to my listening xp computer. let's see how it works
Last edited by SilentException (2008-06-25 16:19:10)
Offline
bfg100k wrote:
not exactly sure what happened last night but after a reboot today, i'm able to unmount the partition and run e2fsck successfully... new (but expected) problem though... my usb stick is not able to unmount properly on shutdown/reboot (even after applying cleanboot)
Same problem here, cleanboot does not work on my CH3SNAS at all.
My current work around: After reboot I kill the process mt-daapd and then i am able to remount the USB stick as read only. Then I run e2fsck to correct any errors...
If there is a better solution, I would be more happy!
Offline
bfg100k wrote:
not exactly sure what happened last night but after a reboot today, i'm able to unmount the partition and run e2fsck successfully... new (but expected) problem though... my usb stick is not able to unmount properly on shutdown/reboot (even after applying cleanboot)
Same problem here, cleanboot does not work on my CH3SNAS at all.
My current work around: After reboot I kill the process mt-daapd and then i am able to remount the USB stick as read only. Then I run e2fsck to correct any errors...
If there is a better solution, I would be more happy!
Offline
I am trying to understand what happens when i remove the usb stick. I thought that in that case the /ffp on HD_a2 would load. This /ffp is in my case the same as the /ffp on the usb stick because i copied it over.
But the logfile shows that /ffp on a usb stick is found?
**** fun_plug script for DNS-323 (2008-04-13 tp@fonz.de) ****
Thu Jul 3 15:14:06 GMT 2008
Found usb-storage.ko module. Copying...
insmod usb-storage.ko
Waiting for sdc1 (up to 30 seconds) ...
Failed. Did not find sdc1 in /proc/partitions.
* Found FFP on USB device
ln -snf /mnt/HD_a2/Datagb/sdc1/ffp /ffp
Is this normal behavior? I'm using the funplug file provided by Kylek
Offline
Yes, the script should fall back to a HDD-based fun_plug should it not find the USB stick.
Looking at your log, it seems like you use the same path for the hdd funplug and the USB funplug, which might confuse the script.
Make sure that your mount point for the USB stick is not a directory on one of your disks. I use /mnt/USB for this. (You have to create the directory before something can get mounted to it).
Offline
just had our new USB stick die.. maybe "worn out" ? I wonder if it explains a few NFS streaming errors that we experienced over the weekend ? hmmmmm., Anyways now we get these lovely errors in the dmesg output and the majority of the FS on the USB drive is toast.
usb-storage: *** thread awakened.
usb-storage: Bad target number (7:0)
usb-storage: scsi cmd done, result=0x40000
usb-storage: *** thread sleeping.
usb-storage: device scan complete
scsi2 (0:0): rejecting I/O to dead device
scsi2 (0:0): rejecting I/O to dead device
scsi2 (0:0): rejecting I/O to dead device
scsi2 (0:0): rejecting I/O to dead device
Buffer I/O error on device sdc1, logical block 0
lost page write due to I/O error on sdc1
EXT2-fs error (device sdc1): ext2_readdir: bad page in #2
scsi2 (0:0): rejecting I/O to dead device
scsi2 (0:0): rejecting I/O to dead device
Buffer I/O error on device sdc1, logical block 0
lost page write due to I/O error on sdc1
EXT2-fs error (device sdc1): ext2_readdir: bad page in #8146
scsi2 (0:0): rejecting I/O to dead device
scsi2 (0:0): rejecting I/O to dead device
Buffer I/O error on device sdc1, logical block 0
lost page write due to I/O error on sdc1
EXT2-fs error (device sdc1): ext2_get_inode: unable to read inode block - inode=2, block=123
scsi2 (0:0): rejecting I/O to dead device
scsi2 (0:0): rejecting I/O to dead device
Buffer I/O error on device sdc1, logical block 0
lost page write due to I/O error on sdc1
EXT2-fs error (device sdc1): ext2_get_inode: unable to read inode block - inode=8145, block=32891
#######################################
# HD0 awake now ! #
#######################################
scsi2 (0:0): rejecting I/O to dead device
scsi2 (0:0): rejecting I/O to dead device
Buffer I/O error on device sdc1, logical block 0
lost page write due to I/O error on sdc1
EXT2-fs error (device sdc1): ext2_get_inode: unable to read inode block - inode=8146, block=32891
scsi2 (0:0): rejecting I/O to dead device
scsi2 (0:0): rejecting I/O to dead device
scsi2 (0:0): rejecting I/O to dead device
Offline
I wanted to add something here. I use a USB hub to connect the flash drive and another external HD. Nothing I did would get the flash drive readable at it's current position (which was /dev/sdc1), so I went ahead and just pulled and and re-inserted it into a new port on the hub, found it's dev mount and mounted a dir to it. I can read the drive fine and dandy which leads me to believe that perhaps the port on the hub went bad ? Either way I am going to reboot to test things out. Up until now I did everything I could NOT to reboot, since I didn't know what state it would come back up in. I had 95% of everything from the flash drive backed up, but there were a couple of strt scripts that I had recently customized some more that I had not yet backed up (they are backed up now ). I will try to jump back onto this forum later on today and post the outcome .
Offline
KyleK wrote:
Yes, the script should fall back to a HDD-based fun_plug should it not find the USB stick.
Looking at your log, it seems like you use the same path for the hdd funplug and the USB funplug, which might confuse the script.
Make sure that your mount point for the USB stick is not a directory on one of your disks. I use /mnt/USB for this. (You have to create the directory before something can get mounted to it).
Thanks, that solved it. I made another mount with a different name to the HD_a2 for easier access.
Offline
SilentException wrote:
i made sure *nothing* runs on the hdd as i'm alergic to disk spin-ups
I don't understand something in the script. After mounting the usb drive and before the symbolic link, why is there a second SUID BUSYBOX script, and why does it seem to call the HD? Or am I misunderstanding something?
# suid busybox on USB if [ -x $FFP_USB/bin/busybox ]; then chown root.root $FFP_HD/bin/busybox chmod 0755 $FFP_HD/bin/busybox chmod u+s $FFP_HD/bin/busybox fi
Offline
halfsoul wrote:
SilentException wrote:
i made sure *nothing* runs on the hdd as i'm alergic to disk spin-ups
I don't understand something in the script. After mounting the usb drive and before the symbolic link, why is there a second SUID BUSYBOX script, and why does it seem to call the HD? Or am I misunderstanding something?
Code:
# suid busybox on USB if [ -x $FFP_USB/bin/busybox ]; then chown root.root $FFP_HD/bin/busybox chmod 0755 $FFP_HD/bin/busybox chmod u+s $FFP_HD/bin/busybox fi
thats my bug. it should say $FFP_USB in each of chown and chmod commands.
btw, those commands are there just to make sure busybox has right permissions and that it's suid root. in 99.99% cases they don't even get executed and have nothing to do with disk spinning up or down
Offline