Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
83bf052f
Commit
83bf052f
authored
Dec 16, 2013
by
Mike Hibler
Browse files
Tweaks to make creation of a filesystem on an uninitialized disk work.
parent
093655c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
clientside/tmcc/linux/mkextrafs.pl
View file @
83bf052f
...
...
@@ -202,8 +202,9 @@ if ($mounted =~ /^$fsdevice on (\S*)/) {
#
# Check for valid DOS partition table, since might be secondary disk.
# Used to use "sfdisk -V" but that seems to have quirks.
#
if
(
system
("
sfdisk -q -V
$diskdev
"))
{
if
(
system
("
parted -s
$diskdev
print >/dev/null 2>&1
"))
{
system
("
parted -s
$diskdev
mklabel msdos
");
if
(
$?
)
{
die
("
*** $0:
\n
"
.
...
...
@@ -220,7 +221,7 @@ if (system("sfdisk -q -V $diskdev")) {
$disksize
=
(
1024
*
1024
*
1024
);
print
"
Disk really big! cutting back to
$disksize
blocks.
\n
";
}
system
("
echo '0,
$disksize
' | sfdisk
$diskdev
-N
$slice
-u B
");
system
("
echo '0,
$disksize
' | sfdisk
--force
$diskdev
-N
$slice
-u B
");
if
(
$?
)
{
die
("
*** $0:
\n
"
.
"
Could not initialize primary partition on
$diskdev
!
\n
");
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment