Xu Xiaodong avatar Xu Xiaodong committed 3b0741e

add part_del.sh

Comments (0)

Files changed (4)

+#!/bin/sh
+#
+# description:  删除 /dev/sda 的所有分区
+# author:       Xu Xiaodong <xxdlhy@gmail.com>
+# modified:     2011 Jul 25
+#
+
+CMD=fdisk
+DEVICE=/dev/sda
+
+sudo $CMD $DEVICE <<'EOF'
+d
+1
+d
+2
+d
+3
+d
+4
+w
+EOF
+
+if [ $? -eq 0 ]; then
+  echo
+  echo "已删除 /dev/sda 的所有分区."
+fi
+
+sleep 5m
+
+# vim: ai:et:ts=2:sw=2:sts=2:tw=78:ft=sh
 #!/bin/sh
 #
 # description:  针对 320G 硬盘进行自动分区
-#               / 10G, /tmp 5G, /var 25G, /home
+#               / 10G, /tmp 5G, /var 25G, /home 278, swap 2G
 # author:       Xu Xiaodong <xxdlhy@gmail.com>
-# modified:     2011 Jul 24
+# modified:     2011 Jul 25
 #
 
 CMD=fdisk
 
 +25000M
 n
-p
+e
 
 
 
+n
+
++278000M
+n
+
+
 a
 1
 w
 #!/bin/sh
 #
 # description:  针对 30G 固态硬盘进行自动分区
-#               / 5G, /tmp 1G, /var 4G, /home
+#               / 6G, /tmp 1G, /var 3G, /home 18G, swap 2G
 # author:       Xu Xiaodong <xxdlhy@gmail.com>
-# modified:     2011 Jul 24
+# modified:     2011 Jul 25
 #
 
 CMD=fdisk
 p
 1
 
-+5000M
++6000M
 n
 p
 2
 p
 3
 
-+4000M
++3000M
 n
-p
+e
 
 
 
+n
+
++18000M
+n
+
+
 a
 1
 w
 #
 # description:  利用 ucloner 还原 ubox 系统
 # author:       Xu Xiaodong <xxdlhy@gmail.com>
-# modified:     2011 Jul 24
+# modified:     2011 Jul 25
 #
 
 BASE=$HOME/ucloner
     ;;
   restore)
     $SH/part_"$2".sh >/dev/null
-    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/sda4 /home_fs=ext4 grubdev=/dev/sda
+    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
     ;;
   udisk)
     sudo ./ucloner_cmd.py mode=restore restore_from=$IMAGE /=/dev/sdb1 /_fs=ext4 grubdev=/dev/sdb
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.