On Wed, 19 Sep 2018 04:48:33 -0000 (UTC), Arlen Holder wrote:
> Following is a description of an elegant method that uses ZERO additional
> software other than the native operating system on all the devices, and
> which works with ALL iOS, Android, Windows, and Linux devices without
> needing root on any.
For all your Mac users, we just extended our solution to include the Mac!
With the help of Aragorn, and that of Paul, Mike Easter, and Wolffan,
it seems like we have the Mac interfacing to the real world problem
(ostensibly) resolved such that this seems to be our new-found
capabilities:
1. We can boot our original Mac or Windows desktop to Ubuntu 18.04
2. Then we can connect *any* iOS device on the planet for full r/w access
3. We can also connect any Android device for even better full r/w access
4. Likely we can connect any USB drive or camera also (as an aside)
5. With simultaneous full r/w access to the original desktop filesystem!
All without installing _anything_ non-native on any of the systems above,
with the exception of the easily installed open-source freeware hfsprogs
for writing to the journaled Mac HFS+ file system.
I hope others, who actually know far more than I do, will look over
(and hopefully test!) the compilation below so that we can hone it for
everyone to benefit in the future in our tribal archives
(where I personally set up the tinyurl myself, many years ago,
so that everyone benefits from our combined knowledge!):
*TRIBAL ARCHIVES:*
http://tinyurl.com/rec-photo-digital
<
https://groups.google.com/forum/#!topic/rec.photo.digital/8Qd8kcV2Trg>
http://rec.photo.digital.narkive.com
<
http://rec.photo.digital.narkive.com/mmVPsOjz/an-elegant-solution-to-managing-digital-files-on-any-ios-android-windows-or-linux-device>
http://tinyurl.com/alt-comp-freeware
<
https://groups.google.com/forum/#!topic/alt.comp.freeware/H6T7KqzR_ww>
http://rec.photo.digital.narkive.com
<
http://alt.comp.freeware.narkive.com/rvudZEGW/an-elegant-solution-to-managing-digital-files-on-any-ios-android-windows-or-linux-device>
****************************************************************************
How to read & write to HFS+ partitions by booting to Ubuntu (on the Mac)
!!!WIP ... Untested! ... Preliminary - for review!!!
Please improve so that everyone benefits from every action by each of us.
(See also <
https://groups.google.com/forum/#!topic/misc.phone.mobile.iphone/IFC52JXBQ1c>
****************************************************************************
============================================================================
Your choice (works both ways):
a. Journaling disabled
b. Journaling enabled
============================================================================
Read/Write access to a non-journaled HFS+ drive.
1. Plug in the external HFS+ non-journeled drive into Ubuntu.
2. Ubuntu mounts the HFS+ drive automatically as read-only.
$ mount -l
Your HFS+ device should show up as /dev/sdx
If the drive doesn't automatically mount, mount the HFS+ drive:
$ sudo mount -t hfsplus -o force,rw /dev/sdx# /media/mntpoint
3. Click the eject button in file explorer to unmount the drive.
4. Install hfsprogs.
$ sudo apt-get install hfsprogs
5. Optional: Check the drive.
$ sudo fsck.hfsplus /dev/sdXY
6. Click on the drive in the file explorer to remount the drive as r/w:
Note: To manually remount the HFS+ drive:
$ sudo mount -t hfsplus -o remount,force,rw /dev/sdx# /mount/point
============================================================================
Read/Write access to a journaled HFS+ drive.
1. Plug in the external HFS+ non-journeled drive into Ubuntu.
2. Ubuntu mounts the HFS+ drive automatically as read-only.
$ mount -l
Your HFS+ device should show up as /dev/sdx
If the drive doesn't automatically mount, mount the HFS+ drive:
$ sudo mount -t hfsplus -o force,rw /dev/sdx# /media/mntpoint
3. Click the eject button in file explorer to unmount the drive.
4. Install hfsprogs.
$ sudo apt-get install hfsprogs
5. Optional: Check the drive.
$ sudo fsck.hfsplus -f /dev/sdXY
6. Click on the drive in the file explorer to remount the drive as r/w:
Note: To manually remount the HFS+ drive:
$ sudo mount -t hfsplus -o remount,force,rw /dev/sdx# /mount/point
============================================================================
To read/write on the Mac users' home folder, simply match the User ID:
1. On OS/X, check your UID (typically the default is UID 501):
OS/X: System Preferences > your username > Advanced Options
2. Boot into Ubuntu & add a temp user of the same UID as found above:
$ sudo useradd -d /home/tempuser -m -s /bin/bash -G admin tempuser
$ sudo passwd tempuser
$ sudo usermod --uid 501 yourusername
$ sudo chown -R 501:yourusername /home/yourusername
You can now read & write to both your Mac and Linux user's home folder,
no matter which OS you're logged into.
3. Optionally, add the new user of UID 501 to the Ubuntu login screen:
By default, Ubuntu doesn't list users of UID less than 1000 on the
login screen, where this command changes that default value:
$ gksudo gedit /etc/login.defs
Simply change the value of UID_MIN from 1000 to 501
============================================================================
To turn off HFS+ journaling from the Mac
1. Boot into OS X and fire up the Disk Utility.
2. Click on your HFS partition, hold the Option key, and click File
3. A new option to Disable Journaling will come up in the menu.
4. When you reboot to Linux, it will mount the HFS+ drive r/w automatically
============================================================================
To turn off HFS+ journaling from within Ubuntu
1. Compile disable_journal.c to disable_journal.out
$ gcc -o disable_journal disable_journal.c
2. Run the program to disable journaling.
$ sudo ./disable_journal.out /dev/sdXX
where /dev/sdXX is the partition you wish to mount.
3. Then mount the HFS+ drive using the following:
$ sudo mount -t hfsplus -o rw,user /dev/sdXX /media/hfspart
--- cut here for disable_journal.c ---
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <byteswap.h>
int main(int argc, char *argv[])
{
int fd = open(argv[1], O_RDWR);
if(fd < 0) {
perror("open");
return -1;
}
unsigned char *buffer = (unsigned char *)mmap(NULL, 2048, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
if(buffer == (unsigned char*)0xffffffff) {
perror("mmap");
return -1;
}
if((buffer[1024] != 'H') && (buffer[1025] != '+')) {
fprintf(stderr, "%s: HFS+ signature not found -- aborting.\n", argv[0]);
return -1;
}
unsigned long attributes = *(unsigned long *)(&buffer[1028]);
attributes = bswap_32(attributes);
printf("attributes = 0x%8.8lx\n", attributes);
if(!(attributes & 0x00002000)) {
printf("kHFSVolumeJournaledBit not currently set in the volume attributes field.\n");
}
attributes &= 0xffffdfff;
attributes = bswap_32(attributes);
*(unsigned long *)(&buffer[1028]) = attributes;
buffer[1032] = '1';
buffer[1033] = '0';
buffer[1034] = '.';
buffer[1035] = '0';
buffer[1036] = 0;
buffer[1037] = 0;
buffer[1038] = 0;
buffer[1039] = 0;
printf("journal has been disabled.\n");
return 0;
}
--- cut here for disable_journal.c ---
============================================================================
For commercial solutions:
1. Paragon has an extension for full read/write access to NTFS & HFS+ volumes
<
https://www.paragon-software.com/home/ntfs-linux-professional/>
NOTE: They have a freeware version available for non-commercial use.
2. Paragon has an add-on extension for full APFS (read-write access)
<
https://www.paragon-software.com/business/apfs-linux/>
============================================================================
REFERENCES (in alphabetical order):
<
http://askubuntu.com/questions/332315/how-to-read-and-write-hfs-journaled-external-hdd-in-ubuntu-without-access-to-os>
<
http://jaysonlorenzen.wordpress.com/2010/09/13/linux-unable-to-write-to-non-journaled-hfsplus-drive/>
<
http://lifehacker.com/5702815/the-complete-guide-to-sharing-your-data-across-multiple-operating-systems>
<
http://lifewire.com/dual-boot-linux-and-mac-os-4125733>
<
http://pastebin.com/W8pfgHRe>
<
http://refit.sourceforge.net/info/boot_process.html>
<
http://superuser.com/questions/84446/how-to-mount-a-hfs-partition-in-ubuntu-as-read-write>
<
http://ubuntuforums.org/showthread.php?t=1420673>
===========================================================================
===========================================================================