42 |
|
|
43 |
# Check if we have any ext2/3 or swap partitions |
# Check if we have any ext2/3 or swap partitions |
44 |
if grep -q 'Id=8[23]' /tmp/oldparts; then |
if grep -q 'Id=8[23]' /tmp/oldparts; then |
45 |
echo -n "Converting partitions to RAID..." >/dev/tty1 |
echo -en "\n\nConverting partitions to RAID..." >/dev/tty1 |
46 |
# Convert ext2/3 and swap partitions to raid autodetect |
# Convert ext2/3 and swap partitions to raid autodetect |
47 |
sed 's/Id=8[32]/Id=fd/' /tmp/oldparts > /tmp/newparts |
sed 's/Id=8[32]/Id=fd/' /tmp/oldparts > /tmp/newparts |
48 |
|
|
69 |
# Write out new converted partition table |
# Write out new converted partition table |
70 |
sfdisk --force /dev/$disk < /tmp/newparts |
sfdisk --force /dev/$disk < /tmp/newparts |
71 |
|
|
72 |
echo "Checking filesystems on converted partitions. This may take a few minutes." >/dev/tty1 |
echo -e "\nChecking filesystems on converted partitions. This may take a few minutes." >/dev/tty1 |
|
echo -n "Checking filesystems..." >/dev/tty1 |
|
73 |
|
|
74 |
mkdir /mnt/tmp |
mkdir /mnt/tmp |
75 |
for part in `grep 'Id=fd' /tmp/newparts | sed "s/$disk\([0-9]\+\) :.*/md\1/"`; do |
for part in `grep 'Id=fd' /tmp/newparts | sed "s/$disk\([0-9]\+\) :.*/md\1/"`; do |
76 |
if [ "$part" != "$swap" ]; then |
if [ "$part" != "$swap" ]; then |
77 |
# Resize ext2/3 partitions (fix superblock - part 2) |
# Resize ext2/3 partitions (fix superblock - part 2) |
78 |
echo -n "$part..." >/dev/tty1 |
echo -e "\n\nChecking $part..." >/dev/tty1 |
79 |
e2fsck -f $part |
e2fsck -f -C0 $part >/dev/tty1 |
80 |
|
|
81 |
# Check for /etc/fstab on partitions and convert entries |
# Check for /etc/fstab on partitions and convert entries |
82 |
mount $part /mnt/tmp |
mount $part /mnt/tmp |
87 |
umount /mnt/tmp |
umount /mnt/tmp |
88 |
fi |
fi |
89 |
done |
done |
|
echo "done" >/dev/tty1 |
|
90 |
rmdir /mnt/tmp |
rmdir /mnt/tmp |
91 |
mdadm --stop --scan |
mdadm --stop --scan |
92 |
fi |
fi |