HFS+ in TomatoUSB

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

  1. greenythebeast

    greenythebeast LI Guru 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 LI Guru 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 Network 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 LI Guru 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 Network 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 LI Guru 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 LI Guru Member

    Any ideas?
  8. teddy_bear

    teddy_bear Network 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
    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 LI Guru 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 Network Guru Member

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

    greenythebeast LI Guru Member

    lsmod shows:

    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 Network 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 LI Guru Member

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

    greenythebeast LI Guru 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 Network 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 LI Guru Member

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

    Glueeater Networkin' Nut 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.

  18. greenythebeast

    greenythebeast LI Guru Member

  19. Amuro

    Amuro Addicted to LI 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 Addicted to LI 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 Networkin' Nut 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?
  22. Rnt000

    Rnt000 New Member Member

    I know the topic is old, but how you solved the problem of invalid module format??

    Smashing my head here
  23. Monk E. Boy

    Monk E. Boy Network Guru Member

    You may need to format the drive using APM (Apple Partition Map) instead of GPT on a Mac. This module is quite old. I don't know how it and Tomato's GPT support will interact, since the latter was added to Tomato after this module was created.

    I could try formatting a USB stick after I get home tonight, then connect it to my N66 and report back.
  24. koitsu

    koitsu Network Guru Member

    User Rnt000 is now posting in two places about this subject: this thread, and the "big long never-ending Toastman thread". This does not help keep things organised.

    I've taken my response in that thread and placed it below, because this conversation needs to be in one place.

    No. The link I provide there is for Ubuntu circa late 2010; Tomato is even older. The problem is with Linux's HFS's support, and has absolutely nothing to do with Tomato (other than maybe Tomato using an older Linux kernel). This doesn't help either. There are also a ton of limitations and complexities (read what's posted there, don't skim it), and that's on a "semi-recent" Linux (Tomato uses substantially older Linux because of reliance on binary blob wireless drivers from Broadcom, i.e. our hands are tied).

    The Paragon HFS+ driver might work, but someone would need to ask them if it works on Linux 2.6.22 (MIPS) and 2.6.34 (ARM), as well as be able to put in the time to add it to the source tree + get it working (plus have an OS X system to test with); I also have no idea what the difference is between the "free" driver and the "paid" driver (the latter almost sounds like it'd provide write support or something? I don't know). A "paid" driver isn't something we could include in Tomato for licensing reasons.

    What exactly are you using HFS+ for on a Tomato router? This is very confusing (I would ask this same question of someone on the Windows side using NTFS). If you're using Tomato as some sort of NAS where you regularly like to yank the drives out (that sort of goes against using it as a NAS ;-) ), why not approach it from a different level and find out if OS X supports ext2 or ext3? Linux (thus Tomato) supports both wonderfully.
    Rnt000 likes this.
  25. Rnt000

    Rnt000 New Member Member

    Got it!
    Sorry for the double post.

    I understood the problems related with HFS+, and I will consider using a different format.

    not to be long, the reason is that I use a OSX macbooc 12", that does not have easy usb port access.
    I do also work with photography and use Photos from Apple to keep things organized.
    Readed in a lot of places, that other file systems may corrupt the photo database and block it from work.

    Today, I have an Airport Express, connected to my DIR 868L, but the performance is lame, I Would like to have something much faster than this.

    I will do the following, format another hard drive with ext4 and try to use the Photos database stored on it, will post results later.

    Any other suggestions are very welcome.

    Thank you!
  26. koitsu

    koitsu Network Guru Member

    Few things here:

    1. I'm not understanding the logic here. "I use an OS X Macbook 12" which doesn't have easy USB port access". Okay, so, why would you want HFS+ support for a USB attached device on Tomato if the other system you're plugging it into...... doesn't have a USB port (or an easy-to-access one)? I'm really confused about this.

    What is dictating that you use HFS+ on a USB-attached medium if the system you're using (re: Macbook) doesn't have a USB port? This is very confusing to me. But my confusion gets worse:

    Googling shows me that Macbook 12" products (recent ones) have a USB type C port... if so, what do you mean by "does not have easy USB port access?" You buy the USB-C to USB adapter from Apple (that's Apple for you!), you're done. What's not easy? I'm missing some piece of this puzzle.

    2. You said ext4. Where did you get ext4 from? I said ext2 or ext3 and I meant it. Tomato does not support ext4 (I believe Shibby tried to put some time into that, but 138 is a mess, so um, yeah...). ext2 and ext3 are "tried and true" and supported by Linux. OS X is partially based on FreeBSD (hint: I'm a FreeBSD systems administrator since 1997), and I can tell you FreeBSD has ext2 (not ext3) support (since FreeBSD 2.2: that was in 1997!), so certainly OS X should...? It may be a FUSE module that is needed (i.e. the I/O is not going to be very good), but the important thing is that R/W works reliably there.

    Are you ready for the real kicker? This will certainly present laughter, almost irony. OS X supports UFS very well (which is what FreeBSD uses, well, UFS/FFS specifically, and also what Solaris uses). However, Linux support for read-write UFS is considered "dangerous". Quoting the Linux kernel config file:

    tristate 'UFS file system support (read only)' CONFIG_UFS_FS
    dep_mbool '  UFS file system write support (DANGEROUS)' CONFIG_UFS_FS_WRITE $CONFIG_UFS_FS $CONFIG_EXPERIMENTAL
    Laughing yet? :) So what I'm trying to convey is that the reality is that there really isn't a "true" filesystem that is 100% supported across all OSes reliably, and one which also takes into consideration/account the fact that Tomato runs on an older kernel (and has to). Windows is hellbent on NTFS, which *IX operating systems don't like very much. OS X is hellbent on HFS+, which nothing else likes very much. Linux is hellbent on ext2/ext3/ext4, which other OSes don't like very much. The one that seems to work (mostly) well across the board is... FAT32. That's the rub. (No I do not recommend you use that, LOL, especially for a large-capacity disk)

    And finally: you need to be aware that USB access on Tomato routers is slow. USB 2.0, USB 3.0, doesn't matter. If you are expecting "full balls-to-the-wall speed" like on a desktop, you're not going to get it. These consumer routers are designed with 2 things in mind: NAT and packet forwarding. They push packets. They aren't NASes. They don't have dedicated USB controllers (at least not like on a desktop/laptop) with offloading and DMA and processing. The USB layer of the SoC does it all, but a lot of it is CPU-bound. The CIFS/SMB layer in Samba is PURELY software to boot (i.e. 100% CPU). So don't expect high performance. I mention this because you brought up performance in general being a concern point.

    If I were you, I would stick with not involving my router in any part of the picture for what you do. I don't have any "magic solutions" for you, but I can tell you that it sounds like you want an actual NAS, esp. considering you want performance. Tomato is not a NAS. Look into devices like the Drobo or QNAP stuff. The performance there is quite impressive.
    Monk E. Boy likes this.
  27. Monk E. Boy

    Monk E. Boy Network Guru Member

    Actually, Apple is about to replace HFS+ with APFS (APple File System), which won't be readable by any older OS. It was originally going to be rolled out with 10.11, then was rolled out in the 10.12 private betas from what I was told but pulled before the public betas and general release, but they're pretty hell bent on getting it in due to the perceived deficiencies of HFS+.

    Short of hacking it in with something like macports, I haven't found a good way to add ext2/ext3 support to OS X, and even then it's purely terminal driven (kind of like ntfs-3g through macports). There may be a way, there probably is a way, I just haven't found one.
  28. Rnt000

    Rnt000 New Member Member

    Well, out of everything you said, guess you are right about my mistake on tomato use.

    Let me make my points clear.
    1. Yeah, it does have the shitty USB-C thing, that either, you connect a HDMI, or the SD card, Or some USB Or the charger...

    See the number of OR? This is what i've meant by easy usb access, this multi purpose adapters sucks, they heats a lot, drain power and makes the use of the computer be awful, in my case, I'm usually working with 2 HD and a SD card, so if I can keep only with the SD card on notebook, and transfer the stuff directly to a Network drive, it would really help a lot.
    Actually, I do this at the moment using my old 300 mb/s airport express, but well, 300 mb/s with 100 mb/s ethernet link to tomato doesn't work as it could.

    2. Yeah, I just missed out the ext types, need to read a little about them, and I have read ppl have several problems with fat32 and exfat, so I guess those are risked of.

    Finally, i'm getting your advice about not using tomato as a NAS, will try something different as solution.
  29. Rnt000

    Rnt000 New Member Member

    Also, you are right, OSX is ditching HFS+, so, no point of heating the brain to make it work
  30. Monk E. Boy

    Monk E. Boy Network Guru Member

    Oh, you have THAT Macbook. You probably want to look into a charge/sync hub that basically charges the MB and gives you a bunch of USB A ports on the hub to plug in devices to it. Its expensive but cheaper than buying a bunch of USB C things and trying to swap them around.

    I really detest all the laptops Apple's made since the 2012 non-Retina. They're just awful and seem geared towards making Apple more profitable, not at providing a better value to the customer.
    Toastman, Rnt000 and koitsu like this.
  31. Rnt000

    Rnt000 New Member Member

    Exactly THAT Macbook!!
    It is good because of lightweight and battery life, cannot deny that.
    But I think I'm still not ready to dismiss all of usb A and HDMI and SD ports.

    I admit I would not like to buy one of these hubs for the reasons I said before, heating, battery drain, and goes on.

    But maybe it really is the only way out.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice