Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
13a2bc8a
Commit
13a2bc8a
authored
Dec 18, 2016
by
Alexander Block
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable lazy initialization of ext3/ext4 filesystems
parent
01b9d496
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
12 deletions
+9
-12
configure-helper.sh
cluster/gce/gci/configure-helper.sh
+1
-1
safe_format_and_mount
cluster/saltbase/salt/helpers/safe_format_and_mount
+2
-5
mount_linux.go
pkg/util/mount/mount_linux.go
+1
-1
safe_format_and_mount_test.go
pkg/util/mount/safe_format_and_mount_test.go
+4
-4
start-kubemark-master.sh
test/kubemark/resources/start-kubemark-master.sh
+1
-1
No files found.
cluster/gce/gci/configure-helper.sh
View file @
13a2bc8a
...
@@ -68,7 +68,7 @@ function safe-format-and-mount() {
...
@@ -68,7 +68,7 @@ function safe-format-and-mount() {
# Format only if the disk is not already formatted.
# Format only if the disk is not already formatted.
if
!
tune2fs
-l
"
${
device
}
"
;
then
if
!
tune2fs
-l
"
${
device
}
"
;
then
echo
"Formatting '
${
device
}
'"
echo
"Formatting '
${
device
}
'"
mkfs.ext4
-F
-E
lazy_itable_init
=
0,lazy_journal_init
=
0,discard
"
${
device
}
"
mkfs.ext4
-F
"
${
device
}
"
fi
fi
mkdir
-p
"
${
mountpoint
}
"
mkdir
-p
"
${
mountpoint
}
"
...
...
cluster/saltbase/salt/helpers/safe_format_and_mount
View file @
13a2bc8a
...
@@ -22,12 +22,9 @@
...
@@ -22,12 +22,9 @@
FSCK
=
fsck.ext4
FSCK
=
fsck.ext4
MOUNT_OPTIONS
=
"discard,defaults"
MOUNT_OPTIONS
=
"discard,defaults"
MKFS
=
"mkfs.ext4 -
E lazy_itable_init=0,lazy_journal_init=0 -
F"
MKFS
=
"mkfs.ext4 -F"
if
[
-e
/etc/redhat-release
]
;
then
if
[
-e
/etc/redhat-release
]
;
then
if
grep
-q
'6\..'
/etc/redhat-release
;
then
if
grep
-q
'7\..'
/etc/redhat-release
;
then
# lazy_journal_init is not recognized in redhat 6
MKFS
=
"mkfs.ext4 -E lazy_itable_init=0 -F"
elif
grep
-q
'7\..'
/etc/redhat-release
;
then
FSCK
=
fsck.xfs
FSCK
=
fsck.xfs
MKFS
=
mkfs.xfs
MKFS
=
mkfs.xfs
fi
fi
...
...
pkg/util/mount/mount_linux.go
View file @
13a2bc8a
...
@@ -359,7 +359,7 @@ func (mounter *SafeFormatAndMount) formatAndMount(source string, target string,
...
@@ -359,7 +359,7 @@ func (mounter *SafeFormatAndMount) formatAndMount(source string, target string,
fstype
=
"ext4"
fstype
=
"ext4"
}
}
if
fstype
==
"ext4"
||
fstype
==
"ext3"
{
if
fstype
==
"ext4"
||
fstype
==
"ext3"
{
args
=
[]
string
{
"-
E"
,
"lazy_itable_init=0,lazy_journal_init=0"
,
"-
F"
,
source
}
args
=
[]
string
{
"-F"
,
source
}
}
}
glog
.
Infof
(
"Disk %q appears to be unformatted, attempting to format as type: %q with options: %v"
,
source
,
fstype
,
args
)
glog
.
Infof
(
"Disk %q appears to be unformatted, attempting to format as type: %q with options: %v"
,
source
,
fstype
,
args
)
cmd
:=
mounter
.
Runner
.
Command
(
"mkfs."
+
fstype
,
args
...
)
cmd
:=
mounter
.
Runner
.
Command
(
"mkfs."
+
fstype
,
args
...
)
...
...
pkg/util/mount/safe_format_and_mount_test.go
View file @
13a2bc8a
...
@@ -109,7 +109,7 @@ func TestSafeFormatAndMount(t *testing.T) {
...
@@ -109,7 +109,7 @@ func TestSafeFormatAndMount(t *testing.T) {
execScripts
:
[]
ExecArgs
{
execScripts
:
[]
ExecArgs
{
{
"fsck"
,
[]
string
{
"-a"
,
"/dev/foo"
},
""
,
nil
},
{
"fsck"
,
[]
string
{
"-a"
,
"/dev/foo"
},
""
,
nil
},
{
"lsblk"
,
[]
string
{
"-nd"
,
"-o"
,
"FSTYPE"
,
"/dev/foo"
},
""
,
nil
},
{
"lsblk"
,
[]
string
{
"-nd"
,
"-o"
,
"FSTYPE"
,
"/dev/foo"
},
""
,
nil
},
{
"mkfs.ext4"
,
[]
string
{
"-
E"
,
"lazy_itable_init=0,lazy_journal_init=0"
,
"-
F"
,
"/dev/foo"
},
""
,
fmt
.
Errorf
(
"formatting failed"
)},
{
"mkfs.ext4"
,
[]
string
{
"-F"
,
"/dev/foo"
},
""
,
fmt
.
Errorf
(
"formatting failed"
)},
},
},
expectedError
:
fmt
.
Errorf
(
"formatting failed"
),
expectedError
:
fmt
.
Errorf
(
"formatting failed"
),
},
},
...
@@ -120,7 +120,7 @@ func TestSafeFormatAndMount(t *testing.T) {
...
@@ -120,7 +120,7 @@ func TestSafeFormatAndMount(t *testing.T) {
execScripts
:
[]
ExecArgs
{
execScripts
:
[]
ExecArgs
{
{
"fsck"
,
[]
string
{
"-a"
,
"/dev/foo"
},
""
,
nil
},
{
"fsck"
,
[]
string
{
"-a"
,
"/dev/foo"
},
""
,
nil
},
{
"lsblk"
,
[]
string
{
"-nd"
,
"-o"
,
"FSTYPE"
,
"/dev/foo"
},
""
,
nil
},
{
"lsblk"
,
[]
string
{
"-nd"
,
"-o"
,
"FSTYPE"
,
"/dev/foo"
},
""
,
nil
},
{
"mkfs.ext4"
,
[]
string
{
"-
E"
,
"lazy_itable_init=0,lazy_journal_init=0"
,
"-
F"
,
"/dev/foo"
},
""
,
nil
},
{
"mkfs.ext4"
,
[]
string
{
"-F"
,
"/dev/foo"
},
""
,
nil
},
},
},
expectedError
:
fmt
.
Errorf
(
"Still cannot mount"
),
expectedError
:
fmt
.
Errorf
(
"Still cannot mount"
),
},
},
...
@@ -131,7 +131,7 @@ func TestSafeFormatAndMount(t *testing.T) {
...
@@ -131,7 +131,7 @@ func TestSafeFormatAndMount(t *testing.T) {
execScripts
:
[]
ExecArgs
{
execScripts
:
[]
ExecArgs
{
{
"fsck"
,
[]
string
{
"-a"
,
"/dev/foo"
},
""
,
nil
},
{
"fsck"
,
[]
string
{
"-a"
,
"/dev/foo"
},
""
,
nil
},
{
"lsblk"
,
[]
string
{
"-nd"
,
"-o"
,
"FSTYPE"
,
"/dev/foo"
},
""
,
nil
},
{
"lsblk"
,
[]
string
{
"-nd"
,
"-o"
,
"FSTYPE"
,
"/dev/foo"
},
""
,
nil
},
{
"mkfs.ext4"
,
[]
string
{
"-
E"
,
"lazy_itable_init=0,lazy_journal_init=0"
,
"-
F"
,
"/dev/foo"
},
""
,
nil
},
{
"mkfs.ext4"
,
[]
string
{
"-F"
,
"/dev/foo"
},
""
,
nil
},
},
},
expectedError
:
nil
,
expectedError
:
nil
,
},
},
...
@@ -142,7 +142,7 @@ func TestSafeFormatAndMount(t *testing.T) {
...
@@ -142,7 +142,7 @@ func TestSafeFormatAndMount(t *testing.T) {
execScripts
:
[]
ExecArgs
{
execScripts
:
[]
ExecArgs
{
{
"fsck"
,
[]
string
{
"-a"
,
"/dev/foo"
},
""
,
nil
},
{
"fsck"
,
[]
string
{
"-a"
,
"/dev/foo"
},
""
,
nil
},
{
"lsblk"
,
[]
string
{
"-nd"
,
"-o"
,
"FSTYPE"
,
"/dev/foo"
},
""
,
nil
},
{
"lsblk"
,
[]
string
{
"-nd"
,
"-o"
,
"FSTYPE"
,
"/dev/foo"
},
""
,
nil
},
{
"mkfs.ext3"
,
[]
string
{
"-
E"
,
"lazy_itable_init=0,lazy_journal_init=0"
,
"-
F"
,
"/dev/foo"
},
""
,
nil
},
{
"mkfs.ext3"
,
[]
string
{
"-F"
,
"/dev/foo"
},
""
,
nil
},
},
},
expectedError
:
nil
,
expectedError
:
nil
,
},
},
...
...
test/kubemark/resources/start-kubemark-master.sh
View file @
13a2bc8a
...
@@ -71,7 +71,7 @@ function safe-format-and-mount() {
...
@@ -71,7 +71,7 @@ function safe-format-and-mount() {
# Format only if the disk is not already formatted.
# Format only if the disk is not already formatted.
if
!
tune2fs
-l
"
${
device
}
"
;
then
if
!
tune2fs
-l
"
${
device
}
"
;
then
echo
"Formatting '
${
device
}
'"
echo
"Formatting '
${
device
}
'"
mkfs.ext4
-F
-E
lazy_itable_init
=
0,lazy_journal_init
=
0,discard
"
${
device
}
"
mkfs.ext4
-F
"
${
device
}
"
fi
fi
mkdir
-p
"
${
mountpoint
}
"
mkdir
-p
"
${
mountpoint
}
"
...
...
Write
Preview
Markdown
is supported
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