1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

HFS+ in TomatoUSB

Discussion in 'Tomato Firmware' started by greenythebeast, Aug 26, 2010.

  1. greenythebeast

    greenythebeast Networkin' Nut Member

    Is there anyway to integrate HFS+ into TomatoUSB? It seems the necessary files are located here: http://www.ardistech.com/hfsplus/ but I don't know how to add them to TomatoUSB. Thanks for your help.
  2. greenythebeast

    greenythebeast Networkin' Nut Member

    Is it safe to run kmod-hfsplus_2.4.30-brcm-5_mipsel.ipk on a K2.6 RT-N16?
  3. teddy_bear

    teddy_bear LI Guru Member

    It's safe, but it won't work ;) - as you see it's for kernel 2.4.30.

    You need to download "Optional kernel modules" archive (for MIPSR2 if you're going to use it on RT-N16) from the Tomato USB download page, extract hfsplus.ko file from it, and place it to /jffs partition on your router (or on the usb drive if you have one attached).

    Then run "insmod" to load the module:
    insmod <full path to the file>/hfsplus.ko
    and now you should be able to use "mount" command to manually mount your HFS+ formatted drives. Auto-mount and mount by label/uuid won't work though - you have to to mount the drive manually by the device name (i.e. /dev/sda1).
  4. greenythebeast

    greenythebeast Networkin' Nut Member

    You freaking rock teddy_bear! But I'm getting an error when using insmod:

    insmod: can't insert '/opt/hfsplus.ko': invalid module format

    What did I do wrong? :(

    Edit: Figured it out. Do I have to run this command every time the router reboots and if so, where should I put it on the scripts page? Also, does hfsplus support HFS+ with journaling enabled?

    Edit2: Problems! :( When I plug the drive into the router it is given the device name /dev/sdb1. But when I try to mount this it doesn't work (mount: can't find /dev/sdb1 in /etc/fstab)! Am I doing something wrong?
  5. teddy_bear

    teddy_bear LI Guru Member

    What "mount" command are you trying to use? It should be in the following format:
    mount [OPTIONS] device mountpoint
    I guess you're omitting the mountpoint - which makes it too look in /etc/fstab.
  6. greenythebeast

    greenythebeast Networkin' Nut Member

    What should I be mounting it to? I tried: mount /dev/sdb1 /mnt and that didn't work.

    I also tried mount /dev/sdb1 /opt and I got: mount: mounting /dev/sdb1 on /opt failed: Invalid argument
  7. greenythebeast

    greenythebeast Networkin' Nut Member

  8. teddy_bear

    teddy_bear LI Guru Member

    Dunno what's your problem... Both of the following commands work for me just fine (got one of my USB drives formatted as HFS+ to test):

    mount /dev/sdb1 /mmc
    or
    mount -o rw,noatime,nodev /dev/sdb1 /mmc

    /opt should work as well, unless you already have something else mounted on /opt. Or you can create a directory under /mnt, and mount on that new directory...

    BTW, in the next build auto-mount will work even for non-supported file systems as long as the corresponding kernel module is loaded (but not mount by label or uuid though).
  9. greenythebeast

    greenythebeast Networkin' Nut Member

    Both of those didn't work. Is there anyway to check to see if the USB drive is even being recognized by Tomato?

    This is what the log says when attaching the USB drive:

    Aug 28 22:00:09 RT-485B394DE3AD user.info kernel: usb 1-2: new high speed USB device using ehci_hcd and address 6
    Aug 28 22:00:09 RT-485B394DE3AD user.info kernel: usb 1-2: configuration #1 chosen from 1 choice
    Aug 28 22:00:09 RT-485B394DE3AD user.info kernel: scsi4 : SCSI emulation for USB Mass Storage devices
    Aug 28 22:00:09 RT-485B394DE3AD user.debug hotplug[2661]: Attached USB device 1-2:1.0 [INTERFACE=8/6/80 PRODUCT=930/6545/110]
    Aug 28 22:00:11 RT-485B394DE3AD user.notice kernel: scsi 4:0:0:0: Direct-Access USB Flash Memory PMAP PQ: 0 ANSI: 0 CCS
    Aug 28 22:00:14 RT-485B394DE3AD user.notice kernel: sd 4:0:0:0: [sdb] 7823360 512-byte hardware sectors (4006 MB)
    Aug 28 22:00:14 RT-485B394DE3AD user.notice kernel: sd 4:0:0:0: [sdb] Write Protect is off
    Aug 28 22:00:14 RT-485B394DE3AD user.debug kernel: sd 4:0:0:0: [sdb] Mode Sense: 23 00 00 00
    Aug 28 22:00:14 RT-485B394DE3AD user.err kernel: sd 4:0:0:0: [sdb] Assuming drive cache: write through
    Aug 28 22:00:14 RT-485B394DE3AD user.notice kernel: sd 4:0:0:0: [sdb] 7823360 512-byte hardware sectors (4006 MB)
    Aug 28 22:00:14 RT-485B394DE3AD user.notice kernel: sd 4:0:0:0: [sdb] Write Protect is off
    Aug 28 22:00:14 RT-485B394DE3AD user.debug kernel: sd 4:0:0:0: [sdb] Mode Sense: 23 00 00 00
    Aug 28 22:00:14 RT-485B394DE3AD user.err kernel: sd 4:0:0:0: [sdb] Assuming drive cache: write through
    Aug 28 22:00:15 RT-485B394DE3AD user.info kernel: sdb: sdb1
    Aug 28 22:00:15 RT-485B394DE3AD user.notice kernel: sd 4:0:0:0: [sdb] Attached SCSI removable disk
  10. teddy_bear

    teddy_bear LI Guru Member

    Log looks fine.
    Did you load the hfsplus module? What does the "lsmod" command show?
  11. greenythebeast

    greenythebeast Networkin' Nut Member

    lsmod shows:

    Code:
    Module                  Size  Used by    Tainted: P  
    hfsplus                86768  0 
    nls_cp437               5344  0 
    usblp                  15344  0 
    ohci_hcd               21552  0 
    ehci_hcd               40624  0 
    vfat                   11744  0 
    fat                    56112  1 vfat
    ext2                   67712  1 
    ext3                  136576  0 
    jbd                    62048  1 ext3
    mbcache                 7280  2 ext2,ext3
    usb_storage            50048  1 
    sd_mod                 26896  2 
    scsi_wait_scan           960  0 
    scsi_mod              105344  3 usb_storage,sd_mod,scsi_wait_scan
    usbcore               147248  5 usblp,ohci_hcd,ehci_hcd,usb_storage
    nf_nat_pptp             2592  0 
    nf_conntrack_pptp       6000  1 nf_nat_pptp
    nf_nat_proto_gre        2128  1 nf_nat_pptp
    nf_conntrack_proto_gre     4160  1 nf_conntrack_pptp
    nf_nat_ftp              2816  0 
    nf_conntrack_ftp        8160  1 nf_nat_ftp
    nf_nat_sip              4416  0 
    nf_conntrack_sip        9024  1 nf_nat_sip
    nf_nat_h323             7360  0 
    nf_conntrack_h323      49600  1 nf_nat_h323
    tomato_ct               2304  0 
    wl                   2051584  0 
    igs                    17904  1 wl
    emf                    22656  2 wl,igs
    et                     59104  0
  12. teddy_bear

    teddy_bear LI Guru Member

    Well then, the module is loaded... Hard to say what's wrong. I take it you looked at the system log, and it doesn't show anything useful to give you a hint?

    The difference between our drives could be that I don't have a MAC, so I formatted the drive as HFS+ using MacDisk on Windows. Maybe you can try different formatting options (if there are any). Another thing to mention is that HFS+ partitions with journaling enabled are not fully supported by Linux driver - however, you still should be able to mount the drive read-only, and with "force" option even as read-write.
  13. greenythebeast

    greenythebeast Networkin' Nut Member

    Whenever I do the mount command absolutely nothing shows up in the logs.
  14. greenythebeast

    greenythebeast Networkin' Nut Member

    Figured it out! The drive needs to have a Master Boot Record type partition table, not a GUID parition table which is default for Apple drives.

    [strike]Is this any way to add support for GUID partition tables?[/strike]

    Edit: For someone with no working knowledge of Linux, I surprise even myself sometimes. Installing parted via optware, then clearing the boot flag from the EFI partition allows GUID type drives to be mount albeit as the second partition on the drive. But that's not too bad :D
  15. teddy_bear

    teddy_bear LI Guru Member

    I'm glad you figured this one out :)...

    Yep, GUID partition tables support is not compiled into kernel, and you can't add it as a module. So for now your solution is the only way to go, but I'll consider including GPT support in future K26 USB builds - hopefully it won't take much space.
  16. greenythebeast

    greenythebeast Networkin' Nut Member

    Thanks for your help. Couldn't have figured this out without you :D
  17. Glueeater

    Glueeater Serious Server Member

    Could someone enlighten me on how to add the HFS module? I'm a complete noob to all of this.

    I have a drive as HFS and would like to be able to read off it.

    Thanks.
  18. greenythebeast

    greenythebeast Networkin' Nut Member

  19. Amuro

    Amuro Networkin' Nut Member

    hfsplus.ko installed and loaded - checked with lsmod

    Tomato shows the hfs+ partition mounted, but it is empty and the logs show:

    Oct 6 23:29:05 YEH user.err kernel: hfs: walked past end of dir
    Oct 6 23:30:05 YEH user.err kernel: hfs: walked past end of dir


    In google there is a mention on a bug and a possible HD error. If you can clearly explain what is this walked past end of dir it'd be much appreciated..

    I'll check the HD tomorrow for errors and see if that is related or not.
  20. Amuro

    Amuro Networkin' Nut Member

    It was the disk. Repaired it with Diskwarrior, fixed some errors.

    Now drive mounts ro and I can see all directories.

    It is a GUID partition hd formatted in an OS X mac - perhaps TB updated Tomato to read those?
  21. Spacedan

    Spacedan Reformed Router Member

    Getting read only with HFS+ partition

    I've been able to get my HFS+ (non-journaled) partition mounted in Tomato and I can access it with samba, it allows me to copy a file to it just after I mount it in OS X, after that the partition changes to read only.

    Is there a way to maintain the write permission?

Share This Page