blob: 9527070a17f9b3db8442d2e1d8ecca02b3419e1b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
#!/bin/sh
#INIT 20
[[ $1 = autostart ]] || exit 0
# activate swap
[ -x /sbin/swapon ] && {
grep swap /etc/fstab >/dev/null 2>&1
if [ $? -eq 0 ];then
logger -t '' "Activating swap"
swapon -a
fi
}
# activate any logical volumes
[ -x /usr/sbin/lvm ] && {
logger -t '' "Activating LVM volumes"
lvm vgscan
lvm vgchange -ay
}
# mount local filesystems
fstypes="ext2 ext3 ext4 xfs vfat ntfs"
for fs in $fstypes; do
disks=$(grep -v "^#" /etc/fstab|grep $fs|awk '{ print $1 }')
for disk in $disks; do
logger -t 'Filesystem' "Found $disk with filesystem $fs"
mnt=$(grep -v "^#" /etc/fstab|grep "$disk "|awk '{ print $2 }')
grep $fs /proc/filesystems >/dev/null 2>&1
if [ $? -eq 0 ];then
[ -x /usr/sbin/fsck.$fs ] && {
logger -t 'Filesystem' "checking $fs filesystem on $disk"
fsck -p $disk >/dev/null 2>&1
}
logger -t 'Filesystem' "Mounting local filesystems"
mkdir -p $mnt > /dev/null 2>&1
mount $disk
else
logger -s -t 'Filesystem' "No $fs filesystem in kernel"
fi
done
done
exit 0
|