Hi, On Tue, Nov 28, 2006 at 02:05:48PM +0100, bardo wrote: > Hi all! > > One of the major annoyances I found in reiserfs is it's really slow > when mounting, and since I'm mounting a lot of partitions on different > disks it takes almost one minute at boot. I thought this could be > improved by substituting the default "mount -a" in rc.sysinit with a > small script that detects the mount dependencies between filesystems > and executes a parallel mount of them.
It's not possible to to REAL parallel mounts, simple because the actual
do_mount is protected by a lock_kernel AKA Big Kernel Lock.
>
> This would make sense, of course, only on machines that use more than
> one partition on more than one disk, but adding a check for this would
> be really quick. In case there's only one disk it would default at
> "mount -a" without generating the unnecessary overhead.
>
> Well... stop talking. Here comes the script:
> ----------
> #!/bin/bash
>
> # create the array with sorted fs
> num=0
> for mp in $(grep -v -e ^# -e ^$ -e noauto /etc/fstab | awk '{ print $2
> }' | sed 's|^/||' | sort) ; do
> fslist[((num++))]=${mp}
> done
>
> # cycle through the array to build the mount line
> mountline="mount /"
> newnum=1 # set to 1 because it's the root fs
> for ((i=1;i<[EMAIL PROTECTED];i++)) ; do
> oldnum=$newnum
> newnum=$(awk -F/ '{ print NF }' <<< ${fslist[$i]})
> if [ ${newnum} -gt ${oldnum} ] && [[ ${fslist[${i}]} =~
> ${fslist[$((i-1))]} ]] ; then
> conj="&&"
> else
> conj="&"
> fi
> mountline="${mountline} ${conj} mount /${fslist[$i]}"
> done
>
What a Hack! ;)
Jürgen
pgpG2Qg4bpIXk.pgp
Description: PGP signature
_______________________________________________ arch mailing list [email protected] http://www.archlinux.org/mailman/listinfo/arch
