tutorial - HowTo take backup of Partition Table

Many of us are doing backups of all kinds of data: from regular files, databases, to full partitions or hard drives. What I have noticed that very few peoples even think about the partition table. Given the importance of the partition table I would suggest to have a backup of it, in case you will have a corrupted partition table, if you made a change by mistake or even if that gets deleted somehow (by mistake or intentionally). You still have the data on the disk but without recreating the correct partition table it will not be very easy to get the data back. Anyway this is very easy to do, so it is better to have it on hand, than regret that you have not done this when needed.

We can get a quick look on all the existing partitions on all the available hard drives with fdisk using the -l switch without any other parameter:

fdisk -l
Disk /dev/sda: 74.3 GB, 74355769344 bytes
255 heads, 63 sectors/track, 9039 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 16 128488+ 83 Linux
/dev/sda2 17 259 1951897+ 82 Linux swap / Solaris
/dev/sda3 260 2083 14651280 83 Linux
/dev/sda4 2084 9039 55874070 83 Linux

Disk /dev/sdb: 73.4 GB, 73407820800 bytes
255 heads, 63 sectors/track, 8924 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 8924 71681998+ 83 Linux

If we add to the command line the particular device that corresponds to a hard disk, like /dev/sdb we get the same result only for that device:

fdisk -l /dev/sdb

Disk /dev/sdb: 73.4 GB, 73407820800 bytes
255 heads, 63 sectors/track, 8924 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 8924 71681998+ 83 Linux

Of course someone might use only this information to recreate the partition table by manually creating the same partitions with the same start/end blocks (in case you want to do that you just have to save the above output in a file so you have that information on hand when needed), but there is a simpler way using sfdisk:

sfdisk -d /dev/sda
# partition table of /dev/sda
unit: sectors

/dev/sda1 : start= 63, size= 256977, Id=83
/dev/sda2 : start= 257040, size= 3903795, Id=82
/dev/sda3 : start= 4160835, size= 29302560, Id=83
/dev/sda4 : start= 33463395, size=111748140, Id=83

Using sfdisk with the -d option we can get a dump of the current partition table in a regular file, and if needed we can restore it from that file:

sfdisk -d /dev/sda > sda_table

and to restore the partition table:

sfdisk /dev/sda <>

Regardless on the method used, having a backup of the partition table might be handy. ;)

One more tip: another usage of sfdisk with -d is to create an identical partition table from another hard disk. In this example we are partitioning sdb with the exact same partitions as sda:

sfdisk -d /dev/sda | sfdisk /dev/sdb

of course this can be handy when the hard drives are identical, in raid1 setups, etc.



Free, facebook, tips, Links, blogging, Downloads, Google, facebookTips, money, news, apps, Social, Media, Website, Tricks, games, Android, software, PIctures, Internet, Security, Web, codes, Review, bloggers, SAMSUNG, Worldwide, Contest, Exitic, Phones, facebookTricks, hacking, London, Olympics, SEO, Youtube, iOS, Adsense, gadgets, iPHONE, widgets, Doodle, twitter, video, Deals, technology, Aircel, Airtel, iPAD, Angry, Birds, BSNL, TechLife, GMAIL, Idea, Microsoft, SmartPhones, Stress, Buster, Windows, Yahoo, Infolinks, Nokia, Scam, Uninor, browsers, Amazon, Euro, CUP, Chat, IDM, JOBS, Modem, Music, Reliance, Results, SSC, Tata, Docomo, bing, freebie, mobile, placements, AIEEE, AlertPay, Chrome, College, Competetive, Exam, Dehradun, Extension, FireFox, GPRS, HTC, IMPACT, Info, MTS, Mark, Zukerberg, Paypal, Promotional, Post, Torrent, UTU, Unlocking, VodaFone, Wall, Paper, apple, books, engineering, iCAR, iTunes, pinterest, rovio, AVG, Admit, Card, Adobe, Affiliate, Marketing, Akhilesh, Amul, Girl, BlackBerry, ChromeBook, Clixsense, Coupon, Digitallife, Discovery, Emoticons, Festival, GATE, GIMP, Income, Tax, International, JSS, JailBreaking, Kindle, Linux, Local, MAX, PAYNE, Mac, Mango, Memory, Speed, Nexus, Online, Shopping, Raakhi, Report, Rising, Stars, Sample, Science, Sony, Syllabus, TabletBooK, Teamviewer, Templates, Dark, Knight, Rises, USA, UPMT, Virgin, Xperia, ZTE, challan, counselling, course, btech, funny, iMOVE, registration

source:http://linuxpoison.blogspot.com/2008/02/13578175809515.html

Labels

Web Search Gmail Google Docs Mobile YouTube Google Maps Google Chrome User interface Tips iGoogle Social Google Reader Traffic Making Devices cpp programming Ads Image Search Google Calendar tips dan trik Google Video Google Translate web programming Picasa Web Albums Blogger Google News Google Earth Yahoo Android Google Talk Google Plus Greasemonkey Security software download info Firefox extensions Google Toolbar Software OneBox Google Apps Google Suggest SEO Traffic tips Book Search API Acquisitions InOut Visualization Web Design Method for Getting Ultimate Traffic Webmasters Google Desktop How to Blogging Music Nostalgia orkut Google Chrome OS Google Contacts Google Notebook SQL programming Google Local Make Money Windows Live GDrive Google Gears April Fools Day Google Analytics Google Co-op visual basic Knowledge java programming Google Checkout Google Instant Google Bookmarks Google Phone Google Trends Web History mp3 download Easter Egg Google Profiles Blog Search Google Buzz Google Services Site Map for Ur Site game download games trick Google Pack Spam cerita hidup Picasa Product's Marketing Universal Search FeedBurner Google Groups Month in review Twitter Traffic AJAX Search Google Dictionary Google Sites Google Update Page Creator Game Google Finance Google Goggles Google Music file download Annoyances Froogle Google Base Google Latitude Google Voice Google Wave Google Health Google Scholar PlusBox SearchMash teknologi unik video download windows Facebook Traffic Social Media Marketing Yahoo Pipes Google Play Google Promos Google TV SketchUp WEB Domain WWW World Wide Service chord Improve Adsence Earning jurnalistik sistem operasi AdWords Traffic App Designing Tips and Tricks WEB Hosting linux How to Get Hosting Linux Kernel WEB Errors Writing Content award business communication ubuntu unik