Xu Xiaodong avatar Xu Xiaodong committed a5c935f

add part_ssd16.sh, run_cln.sh and run_resssd16.sh

Comments (0)

Files changed (5)

 # description:  针对 30G 固态硬盘进行自动分区
 #               / 6G, /tmp 1G, /var 3G, /home 18G, swap 2G
 # author:       Xu Xiaodong <xxdlhy@gmail.com>
-# modified:     2011 Jul 25
+# modified:     2011 Jul 26
 #
 
 CMD=fdisk
 
 n
 
-+18000M
++17000M
 n
 
 
+#!/bin/sh
+#
+# description:  针对 16G 固态硬盘进行自动分区
+#               / 6G, /tmp 1G, /var 2G, /home 6G, swap 1G
+# author:       Xu Xiaodong <xxdlhy@gmail.com>
+# modified:     2011 Aug 12
+#
+
+CMD=fdisk
+DEVICE=/dev/sda
+
+sudo $CMD $DEVICE <<'EOF'
+n
+p
+1
+
++6000M
+n
+p
+2
+
++1000M
+n
+p
+3
+
++2000M
+n
+e
+
+
+
+n
+
++6000M
+n
+
+
+a
+1
+w
+EOF
+
+# vim: ai:et:ts=2:sw=2:sts=2:tw=78:ft=sh
 #
 # description:  利用 ucloner 还原 ubox 系统
 # author:       Xu Xiaodong <xxdlhy@gmail.com>
-# modified:     2011 Jul 25
+# modified:     2011 Aug 12
 #
 
 BASE=$HOME/ucloner
 PROG=$BASE/program
 SH=$HOME/resbox
 IMAGE=$BASE/ubox.squashfs
+#IMAGE=$BASE/2011-06-16.squashfs
 NAME=$(date +%Y-%m-%d)
 
 cd $PROG
     sudo ./ucloner_cmd.py mode=backup backup_to=$BASE/"$NAME".squashfs
     ;;
   restore)
-    $SH/part_"$2".sh >/dev/null
-    sudo ./ucloner_cmd.py mode=restore restore_from=$IMAGE \
+    if [ $(ls /dev/sdb) = '/dev/sdb' ]; then
+      $SH/part_"$2".sh > /dev/null 2>&1
+      sudo ./ucloner_cmd.py mode=restore restore_from=$IMAGE \
+        /=/dev/sda1 /_fs=ext4 \
+        /tmp=/dev/sda2 /tmp_fs=ext4 \
+        /var=/dev/sda3 /var_fs=ext4 \
+        /home=/dev/sda5 /home_fs=ext4 \
+        swap=/dev/sda6 \
+        grubdev=/dev/sda
+    else
+      echo "请安装硬盘先."
+      exit 0
+    fi
+    ;;
+  clone)
+    sudo ./ucloner_cmd.py mode=clone \
       /=/dev/sda1 /_fs=ext4 \
       /tmp=/dev/sda2 /tmp_fs=ext4 \
       /var=/dev/sda3 /var_fs=ext4 \
       /home=/dev/sda5 /home_fs=ext4 \
       swap=/dev/sda6 \
-      grubdev=/dev/sda
+      grubdev=/dev/sda \
+      exclude=/home/ubox/ucloner
     ;;
   udisk)
-    sudo ./ucloner_cmd.py mode=restore restore_from=$IMAGE /=/dev/sdb1 /_fs=ext4 grubdev=/dev/sdb
+    sudo ./ucloner_cmd.py mode=restore restore_from=$IMAGE /=/dev/sdc1 /_fs=ext4 grubdev=/dev/sdc
     ;;
   *)
-    echo "$0 backup | restore <hdd | ssd> | udisk"
+    echo "$0 backup | restore <hdd | ssd | ssh16> | clone | udisk"
     exit 0
     ;;
 esac
 
 if [ $? -eq 0 ]; then
-  echo "系统安装成功, 将在 10 秒后自动重启."
-  sleep 10s
+  echo "系统安装成功, 将在 5 秒后自动重启."
+  sleep 5
   sudo reboot
 else
   echo "系统安装失败."
+#!/bin/sh
+#
+# description:  利用 ucloner 克隆 ubox 系统
+# author:       Xu Xiaodong <xxdlhy@gmail.com>
+# modified:     2011 Jul 29
+#
+
+PROG=$HOME/resbox
+
+cd $PROG
+./resbox clone
+sleep 30m
+
+# vim: ai:et:ts=2:sw=2:sts=2:tw=78:ft=sh
+#!/bin/sh
+#
+# description:  利用 ucloner 还原 ubox 系统 (16 G固态硬盘)
+# author:       Xu Xiaodong <xxdlhy@gmail.com>
+# modified:     2011 Aug 12
+#
+
+PROG=$HOME/resbox
+
+cd $PROG
+./resbox restore ssd16
+sleep 30m
+
+# vim: ai:et:ts=2:sw=2:sts=2:tw=78:ft=sh
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.