Changing a read-only filesystem to read-write?

Asked by Ron DeRosier

I am new to Ubuntu and Linux in general. I have dual-boot system
alongside Mac OS X. I have an external drive /dev/sdb which I can
only access read-only (why it defaults to this I don't know) and I
would like to access it read-write so I can move files between my
Linux account and my Mac account (which both reside on /dev/sda).

The file /etc/fstab contains:

# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda4 during installation
UUID=5cc84ee7-f090-498d-9294-09a18e532d3f / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=acd1fb00-dcf3-45f1-a3b1-77dc95c5b44d none swap sw 0 0

The file /etc/mtab contains:

/dev/sda4 / ext4 rw,errors=remount-ro 0 0
proc /proc proc rw,noexec,nosuid,nodev 0 0
none /sys sysfs rw,noexec,nosuid,nodev 0 0
none /sys/fs/fuse/connections fusectl rw 0 0
none /sys/kernel/debug debugfs rw 0 0
none /sys/kernel/security securityfs rw 0 0
none /dev devtmpfs rw,mode=0755 0 0
none /dev/pts devpts rw,noexec,nosuid,gid=5,mode=0620 0 0
none /dev/shm tmpfs rw,nosuid,nodev 0 0
none /var/run tmpfs rw,nosuid,mode=0755 0 0
none /var/lock tmpfs rw,noexec,nosuid,nodev 0 0
none /lib/init/rw tmpfs rw,nosuid,mode=0755 0 0
none /var/lib/ureadahead/debugfs debugfs rw,relatime 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,noexec,nosuid,nodev 0 0
gvfs-fuse-daemon /home/rcd/.gvfs fuse.gvfs-fuse-daemon rw,nosuid,nodev,user=rcd 0 0
/dev/sdb3 /media/RonHD hfsplus rw,nosuid,nodev,uhelper=udisks 0 0

What do I need to do to have read-write access from Linux to my
external drive /dev/sdb?

(For extra credit: Is it possible to have direct access between my Linux
and Mac filesystems which are both on /dev/sda - partition sda2 for Mac
and partition sda4 for Linux? This would be convenient. I can see my
MacHD from Linux but I cannot see anything about Linux from MacHD.)

Thanks

Ron

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu util-linux Edit question
Assignee:
No assignee Edit question
Solved by:
Ron DeRosier
Solved:
Last query:
Last reply:
Revision history for this message
Daniel Dräs (g-kar) said :
#1

Hi Ron,

for direct access from mac to your linux drives check this out: http://sourceforge.net/projects/ext2fsx/

This works at least for ext2 drives, don't know if it can read the default ubuntu filesystem as this is ext4.

For the RO-filesystem: Did you try to write files as superuser (root) ? May be it is only a privilege issue.

Daniel

Revision history for this message
Sam_ (and-sam) said :
#2

> partition sda2 for Mac

I don't see sda2 in your fstab.
https://help.ubuntu.com/community/Fstab#hfs+

What's the partition table.
sudo fdisk -l
## where l is lower case of L

What is mounted anyway.
mount

Find out UUID and read it into cache.
sudo blkid

Before a partiton can be mounted it needs a mountpoint and user needs permission to access.
Gathered information needs to be written into /etc/fstab.

Lets say the mountpoint is /media/mac
sudo chown -R user:group /media/mac

e.g. entry in fstab:
# /dev/sda2
UUID=bbf85ecb-cc61-40ed-ba7b-d7b804ee845e hfsplus rw,exec,auto,users 0 0

## Note: fstab must have an empty last line, otherwise you may get an error saying 'missing final new line'.
After finished with editing fstab reread it:
sudo mount -a
or
reboot

https://help.ubuntu.com/community/Mount
https://help.ubuntu.com/community/MoveMountpointHowto
https://help.ubuntu.com/community/DrivesAndPartitions

Revision history for this message
Sam_ (and-sam) said :
#3
Revision history for this message
Sam_ (and-sam) said :
#4
Revision history for this message
Ron DeRosier (nuclearpower) said :
#5

Sam,

You pointed me at:

https://help.ubuntu.com/community/MacBookPro1-1_1-2/Intrepid#Allow%20Writing%20to%20HFS+%20%28OS%20X%29%20Partitions

which states:

Allow Writing to HFS+ (OS X) Partitions

The hfsplus drivers for Ubuntu cannot handle journaling, and thus can't
write to HFS+ partitions with journals, though they can still be read.
To allow writing, journaling must be disabled in OS X. However, please
note that this may increase the risk of filesystem corruption, even in
OS X itself. To disable journaling, use diskutil in a terminal in OS X
(this can also be done with the installation media), replacing / for
the desired volume if applicable:

sudo /usr/sbin/diskutil disableJournal /

I USE MAC OS X A LOT AND I'M NEW TO UBUNTU/LINUX, SO I'D BE SCARED TO DEATH
TO DISABLE JOURNALING AS SUGGESTED ABOVE!

Maybe I could split my RonHD drive into two partitions, one as hfs+ for
Mac OS X and the other as ext4 (if that's possible) for Linux. Then I would
only mount the ext4 partition. Would that work?

Anyway, the output you asked for is displayed below.

Thanks

Ron

-------------
sudo fdisk -l
-------------

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot Start End Blocks Id System
/dev/sda1 1 26 204819+ ee GPT
/dev/sda2 * 26 24447 196165392 af HFS / HFS+
/dev/sda3 24448 38320 111433728 83 Linux

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/sdb doesn't contain a valid partition table <<<< IS THIS A PROBLEM?

-----
mount
-----

/dev/sda4 on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
none on /dev type devtmpfs (rw,mode=0755)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
none on /dev/shm type tmpfs (rw,nosuid,nodev)
none on /var/run type tmpfs (rw,nosuid,mode=0755)
none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
none on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
none on /var/lib/ureadahead/debugfs type debugfs (rw,relatime)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /home/rcd/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=rcd)
/dev/sdb3 on /media/RonHD type hfsplus (rw,nosuid,nodev,uhelper=udisks)

----------
sudo blkid
----------

/dev/sda1: LABEL="EFI" UUID="70D6-1701" TYPE="vfat"
/dev/sda2: UUID="5c81d14b-08b7-3251-bb88-b5a23e16d6bf" LABEL="MacHD" TYPE="hfsplus"
/dev/sda4: UUID="5cc84ee7-f090-498d-9294-09a18e532d3f" TYPE="ext4"
/dev/sda5: UUID="acd1fb00-dcf3-45f1-a3b1-77dc95c5b44d" TYPE="swap"
/dev/sdb3: UUID="c90a553a-9e96-39b6-bbba-9a6b6ad72a6c" LABEL="RonHD" TYPE="hfsplus"

Revision history for this message
Ron DeRosier (nuclearpower) said :
#6

Because Ubuntu does not handle Mac OS X HFS+ Journaled filesystems,
I've gone ahead and split my external drive into HFS+ and FAT32.