"nCan"t;find;a;FAT16;filesystem;on;$1";14;60;
exit;2;
fi;
#;get;volume;label;in;boot;sector;
dd;2>/dev/null;if=$1;bs=1;count=11;skip=43;|;dd;2>/dev/null;of=$TMPFILE;
printf;>>$TXTFILE;"0s;:;%sn";"Volume;label;in;boot;sector";"`cat
$TMPFILE`";
#;get;Sector;size;
dd;2>/dev/null;if=$1;bs=1;count=2;skip=11|;od;-An;-tdS;|;dd;2>/dev/null
of=$TMPFILE;
printf;>>$TXTFILE;"0s;:;%dn";"Sector;size";`cat;$TMPFILE`;
sector_size=`cat;$TMPFILE`;
#;get;Reserved;sectors;
dd;2>/dev/null;if=$1;bs=1;count=2;skip=14|;od;-An;-tdS;|;dd;2>/dev/null
of=$TMPFILE;
printf;>>$TXTFILE;"0s;:;%dn";";Reserved;sectors";`cat;$TMPFILE`;
reserved_sectors=`cat;$TMPFILE`;
#;get;FAT;sectors;
dd;2>/dev/null;if=$1;bs=1;count=1;skip=16|;od;-An;-tdS;|;dd;2>/dev/null
of=$TMPFILE;
fat_count=`cat;$TMPFILE`;
dd;2>/dev/null;if=$1;bs=1;count=2;skip=22|;od;-An;-tdS;|;dd;2>/dev/null
of=$TMPFILE;
sectors_per_fat=`cat;$TMPFILE`;
#;calculate;the;no;of;sectors;allocated;for;FAT"s;
let;fat_sectors=fat_count*sectors_per_fat;
printf;>>$TXTFILE;"0s;:;\u;(\u;x;\u);n";"FAT;sectors";"$fat_sectors"
"$fat_count";"$sectors_per_fat";
#;get;root;directory;sectors;
dd;2>/dev/null;if=$1;bs=1;count=2;skip=17|;od;-An;-tdS;|;dd;2>/dev/null
of=$TMPFILE;
root_sectors=`cat;$TMPFILE`;
#;calculate;the;no;of;sectors;allocated;for;root;directory;
let;root_sectors=root_sectors*32/sector_size;
printf;>>$TXTFILE;"0s;:;\un";"Root;directory;sectors";"$root_sectors";
#;get;Total;special;sectors;
let;total=reserved_sectors fat_sectors root_sectors;
printf;>>$TXTFILE;"0s;:;\un";"Total;special;sectors";"$total";
#;display;the;information;in;a;message;box;
dialog;--title;"Boot;sector;of;$1";--backtitle;"$back_title";--msgbox
"`cat;$TXTFILE`";14;60;
#;delete;temporary;files;
rm;-f;$TMPFILE;
rm;-f;$TXTFILE;
#;end;of;msinfo.sh;
2.;swapinit.sh;
#!/bin/sh;
#;
#;/etc/rc.d/init.d/swapinit.sh;-;activate;the;swap;partition;
#;
#;written;by;Rahul;U.;Joshi;
#;Verify;and;initialize;swap;space;
#;
echo;-n;"Verifying;swap;space...;";
loopcount=0;
#;flag;to;indicate;whether;the;partition;has;been;activated;or;not;
activated=0;
#;check;for;signatures;6;times;before;giving;up;
while;[;$loopcount;-lt;6;];
do;
if;[;"`/bin/dd;2>/dev/null;if=/dev/winswap;bs=1;count=10;skip=4086`";=
"SWAPSPACE2";];;then;
echo;"Linux;signature;found,;iteration;$loopcount";
echo;"Activating;swap;partitions";
swapon;/dev/winswap;
activated=1;
break;
elif;[;"`/bin/dd;2>/dev/null;if=/dev/winswap;bs=1;count=5;skip=54`";=
"FAT16";];;then;
echo;"DOS;signature;found,;iteration;$loopcount";
echo;"Making;swap;partition";
mkswap;/dev/winswap;377496;
echo;"Activating;swap;partitions";
swapon;/dev/winswap;
activated=1;
break;
else;
let;loopcount=loopcount 1;
fi;
done;
if;[;$activated;-ne;1;];;;then;
echo;"Swap;signature;not;found;after;$loopcount;tries";
echo;"No;swapping;partitions;activated";
exit;1;
fi;
3.;swaphalt.sh;
#!/bin/sh;
#;
#;/etc/rc.d/init.d/swapinit.sh;-;activate;the;swap;partition;
#;
#;written;by;Rahul;U.;Joshi;
#;Verify;and;initialize;swap;space;
#;
echo;-n;"Verifying;swap;space...;";
loopcount=0;
#;flag;to;indicate;whether;the;partition;has;been;activated;or;not;
activated=0;
#;check;for;signatures;6;times;before;giving;up;
while;[;$loopcount;-lt;6;];
do;
if;[;"`/bin/dd;2>/dev/null;if=/dev/winswap;bs=1;count=10;skip=4086`";=
"SWAPSPACE2";];;then;
echo;"Linux;signature;found,;iteration;$loopcount";
echo;"Activating;swap;partitions";
swapon;/dev/winswap;
activated=1;
break;
elif;[;"`/bin/dd;2>/dev/null;if=/dev/winswap;bs=1;count=5;skip=54`";=
"FAT16";];;then;
echo;"DOS;signature;found,;iteration;$loopcount";
推荐阅读
- 从651和753看AK将来的风格
- Linux下的常用软件列表
- 优化Linux系统硬盘的七个实用技巧
- "联通无限"和我的南方高科SC3988
- Linux系统中提取DVD音频的方法介绍
- 健康码和粤康码的区别
- 手工皂和普通香皂有什么区别
- 在Linux中如何提高文件系统的使用效率
- 先考和显考是什么意思
- Slackware EyooLinux服务器配置相关指令
