Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Ext4 Root Filesystem Always Read-Only (Mac Air '13)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
g00gler
n00b
n00b


Joined: 25 Jul 2010
Posts: 38

PostPosted: Mon Mar 31, 2014 10:52 pm    Post subject: [SOLVED] Ext4 Root Filesystem Always Read-Only (Mac Air '13) Reply with quote

Hello everyone,

I have the latest Macbook Air from Apple and I was more or less successful in getting Gentoo to actually boot. I am using the 3.12.13 Gentoo linux kernel, amd64. However, I am unsure as to what step I took which causes my root filesystem "/" (I only have one dedicated partition for Gentoo) to get mounted as read-only. It is an ext4 filesystem. A fsck is called at each boot-up. I am not certain if it is something I did or something outside of this that I am unaware of.

Further, I notice that when I select "boot an existing linux installation from the hard disk" in SystemRescueCD, I'm fully able to have a read-write filesystem and fully working Gentoo environment after booting is complete. This perhaps means that my grub2 configuration is correct. I am using rEFInd, with a gentoox64.efi file in my EFI System Partition on my Mac.

I was searching for how to remove "ro" from the root filesystem boot options in grub2 but it seems difficult to get /etc/default/grub to show a "rw" option that overwrites existing readwrite flags in /boot/grub/grub.cfg.

If those interested would like to see output, I am not familiar with the best method for getting init readings to a text file for pasting in this forum. A good method/tip for how to do this would be helpful.

EDIT/ADDITIONAL: Here's my /etc/fstab:

Code:

# /etc/fstab: static file system information.
#
# noatime turns off atimes for increased performance (atimes normally aren't
# needed); notail increases performance of ReiserFS (at the expense of storage
# efficiency).  It's safe to drop the noatime options if you want and to
# switch between notail / tail freely.
#
# The root filesystem should have a pass number of either 0 or 1.
# All other filesystems should have a pass number of 0 or greater than 1.
#
# See the manpage fstab(5) for more information.
#

# <fs>         <mountpoint>   <type>      <opts>      <dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
/dev/sda4      /      ext4      noatime      0 1


Thank you very much.
_________________
Q: "How are discoveries made, in your opinion?"

Einstein: "A group of scientists puzzling over the impossible gather for a meeting. One of them arrives late having solved....the mystery of where the cheese was!"


Last edited by g00gler on Wed Apr 09, 2014 8:43 am; edited 3 times in total
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7550
Location: Goose Creek SC

PostPosted: Wed Apr 02, 2014 5:36 am    Post subject: Reply with quote

Code:
  mount -o remount,rw / 
should change the mode

not having some of
Quote:
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
CONFIG_HOTPLUG=y
CONFIG_FSNOTIFY=y
CONFIG_DNOTIFY=y
CONFIG_INOTIFY_USER=y
CONFIG_NET=y
CONFIG_PROC_FS=y
CONFIG_SIGNALFD=y
CONFIG_SYSFS=y
CONFIG_SYSFS_DEPRECATED is not set
CONFIG_UEVENT_HELPER_PATH=""
CONFIG_BLK_DEV_BSG=y
CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y
CONFIG_TMPFS_XATTR=y
configured in the kernel ( /usr/src/linux/.config ) has been reported as causing the root partition to stay readonly. if you find some that need a change, don't edit directly, use menuconfig to make changes.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
g00gler
n00b
n00b


Joined: 25 Jul 2010
Posts: 38

PostPosted: Fri Apr 04, 2014 1:14 pm    Post subject: Reply with quote

Code:
mount -o remount,rw /
worked to allow read-write access, thanks. I still have to enter this manually, however. I have yet to confirm what my kernel config is like with respect to the requirements posted. Working on it in meanwhiles.
_________________
Q: "How are discoveries made, in your opinion?"

Einstein: "A group of scientists puzzling over the impossible gather for a meeting. One of them arrives late having solved....the mystery of where the cheese was!"
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7550
Location: Goose Creek SC

PostPosted: Fri Apr 04, 2014 6:16 pm    Post subject: Reply with quote

one way:
Code:
ls -a  /usr/src/linux/.config
yielding
Quote:
/usr/src/linux/.config
means a config file exists where it should be and may have been used to build the running kernel
Code:
ls /proc/config.gz
yielding
Quote:
/proc/config.gz
means the config file that was used in building the kernel was saved as part of the kernel
zgrep -i devtmpfs /proc/config.gz yielding
Quote:
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
means those two items are built into the running kernel
Code:
grep -i devtmpfs /usr/src/linux/.config
yielding
Quote:
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
means those two items should be built into the running kernel if it was built using /usr/src/linux/.config Similar for the rest of the search terms
_________________
Defund the FCC.
Back to top
View user's profile Send private message
g00gler
n00b
n00b


Joined: 25 Jul 2010
Posts: 38

PostPosted: Sun Apr 06, 2014 5:25 am    Post subject: Reply with quote

I found:

Code:
# CONFIG_DEVTMPFS_MOUNT is not set


,this (when searching for "hotplug"):

Code:

# CONFIG_MEMORY_HOTPLUG is not set
CONFIG_HOTPLUG_CPU=y
# CONFIG_BOOTPARAM_HOTPLUG_CPU0 is not set
# CONFIG_DEBUG_HOTPLUG_CPU0 is not set
CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
CONFIG_ACPI_HOTPLUG_CPU=y
# CONFIG_HOTPLUG_PCI is not set


and this, when "" was expected for the path:
Code:

CONFIG_UEVENT_HELPER_PATH="/sbin/udevadm"


I just want to confirm first that DEVTMPFS and UEVENT_HELPER are the only two problems and not HOTPLUG-ging too, by the info I've given above.

In case you need it for your reference, the command I used to compile my kernel this time around before I had the read-only issue was:
Code:

genkernel --firmware --busybox --disklabel --all-ramdisk-modules --install all


Thanks.
_________________
Q: "How are discoveries made, in your opinion?"

Einstein: "A group of scientists puzzling over the impossible gather for a meeting. One of them arrives late having solved....the mystery of where the cheese was!"
Back to top
View user's profile Send private message
hellspawnV01
n00b
n00b


Joined: 06 Apr 2014
Posts: 9

PostPosted: Sun Apr 06, 2014 6:41 am    Post subject: Reply with quote

In your kernel menuconfig... Are the ext4 sets set to Module or *enabled? Save for clearly "DEPRECIATED"
Back to top
View user's profile Send private message
g00gler
n00b
n00b


Joined: 25 Jul 2010
Posts: 38

PostPosted: Sun Apr 06, 2014 7:57 am    Post subject: Reply with quote

If I am understanding you correctly (just-above poster), your question was about the nature of my ext4 fs settings in my kernel config:

Code:

CONFIG_EXT4_FS=y
CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_EXT4_FS_SECURITY=y
# CONFIG_EXT4_DEBUG is not set


My filesystem is able to be mounted, so the system is recognizing it.
_________________
Q: "How are discoveries made, in your opinion?"

Einstein: "A group of scientists puzzling over the impossible gather for a meeting. One of them arrives late having solved....the mystery of where the cheese was!"


Last edited by g00gler on Wed Apr 09, 2014 8:44 am; edited 1 time in total
Back to top
View user's profile Send private message
hellspawnV01
n00b
n00b


Joined: 06 Apr 2014
Posts: 9

PostPosted: Sun Apr 06, 2014 9:36 am    Post subject: Reply with quote

To relate a similar instance... Though my issue was with NTFS and FAT32 mounts. Without additional modules or firmware read-only was the only option. The solution of course just compile ntfs3d then reconfigure fstab...

There are additional sets available for extX filesystems. Consider those if needed. and TRY adding default to your fstab "/dev/sda4 / ext4 default, noatime 0 1"

How are you booting? Bootcamp? GRUB can be very tricky with apple hardware.

PS: Don't forget to update grub when modifying your fstab.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7550
Location: Goose Creek SC

PostPosted: Sun Apr 06, 2014 6:21 pm    Post subject: Reply with quote

hotplug result looks like
Quote:
zgrep -i hotplug /proc/config.gz
# CONFIG_MEMORY_HOTPLUG is not set
# CONFIG_HOTPLUG_CPU is not set
CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
# CONFIG_HOTPLUG_PCI is not set
here; your result looks all right to me. apparently CONFIG_HOTPLUG=y was replaced by several separate commands

CONFIG_DEVTMPFS_MOUNT, theoretically is not needed now, pragmatically I needed it before to cure read-only, have kept it and have not had it cause me a problem.

Quote:
zgrep -i uevent /proc/config.gz
CONFIG_UEVENT_HELPER_PATH=""
is still in use here, I needed it before to cure read-only, have kept it and have not had it cause me a problem.

adding rootfstype=ext4 to the kernel command line in the bootloader has occasionally been reported to cure the ro problem

I seldom use genkernel, just to evaluate problems here,
Code:
genkernel --menuconfig all
has been my most elaborate invocation. I can't guess whether the set of options you used could be involved. It is worth noting that package genkernel is now masked and genkernel-next is umasked in portage and particularly recommended for use with systemd. Even though the package is genkernel-next, the command to invoke it is genkernel

if you are using openrc as init system and if
Code:
grep -i rc_parallel /etc/rc.conf
yields rc_parallel="YES" suggest comment it out or change to NO
_________________
Defund the FCC.
Back to top
View user's profile Send private message
g00gler
n00b
n00b


Joined: 25 Jul 2010
Posts: 38

PostPosted: Mon Apr 07, 2014 10:37 am    Post subject: Reply with quote

So as an update:

I've tried changing my kernel configuration file to match the requirements in an earlier post by Donahue, the only 2 differences I spotted being CONFIG_UEVENT_HELPER_PATH="" set to "/sbin/udevadm" and CONFIG_DEVTMPFS_MOUNT not set instead of "y". I also specifically set rc_parallel to NO in rc.conf as per his advice. I used
Code:
genkernel --menuconfig all
to build my kernel (which is 3.14.0-gentoo, sources emerged from gentoo-sources).

Summary: it still automounts read-only. I remember reading a how-to on the Net posted by someone who wanted to show how to install Gentoo on a Macbook Air. It was current as of January 2014 and I read it in February, which was when I started this work. He stated to hard-code the root partition into the kernel command-line in the configuration file of the kernel (to whatever partition your root filesystem is). Or else, he stated, the system would not boot. Since it is at least detecting and booting the partition, which I struggled getting it to do the first time around, maybe it needs "rootfstype=ext4" in the kernel command-line inside CPU and Processing in the kernel configuration file.

But however here is my /etc/default/grub, which shows I am passing "rootfstype=ext4" to the kernel already:

Code:

# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/files/grub.default-2,v 1.4 2013/09/21 18:10:55 floppym Exp $
#
# To populate all changes in this file you need to regenerate your
# grub configuration file afterwards:
#     'grub2-mkconfig -o /boot/grub/grub.cfg'
#
# See the grub info page for documentation on possible variables and
# their associated values.

GRUB_DISTRIBUTOR="Gentoo"

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10

# Append parameters to the linux kernel command line
GRUB_CMDLINE_LINUX="root=LABEL=GENTOO_ROOT rootfstype=ext4"

# Append parameters to the linux kernel command line for non-recovery entries
GRUB_CMDLINE_LINUX_DEFAULT="root=LABEL=GENTOO_ROOT rootfstype=ext4 video=uvesafb:mtrr:3,ywrap,1440x900-32@85 splash=verbose,theme:emergence"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal.
# Note that you can use only modes which your graphic card supports via VBE.
# You can see them in real GRUB with the command `vbeinfo'.
#GRUB_GFXMODE=640x480

# Path to theme spec txt file.
# The starfield is by default provided with use truetype.
# NOTE: when enabling custom theme, ensure you have required font/etc.
#GRUB_THEME="/boot/grub/themes/starfield/theme.txt"

# Background image used on graphical terminal.
# Can be in various bitmap formats.
#GRUB_BACKGROUND="/boot/grub/mybackground.png"

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to kernel
#GRUB_DISABLE_LINUX_UUID=false

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY=true


Oh boy.

P.S. GENTOO_ROOT is the root partition label I have made. It shows up on my Mac.

DONAHUE wrote:
...if you are using openrc as init system

ADDITIONAL NOTE: I am not using systemd. I'm using OpenRC.
_________________
Q: "How are discoveries made, in your opinion?"

Einstein: "A group of scientists puzzling over the impossible gather for a meeting. One of them arrives late having solved....the mystery of where the cheese was!"


Last edited by g00gler on Mon Apr 07, 2014 8:02 pm; edited 1 time in total
Back to top
View user's profile Send private message
hellspawnV01
n00b
n00b


Joined: 06 Apr 2014
Posts: 9

PostPosted: Mon Apr 07, 2014 1:28 pm    Post subject: Reply with quote

I've been researching a little on this some more (would be easier if I had the hardware to work with... considering an investment.)... and will continue out of my own curiosity.

Results are far from a clear solution... But a band-aid if you're willing for the mean time would be to add
Code:
 mount -o remount,rw /;
to an issue script... Like I said, band-aid. Won't stop the bleeding, but you won't have to type it out every boot.
Back to top
View user's profile Send private message
g00gler
n00b
n00b


Joined: 25 Jul 2010
Posts: 38

PostPosted: Tue Apr 08, 2014 5:52 am    Post subject: Reply with quote

Before I try making an init script to occur foremost (to allow read-write), does anyone know what (a) possible cause(s) for this may be? I hit
Code:
mount | grep ro
and get nothing of significance but notably I hit
Code:
mount
and get
Code:
/dev/sda4 mounted on / ext4 (rw,noauto,data=ordered)
as part of the data. All this while my root bash prompt shows:
Code:
(none)#~ touch ./test
touch: cannot create test - read-only filesystem


Of course, "mount -o remount,rw /" once issued does the trick. But there's still that nasty "(none)" and no username at the prompt. I wonder if these will go away if I get the init script to work at the right time. So, 2 questions:

1) Why is this happening?
2) Init script tips.

Thanks for your help so far guys.
_________________
Q: "How are discoveries made, in your opinion?"

Einstein: "A group of scientists puzzling over the impossible gather for a meeting. One of them arrives late having solved....the mystery of where the cheese was!"
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7550
Location: Goose Creek SC

PostPosted: Tue Apr 08, 2014 6:13 am    Post subject: Reply with quote

boot
Code:
mount -o remount,rw /
emerge wgetpaste
rc-update show | wgetpaste
mount | wgetpaste
ls -al /dev | wgetpaste
post url's
this happened to someone about a year ago with mount saying mounted rw but commands feeding back mounted ro. unfortunately the resolution escapes me.
the login problem was part of it
_________________
Defund the FCC.
Back to top
View user's profile Send private message
g00gler
n00b
n00b


Joined: 25 Jul 2010
Posts: 38

PostPosted: Tue Apr 08, 2014 7:00 am    Post subject: Reply with quote

OK as per requested by Donahue:

Result of "rc-update show":

http://bpaste.net/show/199022/

Result of "mount":

http://bpaste.net/show/199023/

Result of "ls -al /dev":

http://bpaste.net/show/199024/
_________________
Q: "How are discoveries made, in your opinion?"

Einstein: "A group of scientists puzzling over the impossible gather for a meeting. One of them arrives late having solved....the mystery of where the cheese was!"
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7550
Location: Goose Creek SC

PostPosted: Tue Apr 08, 2014 2:02 pm    Post subject: Reply with quote

try
Code:
rc-update add udev sysinit
rc-update add udev-mount sysinit
reboot to see if results change
_________________
Defund the FCC.
Back to top
View user's profile Send private message
g00gler
n00b
n00b


Joined: 25 Jul 2010
Posts: 38

PostPosted: Wed Apr 09, 2014 5:47 am    Post subject: Reply with quote

Buddy you're fantastic.

It hiccupped at first, saying filesystem was corrupt and recommending fsck, but after fsck-ing in Mac OS (which is especially convenient since Macports provides e2fsprogs), I booted into my Gentoo command line with username displayed like normal. Of course, the crucial improvement now is that the filesystem is read-write, as per my testing.

I wonder why udev and udev-mount weren't inherently listed in my rc? Is that a misstep I perhaps made in going roughly by the Gentoo handbook?

Anyways, this forum was my last resort for a reason, because it's kind of like a secret weapon. I am consistently impressed by the feedback here. Thank you all so much.
_________________
Q: "How are discoveries made, in your opinion?"

Einstein: "A group of scientists puzzling over the impossible gather for a meeting. One of them arrives late having solved....the mystery of where the cheese was!"
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7550
Location: Goose Creek SC

PostPosted: Wed Apr 09, 2014 12:18 pm    Post subject: Reply with quote

there are reports that the hardened stage 3 did not include the udev symlinks, that would explain events if you used hardened, if not no symlinks may have infected the nonhardened stage 3's
_________________
Defund the FCC.
Back to top
View user's profile Send private message
g00gler
n00b
n00b


Joined: 25 Jul 2010
Posts: 38

PostPosted: Wed Apr 09, 2014 12:23 pm    Post subject: Reply with quote

DONAHUE wrote:
there are reports that the hardened stage 3 did not include the udev symlinks, that would explain events if you used hardened, if not no symlinks may have infected the nonhardened stage 3's


To the interests of those reading this thread, I DID in fact unpack a stage3 hardened archive for my installation. From February. Yes, man, symlinks are very important, LOL.
_________________
Q: "How are discoveries made, in your opinion?"

Einstein: "A group of scientists puzzling over the impossible gather for a meeting. One of them arrives late having solved....the mystery of where the cheese was!"
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum