How can I correct logical bad sectors in HDD in Ubuntu?
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
0
down vote
favorite
During boot time I found that my hard disk had logical errors in different sectors. I did my research and ran this command:
sudo badblocks -sv /dev/sda1 > bad-blocks-result
This command created a file in my home directory called 'bad-blocks-result' which contains a series of numbers, which I guess are bad sectors.
What procedure should I follow next to correct my hard disk?
boot grub2 hard-drive fsck badblocks
add a comment |Â
up vote
0
down vote
favorite
During boot time I found that my hard disk had logical errors in different sectors. I did my research and ran this command:
sudo badblocks -sv /dev/sda1 > bad-blocks-result
This command created a file in my home directory called 'bad-blocks-result' which contains a series of numbers, which I guess are bad sectors.
What procedure should I follow next to correct my hard disk?
boot grub2 hard-drive fsck badblocks
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
During boot time I found that my hard disk had logical errors in different sectors. I did my research and ran this command:
sudo badblocks -sv /dev/sda1 > bad-blocks-result
This command created a file in my home directory called 'bad-blocks-result' which contains a series of numbers, which I guess are bad sectors.
What procedure should I follow next to correct my hard disk?
boot grub2 hard-drive fsck badblocks
During boot time I found that my hard disk had logical errors in different sectors. I did my research and ran this command:
sudo badblocks -sv /dev/sda1 > bad-blocks-result
This command created a file in my home directory called 'bad-blocks-result' which contains a series of numbers, which I guess are bad sectors.
What procedure should I follow next to correct my hard disk?
boot grub2 hard-drive fsck badblocks
boot grub2 hard-drive fsck badblocks
edited Dec 10 '14 at 18:40
TRiG
1,38211331
1,38211331
asked Dec 10 '14 at 17:45
user2650973
83115
83115
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
For each bad block number, first use dd
to verify that it is bad ( and you didn't make some mistake somewhere ):
sudo dd if=/dev/sda1 skip=##### count=1 of=/dev/null iflag=direct bs=1024
If that comes back with an error, then you are looking in the right spot.. now it's time to correct it:
sudo dd if=/dev/zero of=/dev/sda1 seek=###### count=1 oflag=direct bs=1024
If the second comes back without an error, you should be able to retry the first command and it should also now not error. Repeat for each bad block number listed in the file.
Make sure to type the commands exactly as shown ( substituting the block number for the #### ) or you can destroy your data
You also might want to run sudo smartctl -a /dev/sda
to read the SMART status of the drive. Of note are the raw values for the reallocated count and pending. If you fixed all of the bad sectors, the pending count will have returned to zero. If they were remapped, the reallocated count will have gone up. If this is more than a handful you probably want to replace the drive as it is likely to get worse. If the reallocated count didn't go up, then there is nothing physically wrong with the drive.
At this point you also should boot into rescue mode and run a full fsck
on the volume to make sure that checks out.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
For each bad block number, first use dd
to verify that it is bad ( and you didn't make some mistake somewhere ):
sudo dd if=/dev/sda1 skip=##### count=1 of=/dev/null iflag=direct bs=1024
If that comes back with an error, then you are looking in the right spot.. now it's time to correct it:
sudo dd if=/dev/zero of=/dev/sda1 seek=###### count=1 oflag=direct bs=1024
If the second comes back without an error, you should be able to retry the first command and it should also now not error. Repeat for each bad block number listed in the file.
Make sure to type the commands exactly as shown ( substituting the block number for the #### ) or you can destroy your data
You also might want to run sudo smartctl -a /dev/sda
to read the SMART status of the drive. Of note are the raw values for the reallocated count and pending. If you fixed all of the bad sectors, the pending count will have returned to zero. If they were remapped, the reallocated count will have gone up. If this is more than a handful you probably want to replace the drive as it is likely to get worse. If the reallocated count didn't go up, then there is nothing physically wrong with the drive.
At this point you also should boot into rescue mode and run a full fsck
on the volume to make sure that checks out.
add a comment |Â
up vote
1
down vote
accepted
For each bad block number, first use dd
to verify that it is bad ( and you didn't make some mistake somewhere ):
sudo dd if=/dev/sda1 skip=##### count=1 of=/dev/null iflag=direct bs=1024
If that comes back with an error, then you are looking in the right spot.. now it's time to correct it:
sudo dd if=/dev/zero of=/dev/sda1 seek=###### count=1 oflag=direct bs=1024
If the second comes back without an error, you should be able to retry the first command and it should also now not error. Repeat for each bad block number listed in the file.
Make sure to type the commands exactly as shown ( substituting the block number for the #### ) or you can destroy your data
You also might want to run sudo smartctl -a /dev/sda
to read the SMART status of the drive. Of note are the raw values for the reallocated count and pending. If you fixed all of the bad sectors, the pending count will have returned to zero. If they were remapped, the reallocated count will have gone up. If this is more than a handful you probably want to replace the drive as it is likely to get worse. If the reallocated count didn't go up, then there is nothing physically wrong with the drive.
At this point you also should boot into rescue mode and run a full fsck
on the volume to make sure that checks out.
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
For each bad block number, first use dd
to verify that it is bad ( and you didn't make some mistake somewhere ):
sudo dd if=/dev/sda1 skip=##### count=1 of=/dev/null iflag=direct bs=1024
If that comes back with an error, then you are looking in the right spot.. now it's time to correct it:
sudo dd if=/dev/zero of=/dev/sda1 seek=###### count=1 oflag=direct bs=1024
If the second comes back without an error, you should be able to retry the first command and it should also now not error. Repeat for each bad block number listed in the file.
Make sure to type the commands exactly as shown ( substituting the block number for the #### ) or you can destroy your data
You also might want to run sudo smartctl -a /dev/sda
to read the SMART status of the drive. Of note are the raw values for the reallocated count and pending. If you fixed all of the bad sectors, the pending count will have returned to zero. If they were remapped, the reallocated count will have gone up. If this is more than a handful you probably want to replace the drive as it is likely to get worse. If the reallocated count didn't go up, then there is nothing physically wrong with the drive.
At this point you also should boot into rescue mode and run a full fsck
on the volume to make sure that checks out.
For each bad block number, first use dd
to verify that it is bad ( and you didn't make some mistake somewhere ):
sudo dd if=/dev/sda1 skip=##### count=1 of=/dev/null iflag=direct bs=1024
If that comes back with an error, then you are looking in the right spot.. now it's time to correct it:
sudo dd if=/dev/zero of=/dev/sda1 seek=###### count=1 oflag=direct bs=1024
If the second comes back without an error, you should be able to retry the first command and it should also now not error. Repeat for each bad block number listed in the file.
Make sure to type the commands exactly as shown ( substituting the block number for the #### ) or you can destroy your data
You also might want to run sudo smartctl -a /dev/sda
to read the SMART status of the drive. Of note are the raw values for the reallocated count and pending. If you fixed all of the bad sectors, the pending count will have returned to zero. If they were remapped, the reallocated count will have gone up. If this is more than a handful you probably want to replace the drive as it is likely to get worse. If the reallocated count didn't go up, then there is nothing physically wrong with the drive.
At this point you also should boot into rescue mode and run a full fsck
on the volume to make sure that checks out.
answered Dec 10 '14 at 20:27
psusi
30.5k14786
30.5k14786
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
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%2faskubuntu.com%2fquestions%2f558923%2fhow-can-i-correct-logical-bad-sectors-in-hdd-in-ubuntu%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
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');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
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');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
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