#3258: Mounting /dev/shm can break some hosts
------------------------------------------+---------------------------------
Reporter: matthew@… | Owner: lfs-book@…
Type: defect | Status: new
Priority: normal | Milestone: 7.3
Component: Book | Version: SVN
Severity: normal | Keywords:
------------------------------------------+---------------------------------
Old description:
> As reported at http://www.linuxfromscratch.org/pipermail/lfs-
> dev/2012-December/067476.html the instructions to work around the fact
> that some hosts have symlinked /dev/shm to /run/shm can in fact break
> those hosts. Once the /dev/shm symlink is removed from the host, it's
> never recreated!
>
> The fix from Pierre, in that thread, looks good:
>
> {{{
> if [ -h $LFS/dev/shm ]; then
> mkdir -p $/LFS/run/shm
> mount -vt tmpfs shm $LFS/run/shm
> fi
> }}}
>
> So, we mount the shm FS into the target of the symlink, rather than
> removing the symlink.
>
> We'll need to add an errata item for this as well.
New description:
As reported at http://www.linuxfromscratch.org/pipermail/lfs-
dev/2012-December/067476.html the instructions to work around the fact
that some hosts have symlinked /dev/shm to /run/shm can in fact break
those hosts. Once the /dev/shm symlink is removed from the host, it's
never recreated!
The fix from Pierre, in that thread, looks good:
{{{
if [ -h $LFS/dev/shm ]; then
mkdir -p $LFS/run/shm
mount -vt tmpfs shm $LFS/run/shm
fi
}}}
So, we mount the shm FS into the target of the symlink, rather than
removing the symlink.
We'll need to add an errata item for this as well.
--
Comment(by bdubbs@…):
I've been thinking about this some more and the proposed solution appears
to be correct for the case when the /dev/shm -> /run/shm symlink is
present.
I'm not sure about the case when the symlink is not present, wouldn't we
want to mount a new tmpfs directly on $LFS/dev/shm like we do now? Also,
we probably don't want to make assumptions for where the symlink is
pointing.
{{{
if [ -h $LFS/dev/shm ]; then
link=$(readlink $LFS/dev/shm)
mkdir -p $LFS/$link
mount -vt tmpfs shm $LFS/$link
unset link
else
mount -vt tmpfs shm $LFS/shm
fi
}}}
I'll make the change if we agree that this is the right way to go.
--
Ticket URL: <http://wiki.linuxfromscratch.org/lfs/ticket/3258#comment:2>
LFS Trac <http://wiki.linuxfromscratch.org/lfs/>
Linux From Scratch: Your Distro, Your Rules.
--
http://linuxfromscratch.org/mailman/listinfo/lfs-book
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page