0

I know what your thinking: this question has been asked 100 times before, so why doesn't he just look it up? Well, I did, following this link: AskUbuntu: how to read and write hfs journaled external hdd in ubuntu without access to os

The crux of which is to

  1. install hfsprogs (done) and
  2. sudo mount -t hfsplus -o force,rw /dev/sdd2 /media/legomaniac/Apple

It worked.

My son has come from university for this (Canadian) Thanksgiving weekend and I asked him to bring is 3TB backup drive so I could back up my own drive in preparation for re-building my computer (it was intermittently failing to re-start - turned out to be a failing (and now dead) power supply). I did the above, copied by user profile over to it and all appeared well. In the end, the backup wasn't really necessary as all the SSDs in my computer survived the re-build, but I was just being cautions while I had the machine running.

So now that the computer has been repaired and my files have survived, all I need to do is re-mount the Apple backup drive and shred my financial records, email databases, etc. and then delete the folders.

Of course, now the Apple drive will only mount as Read-Only.

You'll note from the original command the the partition was originally sdd2. To avoid any mishaps, I've removed the other SSDs from my computer leaving me with just my LUbuntu installation and the apple drive:

$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 232.9G  0 disk 
└─sda1   8:1    0 232.9G  0 part /
sdb      8:16   0   2.7T  0 disk 
├─sdb1   8:17   0   200M  0 part 
├─sdb2   8:18   0   2.7T  0 part 
└─sdb3   8:19   0 619.9M  0 part

So, now I'm trying to mount sdb2:

sudo mount -t hfsplus -o force,rw /dev/sdb2 /media/legomaniac/Apple

...which ignores the -o force,rw option and mounts it read-only but doesn't provide any error messages or warnings or explanations about WHY it's ignoring my command. What makes it even more infuriating is the inconsistancy: it's behaving two different ways to exactly the same command. Granted, it was sdd2 the first time but I can't see how that would matter.

So if I can't solve this by Monday, I'm stuck with either buying another 3TB external drive for my son or letting all my financial records walk around a University campus until Christmas.

Lorenz Keel
  • 8,905
  • My apologies: I had thought that cut/paste of a terminal window would remain formatted correctly. I'll try putting hard CRs after every line:NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 232.9G 0 disk └─sda1 8:1 0 232.9G 0 part / sdb 8:16 0 2.7T 0 disk ├─sdb1 8:17 0 200M 0 part ├─sdb2 8:18 0 2.7T 0 part └─sdb3 8:19 0 619.9M 0 part – LEGOManiac Oct 12 '19 at 18:36
  • ...annnnd it didn't work... – LEGOManiac Oct 12 '19 at 18:39
  • How did you determine that it is ignoring the option? Did you look at the output of the mount command without any arguments (or the contents of /etc/mtab) or are you basing it on being unable to write to the device? If the latter, how are you attempting to do so? – steeldriver Oct 12 '19 at 18:43
  • Also, anything in dmesg? – fkraiem Oct 12 '19 at 19:22
  • Frankly, I keep forgetting Linux has logs - so i didn't check them. – LEGOManiac Oct 13 '19 at 00:15
  • I refer to it as "ignoring" the option because it neither responded with an error message to indicate that it wasn't going to mount them in RW mode, despite being told to do so (which would be a really good reason to say something useful). I would then attempt to add a file (right click in the GUI) in the subdirectory I had put my backups in. If I got an option to "Create New...", I had RW access - no such option if it's Read Only. Also, attempting Shift-Delete any file or directory I had put there would result in an error message that would explicitly state it was a Read-Only file system. – LEGOManiac Oct 13 '19 at 00:31
  • I didn't realize that mount could be used without some kind of what, where option so I never tried it until now where I now note that this is the same as typing cat /etc/mtab, the last line of which reads: /dev/sdb2 /media/matthias/Apple hfsplus ro,relatime,umask=22,uid=0,gid=0,nls=utf8 0 0 – LEGOManiac Oct 13 '19 at 00:32
  • As stated, I keep forgetting there are logs. The output of dmesg is flooded with: usb 1-1.5: reset high-speed USB device number 5 using ehci-pci – LEGOManiac Oct 13 '19 at 00:35
  • I should be more specific because it may be relevant. The output from dmesg is actually: [28009.923880] usb 1-1.5: reset high-speed USB device number 5 using ehci-pci Now, I say this may be relevant because I don't recongnize [28009.923880] as a date/time stamp, so I don't know how recent this is. Looking up the error message, I found someone stating that USB port resets are a drastic step taken by the controller, typically indicating a power supply problem, and that's exactly the symptom my system was showing before the power supply failed: my USB port activity lights.. – LEGOManiac Oct 13 '19 at 00:42
  • ...were flashing like Christmas trees without anything even plugged into them. After several minutes of this my system shut down and wouldn't re-start. That's what started this ordeal - the need to replace the power supply and remove a bunch of smaller SSDs, but only after backing them up...So the dmseg entries may be what happened before the crash and not what's happening now. – LEGOManiac Oct 13 '19 at 00:45
  • Just checked dmesg again and those error messages are continuing to pile up. I had added a new USB3.0 hub, so I'll try removing it. – LEGOManiac Oct 13 '19 at 00:48
  • I've unplugged all my USB devices except keyboard and mouse (both wireless) and the dmesg errors continue. I'm not sure that it isn't a red herring, though, since I could read from the Apple drive, just not write to it and if I was having critical USB problems I should think I couldn't do either. I just added a Seagate USB drive and it mounts RW. Tried mounting the Apple drive to the same USB port and it's still Read-Only after sudo mount -t hfsplus -o force,rw /dev/sdb2 /media/legomaniac/Apple – LEGOManiac Oct 13 '19 at 00:59
  • Ran: dmesg; sleep 30 ; dmesg while unplugging my keyboard and mouse dongles to see if dmesg would still receive errors after they were unplugged. The errors continue. Just found troublesome USB device #5 - it was the computer cases built-in sd card reader. It's unplugged now. Confirmed that the USB errors were a red herring - the Apple drive still mounts read-only – LEGOManiac Oct 13 '19 at 01:14
  • Now that I'm not buried in USB error messages the last line of dmesg is (on mounting the Apple drive): [30430.134082] hfsplus: Filesystem was not cleanly unmounted, running fsck.hfsplus is recommended. mounting read-only. – LEGOManiac Oct 13 '19 at 01:19
  • Running fsck.hfsplus /dev/sdb2 complains that it's a journaled volume. Running fsck.hfsplus -f /dev/sdb2 says ** /dev/sdb2 / ** Checking HFS Plus volume. / ** Checking Extents Overflow file. / ** Checking Catalog file. / Invalid map node linkage / (4, 43264) / ** Volume check failed. Sorry for the use of " / " but I don't know how to prevent the cut/paste from getting garbled. – LEGOManiac Oct 13 '19 at 01:23
  • Now checking this link: https://unix.stackexchange.com/questions/160068/how-to-fix-invalid-map-node-linkage Which specifically refers to this problem. – LEGOManiac Oct 13 '19 at 01:36

1 Answers1

0

So it turns out that the Stackexchange.com question I linked to had the correct answer:

fsck.hfsplus -fryd /dev/sdb2

was what I needed to do to fix the file system on the drive after which I was able to mount it in Read-Write mode and delete my files.

All my error messages about USB resets were a red herring that flooded the dmsg logs and made it difficult to find the truly relevant error message.