generic: hole punching followed by writes in the same range
[xfstests-dev.git] / crash / rc.sysinit
1 #
2 # Copyright (c) 2000-2001 Silicon Graphics, Inc.  All Rights Reserved.
3 #
4 # xfscrash - control the XFS crash tests
5 #
6
7 # this is an example of what to add to rc.sysinit on a redhat linux
8 # system to get the ro-root/ramdisk system up and running
9
10 if [ -f /initrd.active ]
11 then
12         echo "*** MAKE RAMDISK ***"
13         dd if=/dev/zero of=/dev/ram0 bs=1024k count=4
14         mkfs -i 1024 /dev/ram0 4096
15         echo "*** MOUNT RAMDISK ***"
16         mount -n -w /dev/ram0 /mnt
17         echo "*** INIT RAMDISK ***"
18         cp -a /initrd_init/* /mnt
19         rm -f /mnt/00_INITRD_REAL
20         touch /mnt/00_INITRD_RAMDISK
21         umount -n /mnt
22         echo "*** REMOUNT RAMDISK ***"
23         mount -n /dev/ram0 /initrd
24
25         echo "*** FIX MTAB ***"
26         >/etc/mtab
27         rm -f /etc/mtab~ /etc/mtab~~
28         mount -f -o ro /
29         mount -f -o rw /dev/ram0 /initrd
30 else
31         # old code
32         
33         # Remount the root filesystem read-write.
34         action "Remounting root filesystem in read-write mode" mount -n -o remount,rw /
35
36         # Clear mtab
37         >/etc/mtab
38
39         # Remove stale backups
40         rm -f /etc/mtab~ /etc/mtab~~
41
42         # Enter root and /proc into mtab.
43         mount -f /
44         mount -f /proc
45
46 fi