What's new

Mount two USB disks by label (RT-AC86U@384.11_2)

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

sashabe

New Around Here
I've bought an RT-AC86U and have 384.11_2 AsusWRT Merlin installed on it. I've got two disks, a HDD and a USB3.0-enabled SSD. The HDD has just one HFS+ partition (sda1, used for Time Machine). The SSD is partitioned into two partitions, one HFS+ (sdb1, used for general file storage) and another ext4 (sdb2, used for entware and swap file). I want the SSD to always stay sdb* since I'd like to disconnect it from time to time from the router and view/modify the contents of the HFS partition on a Mac directly.
Recently I have had some problems with the disks connected on reboot in a wrong order. HDD becomes sdb1 and SSD becomes sda1 and sda2, which obviously breaks some stuff. The solution is said to be labelling the partitions an mounting them by label. How can this be done? Do I need to edit the jffs scripts for that? The partitions are labelled right now — HFS+ partitions through Mac's Finder and ext4 through tune2fs.

This is what blkid is showing now:

/dev/sdb2: LABEL="ENTWARE" UUID="e4b28958-ff35-4e4f-844b-6fe6d48c167e"
/dev/sdb1: LABEL="RFASTDOCS" UUID="5c92871d-2d29-38a9-ade8-dc1fb9e0fecf"
/dev/sda1: LABEL="RouterHDD" UUID="905fe806-f71e-333d-bfb2-fe531254b94f"

Thanks!
 
You can't control the device names generated by the router (e.g. /dev/sda1 or /dev/sdb2). However, if the partition has a valid label then it will use it to create a consistent mount point (e.g. /tmp/mnt/RouterHDD or /tmp/mnt/ENTWARE).
 
Last edited:
You can't control the device names generated by the router (e.g. /dev/sda1 or /dev/sdb2). However, if the partition has a valid label then it will use it to create a consistent mount point (/tmp/mnt/RouterHDD or /tmp/mnt/ENTWARE).
Thanks! I've added the label to the ext4 partition with tune2fs, and now, if i cd && ls to /tmp/mnt, i see the ext4 partition has been mounted by its label. The 2 partitions in HFS+ are still mounted by device names (/tmp/mnt/sda1, /tmp/mnt/sdb1). Is there a way I make the system use the labels that the HFS+ partitions have?
 
Sorry, I don't know why it's not mounting it, I'm not a mac guy. All I know is that it worked for me in testing when I formatted devices using the router's own hfs commands.

You said in post #1 that your devices were labelled, even the ext4 device. But from post #3 we can see that must not have been the case (at least for the ext4 device). I would double check that the hfs devices really do contain a label.
 
mount by lable, example for your SSD

mkdir /tmp/mnt/rfastdocs
mount LABEL="RFASTDOCS" /tmp/mnt/rfastdocs

mkdir /tmp/mnt/entware
mount LABEL="ENTWARE" /tmp/mnt/entware
 
It seems you can't label an HFS+ partition with tune2fs, that utility only works with ext* partitions. Therefore it's not possible to mount an HFS+ partition by label. The label that blkid displays is not the label you can use to mount the partition (it comes from HFS+).

So I ended up reformatting the Time Machine partition (/dev/sda1) from HFS+ to ext4. The good thing is that Time Machine actually supports ext4 for a network drive (probably it supports any FS that the networking device would support, though it's not clear from the official help).

Hence I now have these partitions (mount command output):

/dev/sdb2 on /tmp/mnt/ENTWARE type ext4 (SSD/USB3, for Entware)
/dev/sda1 on /tmp/mnt/ROUTERHDD type ext4 (HDD/USB2, for TM)
/dev/sdb1 on /tmp/mnt/sdb1 type thfsplus (SSD/USB3, for general files)

I hope that now that 2 out of 3 partitions are mounted by label, this situation with mount points changing from time to time won't happen again. Time will show...
If I ever have this problem, I will experiment with mounting the last partition not by label but by UUID (I'd prefer to still have it formatted as HFS+ instead of ext4, which is unreadable under both OS X/Win if connected via USB).
 
I don't know of a way of adding a label to an already formatted HFS+ filesystem, but when I was testing stuff for amtm I could create a label as part of the formatting process on the router.
Code:
newfs_hfs -v HFS_VOLUME_NAME /dev/sdb1

The exact command might vary depending on the model of router you're using.
 
I don't know of a way of adding a label to an already formatted HFS+ filesystem, but when I was testing stuff for amtm I could create a label as part of the formatting process on the router.
Oh, cool! I did not know you can format as HFS on router itself, thanks for the tip.
The question is, can we use the HFS label to create a mount point? As I got to understand it, you cannot, but i might be wrong.
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top