Xu Xiaodong avatar Xu Xiaodong committed d662c1e

add del*part.sh

Comments (0)

Files changed (4)

 #
 # description:  删除 /dev/sda (硬盘) 的所有分区
 # author:       Xu Xiaodong <xxdlhy@gmail.com>
-# modified:     2011 Aug 14
+# modified:     2011 Aug 15
 #
 
 CMD=fdisk
 d
 3
 d
-
+4
 w
 EOF
 
   echo "$DEVICE 的分区删除失败."
 fi
 
-sleep 5m
-
 # vim: ai:et:ts=2:sw=2:sts=2:tw=78:ft=sh
+#!/bin/sh
+#
+# description:  针对 16G 固态硬盘进行自动分区
+#               / 5G, /tmp 1G, /var 2G, swap 1G, /home 7G
+# author:       Xu Xiaodong <xxdlhy@gmail.com>
+# modified:     2011 Aug 15
+#
+
+CMD=fdisk
+DEVICE=/dev/sda
+
+sudo "$CMD" "$DEVICE" <<'EOF'
+n
+p
+1
+
++5G
+n
+p
+2
+
++1G
+n
+p
+3
+
++2G
+n
+e
+
+
+
+n
+
++1G
+n
+
+
+a
+1
+w
+EOF
+
+# vim: ai:et:ts=2:sw=2:sts=2:tw=78:ft=sh
         usage
         exit 1
       fi
+      "$SH"/del_hdd_part.sh > /dev/null 2>&1
       "$SH"/part_"$TYPE".sh > /dev/null 2>&1
       sudo ./ucloner_cmd.py mode=restore restore_from="$IMAGE" \
         /="$HDD"1 /_fs=ext4 \
       exclude=/home/ubox/ucloner
     ;;
   udisk)
+    "$SH"/del_ufd_part.sh > /dev/null 2>&1
     "$SH"/part_ufd.sh > /dev/null 2>&1
     sudo ./ucloner_cmd.py mode=restore restore_from="$IMAGE" \
       /="$UFD"1 /_fs=ext4 \
+#!/bin/sh
+#
+# description:  利用 ucloner 还原 ubox 系统 (16G 固态硬盘)
+# author:       Xu Xiaodong <xxdlhy@gmail.com>
+# modified:     2011 Aug 15
+#
+
+PROG="$HOME"/tools/resbox
+
+if [ -d $PROG ]; then
+  cd "$PROG"
+  ./resbox restore ssd16
+else
+  echo "目录 $PROG 不存在."
+  exit 1
+fi
+
+sleep 5m
+
+# 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.