![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Gentoo Gentoo Linux is a versatile and fast, completely free Linux distribution geared towards developers and network professionals. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Install more than one OS in a single partition... | Alohamora | Slackware | 2 | 01-22-2008 07:41 AM |
| Copy single file to multiple directories | kthatch | UNIX for Dummies Questions & Answers | 2 | 11-11-2007 06:10 PM |
| How to copy data into a single file plus title | c0384 | Shell Programming and Scripting | 4 | 05-15-2007 10:15 AM |
| I've created a partition with GNU Parted, how do I mount the partition? | jtp51 | UNIX for Dummies Questions & Answers | 1 | 09-18-2006 12:01 PM |
| understanding logical partition, physical partition | yls177 | UNIX for Dummies Questions & Answers | 3 | 11-15-2002 10:49 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
How to copy single partition?
I presently backup my multi-OS multi-paritition boot drive (fedora core 4/ext3, WinXPServer/NTFS, WinXPHome/FAT32) with the command:
telinit 1; cp /dev/sda /dev/sdb And this works. Is there a command to only copy a single partition instead of an entire device? And what about the grub stuff. Is that in a partition? My grub stuff is corrupted or the grub.conf file is bad. I can boot windows manually via grub but not fedora. How can I restore the grub and linux partitions but not the windows partition? Thanks, siegfried |
|
||||
|
Partitions for /dev/sda are going to be like /dev/sda1, /dev/sda2, /dev/sda3, etc. You can copy them too.
The master boot record is outside of all partitions. It is the very, very first sector on the hard drive. You can copy just the boot sector like this: Code:
dd if=/dev/hda bs=512 count=1 of=bootsector I'd boot the system with some sort of linux livecd to see what's going on with your partitions, and edit your grub.conf if need be. As for how to restore a selected partition from that giant everything-backup file, I don't know. There doesn't seem to be anything like a loop device for splitting a file into partitions the way linux handles hard drives... I'll do some experimenting and see. You can restore your boot sector easily, though, if that's the problem. Code:
dd if=awesome-ginormous-all-in-one-universal-backup-file.img of=/dev/hda bs=512 count=1 Last edited by Corona688; 08-19-2006 at 03:24 AM.. |
|
||||
|
Wait. Your backup is a drive too, isn't it.
![]() It should have partitions /dev/sdb1 /dev/sdb2 etc. You might need to do this to get them to become visible on /dev/sdb however, since linux needs to be told when the partition table changes. Either that, or reboot after you do that cp thing to see the new partitions. Code:
# fdisk /dev/sdb Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. # |
|
||||
|
Yes -- my backup is a triple *bootable* drive (thank goodness -- I can verify that everything still works).
So you gave me several dd commands but not one that would copy an entire partition from one disk to another. Could you give me an example of that? On your dd commands, how do you select a block size? Where do those other numeric values come from? So if I'm getting a grub prompt but grub cannot find the grub.conf file (which I believe is in a linux partition) that could indicate the linux partition is corrupted. I wonder if grub could do a dd for me? hmmm... if not, then knoppix probably could. Let's suppose I book with knoppix. Would fdisk -l enumerate my drives? I don't understand the dd command for copying a boot sector. Where is the destination and source specified? Thanks, Siegfried |
|
|||||
|
Quote:
For the record, copying from disk A partition 1 to disk B partition 1: Code:
dd if=/dev/sda1 of=/dev/sdb1 conv=noerror,sync # I'd reccomend dd over cp, dd can be told to not die on bad sectors as in above # cp /dev/sda1 /dev/sdb1 Quote:
Quote:
I prefer Gentoo liveCDs, or those old little Redhat sysadm disks.Quote:
![]() Quote:
![]() |
|
||||
|
Do dd and cp copy contents only?
If I use dd or cp, will they only copy the contents?
The contents of the misbehaving partition seem to be perfectly intact. I can boot SuSE live from a DVD and mount the partition. The problem is that grub won't recognize it as a boot partition. Is there a way I can only change the attributes of the partition? will dd or cp change the partition attributes? Thanks, Siegfried |
|
||||
|
Partition is intact
I was able to boot SuSE live via a DVD I burned and mount the damaged partition. It mounted fine and all the files seemed to be intact!
fdisk -l did not complain about anything. parted's "check 5" command gave this strange error message Error: File system has an incompatable feature enabled. What does that mean? Any suggestions has to how to make this partition compatible with grub so I can boot fedora again? Thanks, Siegfried |
![]() |
| Bookmarks |
| Tags |
| knoppix, linux, linux commands |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|