Difference between revisions of "Memperbaiki Superblock ext4"
Onnowpurbo (talk | contribs) (New page: Sumber: http://linuxexpresso.wordpress.com/2010/03/31/repair-a-broken-ext4-superblock-in-ubuntu/ HOWTO: Repair a broken Ext4 Superblock in Ubuntu 31Mar10 This has happened to me a few ...) |
Onnowpurbo (talk | contribs) |
||
Line 1: | Line 1: | ||
Sumber: http://linuxexpresso.wordpress.com/2010/03/31/repair-a-broken-ext4-superblock-in-ubuntu/ | Sumber: http://linuxexpresso.wordpress.com/2010/03/31/repair-a-broken-ext4-superblock-in-ubuntu/ | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
First, figure out what partition we’re dealing with. | First, figure out what partition we’re dealing with. | ||
− | + | sudo fdisk -l | |
− | |||
− | |||
The above will list all the partitions on all the drives in your computer. To recover a lost partition, your going to need Testdisk. Testdisk is included in Parted Magic, and there’s a great guide on their site. For this though, we just need the partition number, such as /dev/sda3 or /dev/hdb1. | The above will list all the partitions on all the drives in your computer. To recover a lost partition, your going to need Testdisk. Testdisk is included in Parted Magic, and there’s a great guide on their site. For this though, we just need the partition number, such as /dev/sda3 or /dev/hdb1. | ||
Line 20: | Line 10: | ||
Now, make sure your superblock is the problem, by starting a filesystem check, replacing xxx with your partition name. Here, you can change ext4 to ext3, or ext2 to suit the filesystem. | Now, make sure your superblock is the problem, by starting a filesystem check, replacing xxx with your partition name. Here, you can change ext4 to ext3, or ext2 to suit the filesystem. | ||
− | + | sudo fsck.ext4 -v /dev/xxx | |
− | |||
− | |||
If your superblock is corrupt, the output will look like this | If your superblock is corrupt, the output will look like this | ||
− | + | ||
− | + | fsck /dev/sda5 | |
− | + | fsck 1.41.4 (27-Jan-2009) | |
− | + | e2fsck 1.41.4 (27-Jan-2009) | |
− | + | fsck.ext4: Group descriptors look bad... trying backup blocks... | |
− | + | fsck.ext4: Bad magic number in super-block while trying to open /dev/sda5 | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | The superblock could not be read or does not describe a correct ext4 | |
− | + | filesystem. If the device is valid and it really contains an ext4 | |
− | + | filesystem (and not swap or ufs or something else), then the superblock | |
− | + | is corrupt, and you might try running e2fsck with an alternate superblock: | |
− | + | e2fsck -b 8193 <device> | |
Now lets find where your superblock backups are kept. | Now lets find where your superblock backups are kept. | ||
− | |||
− | |||
− | + | sudo mke2fs -n /dev/xxx | |
Down at the bottom of this output, should be a list of the backups | Down at the bottom of this output, should be a list of the backups | ||
− | + | Superblock backups stored on blocks: | |
− | + | 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208 | |
− | |||
− | |||
− | |||
− | |||
Your almost there. Finally, restore the superblock from the backup, again replacing the x’s with your partition name, and block_number with the first backup superblock. | Your almost there. Finally, restore the superblock from the backup, again replacing the x’s with your partition name, and block_number with the first backup superblock. | ||
− | + | sudo e2fsck -b block_number /dev/xxx | |
− | |||
− | |||
− | |||
Now reboot, and your superblock should be fixed. If it’s not, repeat the steps, but restore a different backup superblock | Now reboot, and your superblock should be fixed. If it’s not, repeat the steps, but restore a different backup superblock |
Revision as of 07:44, 14 July 2014
Sumber: http://linuxexpresso.wordpress.com/2010/03/31/repair-a-broken-ext4-superblock-in-ubuntu/
First, figure out what partition we’re dealing with.
sudo fdisk -l
The above will list all the partitions on all the drives in your computer. To recover a lost partition, your going to need Testdisk. Testdisk is included in Parted Magic, and there’s a great guide on their site. For this though, we just need the partition number, such as /dev/sda3 or /dev/hdb1.
Now, make sure your superblock is the problem, by starting a filesystem check, replacing xxx with your partition name. Here, you can change ext4 to ext3, or ext2 to suit the filesystem.
sudo fsck.ext4 -v /dev/xxx
If your superblock is corrupt, the output will look like this
fsck /dev/sda5 fsck 1.41.4 (27-Jan-2009) e2fsck 1.41.4 (27-Jan-2009) fsck.ext4: Group descriptors look bad... trying backup blocks... fsck.ext4: Bad magic number in super-block while trying to open /dev/sda5 The superblock could not be read or does not describe a correct ext4 filesystem. If the device is valid and it really contains an ext4 filesystem (and not swap or ufs or something else), then the superblock is corrupt, and you might try running e2fsck with an alternate superblock: e2fsck -b 8193 <device>
Now lets find where your superblock backups are kept.
sudo mke2fs -n /dev/xxx
Down at the bottom of this output, should be a list of the backups
Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208
Your almost there. Finally, restore the superblock from the backup, again replacing the x’s with your partition name, and block_number with the first backup superblock.
sudo e2fsck -b block_number /dev/xxx
Now reboot, and your superblock should be fixed. If it’s not, repeat the steps, but restore a different backup superblock