How to move an ext4 journal

Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
I have an ext4 filesystem on an USB stick and after using it for some time I would like to move the journal to some other blocks, so that the stick lives longer. The journal is described by inode 8, but how to I reallocate its blocks to a different place?
Is it possible to do that at file system creation time?
ext4
add a comment |Â
up vote
2
down vote
favorite
I have an ext4 filesystem on an USB stick and after using it for some time I would like to move the journal to some other blocks, so that the stick lives longer. The journal is described by inode 8, but how to I reallocate its blocks to a different place?
Is it possible to do that at file system creation time?
ext4
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I have an ext4 filesystem on an USB stick and after using it for some time I would like to move the journal to some other blocks, so that the stick lives longer. The journal is described by inode 8, but how to I reallocate its blocks to a different place?
Is it possible to do that at file system creation time?
ext4
I have an ext4 filesystem on an USB stick and after using it for some time I would like to move the journal to some other blocks, so that the stick lives longer. The journal is described by inode 8, but how to I reallocate its blocks to a different place?
Is it possible to do that at file system creation time?
ext4
ext4
edited Apr 25 '16 at 20:48
Anthon
58.7k1796159
58.7k1796159
asked Apr 25 '16 at 20:33
Zak
111
111
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
2
down vote
Check man mke2fs. Pay close attention to the -J / location section and the -E / packed_meta_blocks section.
You said you were using a USB stick. I'm assuming it can be formatted without consequence. Did you backup your data?
- Format the disk with a default command and get data on how the USB stick is put together.
- Format the disk with a altered command and get data on how the USB stick looks with the location moved.
- Moving the journal on an in-use disk.
You did backup you data?
Part 1. Default journal for reference
- Insert USB stick.
- In a terminal window, use
sudoorsuand supply the password. - Use
blkid " to find your " /dev/sdXXlabel. - Command
mke2fs -t ext4 /dev/sdXXfor a default format. - Now to pull out data about the drive.
- Command
tune2fs -l /dev/sdXX. Find the line "Journal inode". Write this number down. It is usually 8. Command
debugfs /dev/sdXXCommand
stat <8>. The "8" comes from the "Journal inode" line. The command needs to be entered exactly with the <,>.What do you see? The third line lists the size of the journal. Write this down. My machine came in at 33554432 (~32Mb).
The 13th line lists the extents used for the journal. Write this down. My machine came in at 196608 - 204799. 196608 time 4k per page equals 786M.- Command
qthenquit.
- Remove USB stick
Part 2. Moving the journal
- Same as above.
- Same as above.
- Same as above.
- command
mke2fs -J location=600M /dev/sdXX. This should move the default journal to a point starting at the 600M mark. - As above.
- As above.
- As above.
- The journal size should be the same. The first journal extent has moved to 153600 on my machine. 153600 times 4k per page equals ~614M.
- As above.
- As above.
Part 3. Moving the journal on an in-use disk
- Backup your data?
- Unmount the partition.
umount /dev/sdXX. - Remove old journal.
tune2fs -O ^has_journal /dev/sdXX. - Install new journal.
tune2fs -J location=XX[M,G] /dev/sdXX. Specify units. The journal can be moved to a mega, giga location. e2fsck -fv /dev/sdXXjust to be safe.- Reboot the machine. You did backup didn't you?
You can change the journal size and location with mke2fs -J size=XX,location=YY[M,G,P,T] /dev/sdXX. The size notation is always in MB.
Where did this come from? "Trial and Error" course from the School of Hard Knocks.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
Check man mke2fs. Pay close attention to the -J / location section and the -E / packed_meta_blocks section.
You said you were using a USB stick. I'm assuming it can be formatted without consequence. Did you backup your data?
- Format the disk with a default command and get data on how the USB stick is put together.
- Format the disk with a altered command and get data on how the USB stick looks with the location moved.
- Moving the journal on an in-use disk.
You did backup you data?
Part 1. Default journal for reference
- Insert USB stick.
- In a terminal window, use
sudoorsuand supply the password. - Use
blkid " to find your " /dev/sdXXlabel. - Command
mke2fs -t ext4 /dev/sdXXfor a default format. - Now to pull out data about the drive.
- Command
tune2fs -l /dev/sdXX. Find the line "Journal inode". Write this number down. It is usually 8. Command
debugfs /dev/sdXXCommand
stat <8>. The "8" comes from the "Journal inode" line. The command needs to be entered exactly with the <,>.What do you see? The third line lists the size of the journal. Write this down. My machine came in at 33554432 (~32Mb).
The 13th line lists the extents used for the journal. Write this down. My machine came in at 196608 - 204799. 196608 time 4k per page equals 786M.- Command
qthenquit.
- Remove USB stick
Part 2. Moving the journal
- Same as above.
- Same as above.
- Same as above.
- command
mke2fs -J location=600M /dev/sdXX. This should move the default journal to a point starting at the 600M mark. - As above.
- As above.
- As above.
- The journal size should be the same. The first journal extent has moved to 153600 on my machine. 153600 times 4k per page equals ~614M.
- As above.
- As above.
Part 3. Moving the journal on an in-use disk
- Backup your data?
- Unmount the partition.
umount /dev/sdXX. - Remove old journal.
tune2fs -O ^has_journal /dev/sdXX. - Install new journal.
tune2fs -J location=XX[M,G] /dev/sdXX. Specify units. The journal can be moved to a mega, giga location. e2fsck -fv /dev/sdXXjust to be safe.- Reboot the machine. You did backup didn't you?
You can change the journal size and location with mke2fs -J size=XX,location=YY[M,G,P,T] /dev/sdXX. The size notation is always in MB.
Where did this come from? "Trial and Error" course from the School of Hard Knocks.
add a comment |Â
up vote
2
down vote
Check man mke2fs. Pay close attention to the -J / location section and the -E / packed_meta_blocks section.
You said you were using a USB stick. I'm assuming it can be formatted without consequence. Did you backup your data?
- Format the disk with a default command and get data on how the USB stick is put together.
- Format the disk with a altered command and get data on how the USB stick looks with the location moved.
- Moving the journal on an in-use disk.
You did backup you data?
Part 1. Default journal for reference
- Insert USB stick.
- In a terminal window, use
sudoorsuand supply the password. - Use
blkid " to find your " /dev/sdXXlabel. - Command
mke2fs -t ext4 /dev/sdXXfor a default format. - Now to pull out data about the drive.
- Command
tune2fs -l /dev/sdXX. Find the line "Journal inode". Write this number down. It is usually 8. Command
debugfs /dev/sdXXCommand
stat <8>. The "8" comes from the "Journal inode" line. The command needs to be entered exactly with the <,>.What do you see? The third line lists the size of the journal. Write this down. My machine came in at 33554432 (~32Mb).
The 13th line lists the extents used for the journal. Write this down. My machine came in at 196608 - 204799. 196608 time 4k per page equals 786M.- Command
qthenquit.
- Remove USB stick
Part 2. Moving the journal
- Same as above.
- Same as above.
- Same as above.
- command
mke2fs -J location=600M /dev/sdXX. This should move the default journal to a point starting at the 600M mark. - As above.
- As above.
- As above.
- The journal size should be the same. The first journal extent has moved to 153600 on my machine. 153600 times 4k per page equals ~614M.
- As above.
- As above.
Part 3. Moving the journal on an in-use disk
- Backup your data?
- Unmount the partition.
umount /dev/sdXX. - Remove old journal.
tune2fs -O ^has_journal /dev/sdXX. - Install new journal.
tune2fs -J location=XX[M,G] /dev/sdXX. Specify units. The journal can be moved to a mega, giga location. e2fsck -fv /dev/sdXXjust to be safe.- Reboot the machine. You did backup didn't you?
You can change the journal size and location with mke2fs -J size=XX,location=YY[M,G,P,T] /dev/sdXX. The size notation is always in MB.
Where did this come from? "Trial and Error" course from the School of Hard Knocks.
add a comment |Â
up vote
2
down vote
up vote
2
down vote
Check man mke2fs. Pay close attention to the -J / location section and the -E / packed_meta_blocks section.
You said you were using a USB stick. I'm assuming it can be formatted without consequence. Did you backup your data?
- Format the disk with a default command and get data on how the USB stick is put together.
- Format the disk with a altered command and get data on how the USB stick looks with the location moved.
- Moving the journal on an in-use disk.
You did backup you data?
Part 1. Default journal for reference
- Insert USB stick.
- In a terminal window, use
sudoorsuand supply the password. - Use
blkid " to find your " /dev/sdXXlabel. - Command
mke2fs -t ext4 /dev/sdXXfor a default format. - Now to pull out data about the drive.
- Command
tune2fs -l /dev/sdXX. Find the line "Journal inode". Write this number down. It is usually 8. Command
debugfs /dev/sdXXCommand
stat <8>. The "8" comes from the "Journal inode" line. The command needs to be entered exactly with the <,>.What do you see? The third line lists the size of the journal. Write this down. My machine came in at 33554432 (~32Mb).
The 13th line lists the extents used for the journal. Write this down. My machine came in at 196608 - 204799. 196608 time 4k per page equals 786M.- Command
qthenquit.
- Remove USB stick
Part 2. Moving the journal
- Same as above.
- Same as above.
- Same as above.
- command
mke2fs -J location=600M /dev/sdXX. This should move the default journal to a point starting at the 600M mark. - As above.
- As above.
- As above.
- The journal size should be the same. The first journal extent has moved to 153600 on my machine. 153600 times 4k per page equals ~614M.
- As above.
- As above.
Part 3. Moving the journal on an in-use disk
- Backup your data?
- Unmount the partition.
umount /dev/sdXX. - Remove old journal.
tune2fs -O ^has_journal /dev/sdXX. - Install new journal.
tune2fs -J location=XX[M,G] /dev/sdXX. Specify units. The journal can be moved to a mega, giga location. e2fsck -fv /dev/sdXXjust to be safe.- Reboot the machine. You did backup didn't you?
You can change the journal size and location with mke2fs -J size=XX,location=YY[M,G,P,T] /dev/sdXX. The size notation is always in MB.
Where did this come from? "Trial and Error" course from the School of Hard Knocks.
Check man mke2fs. Pay close attention to the -J / location section and the -E / packed_meta_blocks section.
You said you were using a USB stick. I'm assuming it can be formatted without consequence. Did you backup your data?
- Format the disk with a default command and get data on how the USB stick is put together.
- Format the disk with a altered command and get data on how the USB stick looks with the location moved.
- Moving the journal on an in-use disk.
You did backup you data?
Part 1. Default journal for reference
- Insert USB stick.
- In a terminal window, use
sudoorsuand supply the password. - Use
blkid " to find your " /dev/sdXXlabel. - Command
mke2fs -t ext4 /dev/sdXXfor a default format. - Now to pull out data about the drive.
- Command
tune2fs -l /dev/sdXX. Find the line "Journal inode". Write this number down. It is usually 8. Command
debugfs /dev/sdXXCommand
stat <8>. The "8" comes from the "Journal inode" line. The command needs to be entered exactly with the <,>.What do you see? The third line lists the size of the journal. Write this down. My machine came in at 33554432 (~32Mb).
The 13th line lists the extents used for the journal. Write this down. My machine came in at 196608 - 204799. 196608 time 4k per page equals 786M.- Command
qthenquit.
- Remove USB stick
Part 2. Moving the journal
- Same as above.
- Same as above.
- Same as above.
- command
mke2fs -J location=600M /dev/sdXX. This should move the default journal to a point starting at the 600M mark. - As above.
- As above.
- As above.
- The journal size should be the same. The first journal extent has moved to 153600 on my machine. 153600 times 4k per page equals ~614M.
- As above.
- As above.
Part 3. Moving the journal on an in-use disk
- Backup your data?
- Unmount the partition.
umount /dev/sdXX. - Remove old journal.
tune2fs -O ^has_journal /dev/sdXX. - Install new journal.
tune2fs -J location=XX[M,G] /dev/sdXX. Specify units. The journal can be moved to a mega, giga location. e2fsck -fv /dev/sdXXjust to be safe.- Reboot the machine. You did backup didn't you?
You can change the journal size and location with mke2fs -J size=XX,location=YY[M,G,P,T] /dev/sdXX. The size notation is always in MB.
Where did this come from? "Trial and Error" course from the School of Hard Knocks.
edited Aug 15 at 0:28
slmâ¦
238k65492662
238k65492662
answered Aug 7 at 3:20
user304068
213
213
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f278998%2fhow-to-move-an-ext4-journal%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password