{"id":104,"date":"2012-07-30T10:37:19","date_gmt":"2012-07-30T10:37:19","guid":{"rendered":"http:\/\/www.buildingcubes.com\/?p=104"},"modified":"2016-04-03T14:05:18","modified_gmt":"2016-04-03T14:05:18","slug":"linux-file-system-commands-ext2-ext3-ext4","status":"publish","type":"post","link":"https:\/\/www.voodoo.business\/blog\/2012\/07\/30\/linux-file-system-commands-ext2-ext3-ext4\/","title":{"rendered":"Linux File System commands ext2, ext3, ext4"},"content":{"rendered":"<p>UPDATE: This post has been added at easywebdns : <a href=\"http:\/\/www.easywebdns.com\/tutorials\/Linux\/Recovering_an_ext3_hard_disk\">recovering ext3 hard disks<\/a><\/p>\n<p>So, here are the tools you need<\/p>\n<p>1- Checking a linux partition for bad sectors \/ Bad Blocks without deleting the data<\/p>\n<p>badblocks -o \/path\/somefiletowriteto.txt \/dev\/sdb1<\/p>\n<p>this will do a check and write the bad block numbers to a text file.<\/p>\n<p>Please note that 6TB and 8TB hard drives will not work out of the box with badblocks program, you will probably get a message informing you that the boundary must fit a 32bit integer (Value too large for defined data type), in that case, you can always increase the block size with the (-b 4096) switch, this will give you 8 times more block addressing space (Since the default is 512 bytes.<\/p>\n<p>If you want it to test the disks hard but you are OK with deleting the data (Say after you dd_rescue), then try the -w switch<\/p>\n<pre>badblocks -w -o \/path\/somefiletowriteto.txt \/dev\/sdb1\r\n\r\nOr, to see information while it scans\r\n\r\nbadblocks -wsv \/dev\/sdd &gt; \/root\/250bad-blocks.txt<\/pre>\n<p>Notice that the -w has to come before the -o since the -o must be followed by a file name.<\/p>\n<p>2- fsck \/dev\/sdb1 , the all famous, need i say more ?<\/p>\n<p>3- tune2fs<\/p>\n<p><strong class=\"highlight\">tune2fs<\/strong> -O ^has_journal \/dev\/sdb1<\/p>\n<p>remove the Journal (Converting ext3 to ext2 file system)<\/p>\n<p>4- Mounting a disk: mount -t ext3 \/dev\/sdb1 \/adirectory<\/p>\n<p>5- debugfs &lt;- use it in Read only more, this thing is like brain surgery, 1 mistake and your FS is playing chess in heaven with all the other dead disks<\/p>\n<p>6- dd_rescue \/dev\/sdb1 \/directory\/mydisk.img<\/p>\n<p>7- Running fsck on a disk image<\/p>\n<pre>fsck -y \/path\/mydisk.img<\/pre>\n<p>8- Mount the image<\/p>\n<pre>mount \/pathto\/backup.img \/mountpoint\/data<\/pre>\n<p>this is a nice link for you http:\/\/www.linuxjournal.com\/article\/193 that already has info about the stuff i mentioned here<\/p>\n<p>Those are probably the most common, will add more when i remember them<\/p>\n","protected":false},"excerpt":{"rendered":"<p>UPDATE: This post has been added at easywebdns : recovering ext3 hard disks So, here are the tools you need 1- Checking a linux partition for bad sectors \/ Bad Blocks without deleting the data badblocks -o \/path\/somefiletowriteto.txt \/dev\/sdb1 this will do a check and write the bad block numbers to a text file. Please [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[49,50,51],"class_list":["post-104","post","type-post","status-publish","format-standard","hentry","category-linux","tag-ext2","tag-ext3","tag-ext4"],"_links":{"self":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/104","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/comments?post=104"}],"version-history":[{"count":3,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/104\/revisions"}],"predecessor-version":[{"id":742,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/104\/revisions\/742"}],"wp:attachment":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/media?parent=104"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/categories?post=104"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/tags?post=104"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}