How to copy single partition?


Login or Register to Reply

 
Thread Tools Search this Thread
# 8  
Old 08-21-2006
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
# 9  
Old 08-21-2006
Quote:
Originally Posted by siegfried
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.
Hmm. cp or dd on a partition won't set a partition bootable, no, that's defined in the partition table, i.e. sector zero.
Quote:
Is there a way I can only change the attributes of the partition?
Something like this will set Partition 1 bootable:

Code:
# fdisk /dev/hda

The number of cylinders for this disk is set to 36483.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): a
Partition number (1-4): 1

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

#

# 10  
Old 08-21-2006
But are you certain that the partition you see is the boot partition? On some systems, like mine, /boot is a partition on it's own, not the root partition.
# 11  
Old 08-21-2006
Quote:
Originally Posted by Corona688
But are you certain that the partition you see is the boot partition? On some systems, like mine, /boot is a partition on it's own, not the root partition.
Is it true that grub.conf lives in an ext2 or ext3 and not in a windows partition?

Assume that is true: grub works but cannot find grub.conf because it cannot mount that partition. Therefor, the boot partition must be good and the fedora partition is a seperate partition that is not bootable.

Siegfried
# 12  
Old 08-22-2006
Problem almost solved

Apparently partition magic changed the fedora partition from #5 to #4. When I type in the commands

root (hd0,4)
kernel /boot/vmlinuz-2.6.11-1.1369_FC4smp ro root=LABEL=/1 rhgb quiet
initrd /boot/initrd-2.6.11-1.1369_FC4smp.img

Everything boots fine! Hurray.

Now, why cannot grub automatically find /boot/grub/grub.conf?

When I manually issue the grub command "find /boot/grub.conf" it finds it on (hd0,4).

How can I make grub automatically find /boot/grub/grub.conf?

Thanks,
Siegfried
# 13  
Old 08-22-2006
Quote:
Originally Posted by siegfried
Is it true that grub.conf lives in an ext2 or ext3 and not in a windows partition?
Grub lives in none of the above. Grub lives in the MBR itself, Sector Zero. It loads stuff like grub.conf from another partition, but the MBR is the prime mover.
Quote:
Assume that is true: grub works but cannot find grub.conf because it cannot mount that partition.
Grub doesn't mount partitions since it happens outside of any OS. It can grab individual files but not much beyond that.
Quote:
Therefor, the boot partition must be good and the fedora partition is a seperate partition that is not bootable.
Or it may be looking for files in a slightly different place than you expect. What does your partition structure look like? Is boot a partition by itself? Does it have a symlink like
Code:
# ls -l /boot/boot
lrwxrwxrwx  1 root root       1 Apr 12  2005 boot -> .
#

I know mine does, and when I decided it was useless and deleted it, my system stopped booting Smilie

And if that doesn't work, maybye try running grub-install again. It'll probe BIOS devices and figure out which BIOS device goes with which Linux device and hopefully configure the bootstrap code from there.
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
More > 1 TB single file cant copy katumping Solaris 10 07-13-2018 08:12 AM
Copy files recursively to one single directory ReneVL Shell Programming and Scripting 4 02-10-2018 07:20 AM
How to copy a 2 Volume mksysb backup to a single tape? AIXBlueCat UNIX for Beginners Questions & Answers 1 07-05-2016 06:22 AM
Shrink LVM partition & create new Linux Primary partition gr8_usk Red Hat 5 09-02-2014 01:33 AM
How to extract data from single first cell and copy it notepad? gchandu UNIX for Advanced & Expert Users 2 06-20-2013 01:13 AM
revision of copy script to allow for single quote LMHmedchem Shell Programming and Scripting 6 09-28-2012 05:07 PM
Single command to Partition and label as LVM whole disk bobby320 Red Hat 0 07-26-2012 05:52 PM
Partition overlaps another partition while creating new parition in solaris nikhil kasar Solaris 2 07-20-2012 06:26 AM
Using dd to copy a partition. newyorkpaulie Filesystems, Disks and Memory 0 06-13-2011 07:28 AM
Enhanced partition copy script (new & improved!) jwzumwalt Shell Programming and Scripting 3 08-27-2010 01:00 AM
copy a whole partition excluding specified. thegeek UNIX for Advanced & Expert Users 2 10-08-2009 06:07 AM
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