5 t
= myexec("sudo fdisk -l")
6 dt
= {} -- device table
8 string.gsub(t
, "\n(/.-)\n", function(l
)
10 if (string.find(l
, "Ext") or string.find(l
, "extended")) then break end -- filter "extended" partition
11 string.gsub(l
, "(.-)%s+%**%s+%d+%s+%d+%s+(%d+).-%x+%s+(.-)$", function(d
, s
, f
)
13 dt
[d
]["size"] = size2hum(s
..'k')
15 -- print("dev: "..d.."\tsize: "..size2hum(s.."K").."\tfilesystem: "..f)
21 <form action = "volumes_create_raid.cgi" method = "post">
22 <table cellspacing="1" cellpadding="2" border="0" width="60%">
23 <tr align="left"><td bgcolor="#ebebeb"><strong>Partition</strong></td><td bgcolor="#ebebeb"><strong>Size</strong></td><td bgcolor="#ebebeb"><strong>Filesystem</strong></td></tr>
30 _td1
= string.format([[<tr bgcolor=#c6d5a8 align="left"><td>
31 <input type="checkbox" name="devs_%d" value="%s">%s</td>]], v
, i
, d
, d
)
33 print("<td>"..dt
[d
].size
.."</td>")
34 print("<td>"..dt
[d
].fs
.."</td></tr>")
38 <input type="hidden" name=todo value="todo">
39 <input type="submit" value="创建阵列">
40 <input type="reset" value="清除">