Tech Tip: Back up your boot sector
Takeaway:
While there are many ways to back up your file system, such as rsync for remote backups and tar or dd for local backups, there aren't as many options for backing up your boot sector. However, having a backup of your boot sector is equally important in the event of a system crash. For this procedure, the dd tool is your best bet.
LILO, or any other boot loader, is generally installed on the boot sector of the boot drive. After you've installed or modified your boot sector and verified that it works, back it up by writing it to a file on your hard drive or a floppy disk. For example:
# dd if=/dev/hda of=bootsector.img bs=512 count=1
or:
# dd if=/dev/hda of=/dev/fd0 bs=512 count=1
The first command writes the boot sector of your boot drive (in this case, /dev/hda) to a file called bootsector.img in the current directory. Replace /dev/hda with your boot drive, such as /dev/sda if you have a SCSI drive, or /dev/hde if you boot off the first device on the third controller, such as an ATA100 controller in a system with onboard ATA66 controllers.
If you ever need to restore from these images, reverse the "infile" (if) and "outfile" (of) destinations. For example:
# dd if=bootsector.img of=/dev/hda
If it's stored on a floppy, use this:
# dd if=/dev/fd0 of=/dev/hda
Make sure that you use the right source and destination. If you mistakenly write the floppy to the hard drive when you make a backup, you'll damage your boot sector and won't be able to boot.
Print/View all Posts Comments on this article
SponsoredWhite Papers, Webcasts, and Downloads
- CCNA v2.0 Review Global Knowledge
- TCP/IP Sleuthing--Troubleshooting TCP/IP Using Your Toolbox Global Knowledge
- The OSI Model: Understanding the Seven Layers of Computer Networks Global Knowledge
- 2008 IT Salary and Skills Report Global Knowledge
- Eleven Myths about 802.11 Wi-Fi Networks Global Knowledge
Article Categories
- Security
- Security Solutions, IT Locksmith
- Networking and Communications
- E-mail Administration NetNote, Cisco Routers and Switches
- CIO and IT Management
- Project Management, CIO Issues, Strategies that Scale
- Desktops, Laptops & OS
- Windows 2000 Professional, Microsoft Word, Microsoft Excel, Microsoft Access, Windows XP,
- Data Management
- Oracle, SQL Server
- Servers
- Windows NT, Linux NetNote, Windows Server 2003
- Career Development
- Geek Trivia
- Software/Web Development
- Web Development Zone, Visual Basic, .NET

