I'm in the process of replacing a notebook computer hard drive with a larger one. I can use dd to copy non-LVM partitions to a file on a USB drive, but that doesn't seem to work with LVM. How can a LVM partition be copied in a similar manner? I'm used a rescue CD to do all the copying. tnx jk -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
* James Knott <james.knott@rogers.com> [02-28-10 15:03]:
I'm in the process of replacing a notebook computer hard drive with a larger one. I can use dd to copy non-LVM partitions to a file on a USB drive, but that doesn't seem to work with LVM. How can a LVM partition be copied in a similar manner? I'm used a rescue CD to do all the copying.
I think... add the usb drive to your lvm, use pvmove to relocate the previous data to the usb portion, then reduce the lvm to the usb portion, which then should exist by itself. then reverse, add the new drive to the usb lvm and pvmove to the new drive, reduce, remove..... Oh, what a convoluted web we weave :^) -- Patrick Shanahan Plainfield, Indiana, USA HOG # US1244711 http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 Registered Linux User #207535 @ http://counter.li.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Patrick Shanahan wrote:
* James Knott<james.knott@rogers.com> [02-28-10 15:03]:
I'm in the process of replacing a notebook computer hard drive with a larger one. I can use dd to copy non-LVM partitions to a file on a USB drive, but that doesn't seem to work with LVM. How can a LVM partition be copied in a similar manner? I'm used a rescue CD to do all the copying.
I think... add the usb drive to your lvm, use pvmove to relocate the previous data to the usb portion, then reduce the lvm to the usb portion, which then should exist by itself.
then reverse, add the new drive to the usb lvm and pvmove to the new drive, reduce, remove.....
Oh, what a convoluted web we weave :^)
tnx I'll have to look into that. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
James Knott said the following on 02/28/2010 03:00 PM:
I'm in the process of replacing a notebook computer hard drive with a larger one. I can use dd to copy non-LVM partitions to a file on a USB drive, but that doesn't seem to work with LVM.
That doesn't make sense on a number of counts. First, I've jsut done dd if=/dev/vgmail/HOME of=/dev/null 3096576+0 records in 3096576+0 records out 1585446912 bytes (1.6 GB) copied, 69.2074 s, 22.9 MB/s So: dd works. Secondly, copying the paritions as paritions doesn't make a lot of sense for a number of reasons. If this an LVM why not just use the LVM tools to create a LVM on the USB drive and then "pvmove" the contents of the WHOLE LVM in one go. (Or any number of other permutations using the lvm tools) If you don't like working exclusively with LVM why not use one of CPIO, RSYNC or ever CP Finally - why are you doing this? I can think of a number of things, but you said ="replacing"=. Might I speculate that the current drive is either dying or that you want a bigger drive? After all, large capacity 2.5" drive are getting cheaper. But in that case, why DD "to a file" ? What is the overall objective here? If we knew, we might be able to come up with a more effective strategy than just answering your question about DD. -- Never tell people how to do things. Tell them what to do and they will surprise you with their ingenuity. -- George S. Patton -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Anton Aylward wrote:
James Knott said the following on 02/28/2010 03:00 PM:
I'm in the process of replacing a notebook computer hard drive with a larger one. I can use dd to copy non-LVM partitions to a file on a USB drive, but that doesn't seem to work with LVM.
That doesn't make sense on a number of counts.
First, I've jsut done
dd if=/dev/vgmail/HOME of=/dev/null 3096576+0 records in 3096576+0 records out 1585446912 bytes (1.6 GB) copied, 69.2074 s, 22.9 MB/s
So: dd works.
Secondly, copying the paritions as paritions doesn't make a lot of sense for a number of reasons.
If this an LVM why not just use the LVM tools to create a LVM on the USB drive and then "pvmove" the contents of the WHOLE LVM in one go.
(Or any number of other permutations using the lvm tools)
If you don't like working exclusively with LVM why not use one of CPIO, RSYNC or ever CP
Finally - why are you doing this? I can think of a number of things, but you said ="replacing"=. Might I speculate that the current drive is either dying or that you want a bigger drive? After all, large capacity 2.5" drive are getting cheaper. But in that case, why DD "to a file" ?
What is the overall objective here?
If we knew, we might be able to come up with a more effective strategy than just answering your question about DD.
As I mentioned in my first note, I'm putting in a larger drive. My original plan was to put the old drive in an external USB case, the new drive in the computer and then just copy stuff over. However, I then remembered that USB drives don't support multiple partitions. Since this is a notebook computer, it is not possible to have both drives connected at the same time using the IDE connections. This means I have to copy the partitions to files on the USB drive and then restore them to the new drive. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 2010/02/28 17:29 (GMT-0500) James Knott composed:
USB drives don't support multiple partitions.
Where did this misconception come from? -- "Our Constitution was made only for a moral and religious people. It is wholly inadequate to the government of any other." John Adams, 2nd US President Team OS/2 ** Reg. Linux User #211409 Felix Miata *** http://fm.no-ip.com/ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Felix Miata wrote:
On 2010/02/28 17:29 (GMT-0500) James Knott composed:
USB drives don't support multiple partitions.
Where did this misconception come from?
I had read that a while ago and also when I put the old drive into a USB case, none of the partitions were visible. When I put that drive back into the computer, everything is again available. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 2010/02/28 17:50 (GMT-0500) James Knott composed:
Felix Miata wrote:
On 2010/02/28 17:29 (GMT-0500) James Knott composed:
USB drives don't support multiple partitions.
Where did this misconception come from?
I had read that a while ago and also when I put the old drive into a USB case, none of the partitions were visible. When I put that drive back into the computer, everything is again available.
Some USB cases can be pretty stupid. Mine isn't. All of as many as 60+ partitions get found. The stupidity is often an inability to use the actual CHS emulation with which the HD was actually configured. Some are hard-coded to use * 255 63, others * 240 63, and the best do whatever it takes. Most desktop HDs use * 255 63, while most laptop HDs use * 240 63. Sounds like maybe you're trying to use a * 240 63 configured HD in a * 255 63 only case. Maybe your laptop has to flexibility to use * 255 63. Pending availability of a smarter case, try first putting the new HD into the external to make the copy, and see if the copy when transferred into the laptop will work. -- "Our Constitution was made only for a moral and religious people. It is wholly inadequate to the government of any other." John Adams, 2nd US President Team OS/2 ** Reg. Linux User #211409 Felix Miata *** http://fm.no-ip.com/ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
James Knott said the following on 02/28/2010 05:50 PM:
Felix Miata wrote:
On 2010/02/28 17:29 (GMT-0500) James Knott composed:
USB drives don't support multiple partitions.
Where did this misconception come from?
I had read that a while ago and also when I put the old drive into a USB case, none of the partitions were visible. When I put that drive back into the computer, everything is again available.
WHAT computer? This sounds like Windows. That ... thing... has a flag that marked 'removable' drives as not being partitionable. Of course that can be over-ridden. But this is Linux. -- In cyberspace no-one can hear you scream - BUT EVERYONE CAN SEE YOU SHOUT. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Anton Aylward wrote:
James Knott said the following on 02/28/2010 05:50 PM:
Felix Miata wrote:
On 2010/02/28 17:29 (GMT-0500) James Knott composed:
USB drives don't support multiple partitions.
Where did this misconception come from?
I had read that a while ago and also when I put the old drive into a USB case, none of the partitions were visible. When I put that drive back into the computer, everything is again available.
WHAT computer?
This sounds like Windows. That ... thing... has a flag that marked 'removable' drives as not being partitionable.
Of course that can be over-ridden.
But this is Linux.
I found the problem. I'm using a PCMCIA-USB2 adapter. When I use that, I cannot see mulitple partitions. However, if I plug into the computer's USB ports I can work with multiple partitions. However, since those ports are USB1, copying the files over will be very *SLOW*!!! Now, to duplicate the disk, I have to copy over an NTFS partition, which should be easy enough, along with the ext2 partition that contains /boot. However, the rest of the Linux system is on LVM, so I'll have to see if that pvmove works. I guess after all that stuff is copied over, the next step will be getting grub working again. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
James Knott wrote:
Now, to duplicate the disk, I have to copy over an NTFS partition, which should be easy enough, along with the ext2 partition that contains /boot. However, the rest of the Linux system is on LVM, so I'll have to see if that pvmove works. I guess after all that stuff is copied over, the next step will be getting grub working again.
If you're trying to duplicate the disk, why are you copying partitions? Just use dd to copy the entire disk. Cheers, Dave PS Personally, I wouldn't use pvmove for this purpose. Since it is a move rather than a copy it leaves you more vulnerable. If you do need to look inside partitions etc then I'd copy the contents of the filesystems inside the LVM. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Dave Howorth said the following on 03/01/2010 05:34 AM:
PS Personally, I wouldn't use pvmove for this purpose. Since it is a move rather than a copy it leaves you more vulnerable. If you do need to look inside partitions etc then I'd copy the contents of the filesystems inside the LVM.
Which was my point about using CPIO, RSYNC or CP Along the way you'd get a clean new, well organized __file system__ that has been compacted and optimized. It might even give you a chance to convert to ext4! -- As far as I know, we have never had an undetected error. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Dave Howorth wrote:
James Knott wrote:
Now, to duplicate the disk, I have to copy over an NTFS partition, which should be easy enough, along with the ext2 partition that contains /boot. However, the rest of the Linux system is on LVM, so I'll have to see if that pvmove works. I guess after all that stuff is copied over, the next step will be getting grub working again.
If you're trying to duplicate the disk, why are you copying partitions? Just use dd to copy the entire disk.
Cheers, Dave
PS Personally, I wouldn't use pvmove for this purpose. Since it is a move rather than a copy it leaves you more vulnerable. If you do need to look inside partitions etc then I'd copy the contents of the filesystems inside the LVM.
I also plan to increase the size of the NTFS partition. If I copy over the entire drive, then there won't be any room to expand it. Or am I missing something here? So far, I can create a larger NTFS partition, but only the original amount of space is usable when I use dd to copy from the saved file. Parted doesn't seem to want to work with NTFS. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
James Knott wrote:
I also plan to increase the size of the NTFS partition. If I copy over the entire drive, then there won't be any room to expand it. Or am I missing something here?
Ah, so you don't want to duplicate the disk :) What I said in my PS then, as amplified by Anton.
So far, I can create a larger NTFS partition, but only the original amount of space is usable when I use dd to copy from the saved file. Parted doesn't seem to want to work with NTFS.
If you use dd to copy into the partition then you copy the original filesystem. You'd need an ntfsextend or ntfs-resize program and I've no idea whether it exists. The technique I do know is to create the new larger partition then copy the files across from the original partion - cp, rsync etc etc Cheers, Dave -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 2010/03/01 13:39 (GMT) Dave Howorth composed:
....You'd need an ntfsextend or ntfs-resize program and I've no idea whether it exists.
The (non-free; text mode) multi-platform partitioner I use for virtually everything partition-related can resize NTFS, as well as clone, copy, realign and much more. http://www.dfsee.com/ -- "Our Constitution was made only for a moral and religious people. It is wholly inadequate to the government of any other." John Adams, 2nd US President Team OS/2 ** Reg. Linux User #211409 Felix Miata *** http://fm.no-ip.com/ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
James Knott said the following on 03/01/2010 08:23 AM:
I also plan to increase the size of the NTFS partition. If I copy over the entire drive, then there won't be any room to expand it. Or am I missing something here?
So far, I can create a larger NTFS partition, but only the original amount of space is usable when I use dd to copy from the saved file.
DUH! Of course. You're copying the partition IMAGE. I told you you should use CPIO, RSYNC or CP. Copy the files, not the partition image!
Parted doesn't seem to want to work with NTFS.
What do you mean by "doesn't seem to work"? -- The truth of a proposition has nothing to do with its credibility. And vice versa. Excerpt from the notebooks of Lazarus Long, from Robert Heinlein's "Time Enough for Love" -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Anton Aylward wrote:
James Knott said the following on 03/01/2010 08:23 AM:
I also plan to increase the size of the NTFS partition. If I copy over the entire drive, then there won't be any room to expand it. Or am I missing something here?
So far, I can create a larger NTFS partition, but only the original amount of space is usable when I use dd to copy from the saved file.
DUH! Of course. You're copying the partition IMAGE.
I told you you should use CPIO, RSYNC or CP.
Copy the files, not the partition image!
That's what I plan to do, now that I can have multiple partitions via USB
Parted doesn't seem to want to work with NTFS.
What do you mean by "doesn't seem to work"?
Just that. It won't resize NTFS. However, I may have a copy of Drive Image around here somewhere. If all else fails, I guess I can resort to it. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
James Knott said the following on 03/01/2010 09:46 AM:
Parted doesn't seem to want to work with NTFS.
What do you mean by "doesn't seem to work"?
Just that. It won't resize NTFS.
Given what you've written in the past I can interpret that at least ways. Do you mean it won't resize the PHYSICAL partition? or Do you mean it will resize the physical partition but not expand the contents of the existing file system to the size of the partition, whit no further action or Do you mean the result of the re-sizing and the copy out by DD and the copy back with DD end up with the same size file system? I thought we had settled that last case. And do you mean gparted http://opensuse.ca.unixheads.org/repositories/openSUSE:/Factory:/Contrib/ope... -- The only time you have too much fuel is when you're on fire. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
James Knott wrote:
However, I may have a copy of Drive Image around here somewhere. If all else fails, I guess I can resort to it.
Correction, it's Partition Magic. I found it and will be able to resize the NTFS partition with it. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
James Knott said the following on 03/01/2010 11:58 AM:
James Knott wrote:
However, I may have a copy of Drive Image around here somewhere. If all else fails, I guess I can resort to it.
Correction, it's Partition Magic. I found it and will be able to resize the NTFS partition with it.
This morning, as an experiment, I have successfully resized NTFS partitions on a) a USB stick b) a USB micrdrive c) a falsh card d) the Windwos partition my laptop came with that I shrunk down in order to install Linux using gparted What's your problem? -- The universe we observe has precisely the properties we should expect if there is, at bottom, no design, no purpose, no evil and no good, nothing but blind pitiless indifference. -- Richard Dawkins, River Out of Eden: A Darwinian View of Life (1995), quoted from Victor J. Stenger, Has Science Found God? (2001) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Anton Aylward wrote:
James Knott said the following on 03/01/2010 11:58 AM:
James Knott wrote:
However, I may have a copy of Drive Image around here somewhere. If all else fails, I guess I can resort to it.
Correction, it's Partition Magic. I found it and will be able to resize the NTFS partition with it.
This morning, as an experiment, I have successfully resized NTFS partitions on
a) a USB stick b) a USB micrdrive c) a falsh card d) the Windwos partition my laptop came with that I shrunk down in order to install Linux
using gparted
What's your problem?
I tried with the parted included with the System Rescue CD and it didn't want to work with NTFS. The parted in OpenSUSE will work with it, but it sees the full size of the partition I created, not the size of the actual usable area, as copied from the old disk. The Yast Partitioner also sees the full partition size, not actual size. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
James Knott said the following on 03/01/2010 04:32 PM:
using gparted
What's your problem?
I tried with the parted included with the System Rescue CD and it didn't want to work with NTFS. The parted in OpenSUSE will work with it, but it sees the full size of the partition I created, not the size of the actual usable area, as copied from the old disk. The Yast Partitioner also sees the full partition size, not actual size.
Yes. That's right. These are PARTITION Editors. Of course they see the full size of the partition. I you want to shrink a partition with a file system on it you need to shrink the file system first. Do those tools do that? Possibly not. When I resize a LVM "partition" I use resize2fs or resize_reiserfs. Before lvreduce or after lvextend. No doubt there is a similar tool for NTFS. Not knowing much about Windows I can't help you there. Other here will :-) I suspect you'll want to defragment the NTFS first. Not that you need to do that first with the Linux file systems :-) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
I've now got all the partitions copied to the new drive, with some enlarged. The next problem is getting Linux bootable (Windows already is). I understand that grub has to be reconfigured, but I'm not sure how. /boot is in it's own partition, but everything else for Linux is in the LVM. So, what's next? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 2010/03/03 08:26 (GMT-0500) James Knott composed:
I've now got all the partitions copied to the new drive, with some enlarged. The next problem is getting Linux bootable (Windows already is). I understand that grub has to be reconfigured, but I'm not sure how. /boot is in it's own partition, but everything else for Linux is in the LVM. So, what's next?
There are several options for making Linux bootable here. One way: rescue boot Linux, mount your doz boot partition (below assumes it's mounted on /disks/C), and assuming your /boot is on /dev/sda3 and you don't have one of those 4096 byte sectors HDs, do: dd if=/dev/sda3 of=/disks/C/grubboot bs=512 count=1 Adjust to your actual mountpoints/devicenames/sectorsizes. Then add a stanza to boot.ini for booting Grub. See: http://fm.no-ip.com/install-doz-after.html If your new /boot doesn't start on the same sector number as it did on the old disk (and maybe even if it does, depending on how you performed the clone of your old /boot), you'll need to reinstall Grub from that rescue boot. I usually do it manually: login: root passwd: # grub
root (hd0,2) setup (hd0,2) quit #
The result of all the above is Windows' ntldr is your primary boot manager, from which you may choose Windows or Grub, and Grub loads Linux, all using standard MBR code, a configuration that won't scramble Linux when you reinstall Windows. -- "Our Constitution was made only for a moral and religious people. It is wholly inadequate to the government of any other." John Adams, 2nd US President Team OS/2 ** Reg. Linux User #211409 Felix Miata *** http://fm.no-ip.com/ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Felix Miata wrote:
On 2010/03/03 08:26 (GMT-0500) James Knott composed:
I've now got all the partitions copied to the new drive, with some enlarged. The next problem is getting Linux bootable (Windows already is). I understand that grub has to be reconfigured, but I'm not sure how. /boot is in it's own partition, but everything else for Linux is in the LVM. So, what's next?
There are several options for making Linux bootable here. One way: rescue boot Linux, mount your doz boot partition (below assumes it's mounted on /disks/C), and assuming your /boot is on /dev/sda3 and you don't have one of those 4096 byte sectors HDs, do:
dd if=/dev/sda3 of=/disks/C/grubboot bs=512 count=1
Adjust to your actual mountpoints/devicenames/sectorsizes. Then add a stanza to boot.ini for booting Grub. See: http://fm.no-ip.com/install-doz-after.html
If your new /boot doesn't start on the same sector number as it did on the old disk (and maybe even if it does, depending on how you performed the clone of your old /boot), you'll need to reinstall Grub from that rescue boot. I usually do it manually:
login: root passwd: # grub
root (hd0,2) setup (hd0,2) quit
#
The result of all the above is Windows' ntldr is your primary boot manager, from which you may choose Windows or Grub, and Grub loads Linux, all using standard MBR code, a configuration that won't scramble Linux when you reinstall Windows.
Why would I want to boot into Windows first? Linux is my primary OS on this computer. I alway boot straight into grub and choose the OS (default Linux) from there. If I just follow the 2nd part will grub be functional again? I used dd to copy the /boot partition to a file and then back onto the same partition number. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 2010/03/03 09:53 (GMT-0500) James Knott composed:
Felix Miata wrote:
The result of all the above is Windows' ntldr is your primary boot manager, from which you may choose Windows or Grub, and Grub loads Linux, all using standard MBR code, a configuration that won't scramble Linux when you a configuration that won't scramble Linux when you reinstall Windows. reinstall Windows.
Why would I want to boot into Windows first?
That was the last clause of my reply to you. It was just offering _an_option_ ("one way").
Linux is my primary OS on this computer. I alway boot straight into grub and choose the OS (default Linux) from there.
Just as with Grub, in Windows' boot loader config file (boot.ini), you can specify a default selection and short timeout.
If I just follow the 2nd part will grub be functional again?
If by "functional" you mean as primary bootloader, and /boot is a primary and set active, then yes. Otherwise, you'll need Grub on the MBR, which Windows will overwrite when you reinstall it.
I used dd to copy the /boot partition to a file and then back onto the same partition number.
But does it start on the same sector number (did your resizing result in that it now starts on some other sector than it did on the old HD?)? If it's on the same sector, and a primary set active, then Grub reinstallation might not be necessary. -- "Our Constitution was made only for a moral and religious people. It is wholly inadequate to the government of any other." John Adams, 2nd US President Team OS/2 ** Reg. Linux User #211409 Felix Miata *** http://fm.no-ip.com/ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Felix Miata wrote:
On 2010/03/03 09:53 (GMT-0500) James Knott composed:
Felix Miata wrote:
The result of all the above is Windows' ntldr is your primary boot manager, from which you may choose Windows or Grub, and Grub loads Linux, all using standard MBR code, a configuration that won't scramble Linux when you
a configuration that won't scramble Linux when you
reinstall Windows.
reinstall Windows.
Why would I want to boot into Windows first?
That was the last clause of my reply to you. It was just offering _an_option_ ("one way").
Linux is my primary OS on this computer. I alway boot straight into grub and choose the OS (default Linux) from there.
Just as with Grub, in Windows' boot loader config file (boot.ini), you can specify a default selection and short timeout.
If I just follow the 2nd part will grub be functional again?
If by "functional" you mean as primary bootloader, and /boot is a primary and set active, then yes. Otherwise, you'll need Grub on the MBR, which Windows will overwrite when you reinstall it.
I used dd to copy the /boot partition to a file and then back onto the same partition number.
But does it start on the same sector number (did your resizing result in that it now starts on some other sector than it did on the old HD?)? If it's on the same sector, and a primary set active, then Grub reinstallation might not be necessary.
As I mentioned earlier, this is a larger drive to replace the original, so you can be sure the sector numbers are different. The first partition, containing XP is now the size of the original drive. The 2nd partition is also much larger. So, what I have is a system copied from the old drive, with some partitions resized and now I have to get grub functioning again. While I realize it's a simple matter to reinstall Linux (I've protected all my data), I'd hoped to be able to simply move from a small drive to a larger one. The sticking point is getting grub going again. BTW, I went from a 40 GB drive to 250 GB. I have not made any changes to the original drive. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 2010/03/03 10:59 (GMT-0500) James Knott composed:
As I mentioned earlier, this is a larger drive to replace the original, so you can be sure the sector numbers are different.
Until your next sentence below, that was not a foregone conclusion. You night have elected to keep Windows' C: the same size as before. You still AFAICR have never told us which device you mount to /boot.
The first partition, containing XP is now the size of the original drive. The 2nd partition is also much larger.
So, what I have is a system copied from the old drive, with some partitions resized and now I have to get grub functioning again. While I realize it's a simple matter to reinstall Linux (I've protected all my data), I'd hoped to be able to simply move from a small drive to a larger one. The sticking point is getting grub going again.
BTW, I went from a 40 GB drive to 250 GB. I have not made any changes to the original drive.
Grub needs to be installed on the new HD. More detailed instructions cannot be made available until you provide annotated output of fdisk -l, or /etc/fstab. -- "Our Constitution was made only for a moral and religious people. It is wholly inadequate to the government of any other." John Adams, 2nd US President Team OS/2 ** Reg. Linux User #211409 Felix Miata *** http://fm.no-ip.com/ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Felix Miata wrote:
On 2010/03/03 10:59 (GMT-0500) James Knott composed:
As I mentioned earlier, this is a larger drive to replace the original, so you can be sure the sector numbers are different.
Until your next sentence below, that was not a foregone conclusion. You night have elected to keep Windows' C: the same size as before. You still AFAICR have never told us which device you mount to /boot.
The Windows partition (sda1) was expanded because the old one was just about full. There's also another partion (sda2, formerly FAT32 now EXT3, that's used to exchange data between Windows & Linux. It was expanded from 2 GB to 60. /boot is on sda5. The extended partition is sda3 and LVM is sda6. Sda4 was the XP recovery partition on the old drive, but doesn't seem to have appeared on the new one. I suspect this may be due to the large size, as some partitioning utilities don't appear to work with more than 128 GB. It's not an issue as I have the recovery CDs from IBM. Here's what fdisk shows for the old drive. Device Boot Start End Blocks Id System /dev/sda1 * 1 1087 8723295 7 HPFS/NTFS c: /dev/sda2 1087 1349 2104484 c W95 FAT32 (LBA) d: /dev/sda3 1349 4741 27251909+ f W95 Ext'd (LBA) (extended) /dev/sda4 4741 4864 982800 1c Hidden W95 FAT32 (LBA) restore Partition 4 does not end on cylinder boundary. /dev/sda5 1349 1353 40131 83 Linux /boot /dev/sda6 1354 4740 27206046 8e Linux LVM LVM Disk /dev/sda: 250.0 GB, 250059350016 bytes 255 heads, 63 sectors/track, 30401 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x040f040f Disk /dev/sda: 250.0 GB, 250059350016 bytes 255 heads, 63 sectors/track, 30401 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x040f040f Device Boot Start End Blocks Id System /dev/sda1 * 1 5165 41487831 7 HPFS/NTFS /dev/sda2 5166 12461 58605120 83 Linux /dev/sda3 12462 30401 144103050 5 Extended /dev/sda5 12462 12467 48163+ 83 Linux /dev/sda6 12468 15861 27262273+ 83 Linux Disk /dev/dm-0: 10.7 GB, 10737418240 bytes 255 heads, 63 sectors/track, 1305 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x00000000 Disk /dev/dm-1: 104 MB, 104857600 bytes 255 heads, 63 sectors/track, 12 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x00000000 Disk /dev/dm-2: 3221 MB, 3221225472 bytes 255 heads, 63 sectors/track, 391 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x00000000 Disk /dev/dm-3: 419 MB, 419430400 bytes 255 heads, 63 sectors/track, 50 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x00000000 Disk /dev/dm-4: 1073 MB, 1073741824 bytes 255 heads, 63 sectors/track, 130 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x00000000 Disk /dev/dm-5: 524 MB, 524288000 bytes 255 heads, 63 sectors/track, 63 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x00000000 Disk /dev/dm-6: 4294 MB, 4294967296 bytes 255 heads, 63 sectors/track, 522 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x00000000 Disk /dev/dm-7: 1073 MB, 1073741824 bytes 255 heads, 63 sectors/track, 130 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x00000000 Disk /dev/sdb: 500 MB, 500563968 bytes 16 heads, 32 sectors/track, 1909 cylinders Units = cylinders of 512 * 512 = 262144 bytes Disk identifier: 0x45b2cb1a Device Boot Start End Blocks Id System /dev/sdb1 * 1 1910 488816 b W95 FAT32 Currently, this disk boots to XP, but I want it to boot to grub.
The first partition, containing XP is now the size of the original drive. The 2nd partition is also much larger.
So, what I have is a system copied from the old drive, with some partitions resized and now I have to get grub functioning again. While I realize it's a simple matter to reinstall Linux (I've protected all my data), I'd hoped to be able to simply move from a small drive to a larger one. The sticking point is getting grub going again.
BTW, I went from a 40 GB drive to 250 GB. I have not made any changes to the original drive.
Grub needs to be installed on the new HD. More detailed instructions cannot be made available until you provide annotated output of fdisk -l, or /etc/fstab.
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 2010/03/03 11:35 (GMT-0500) James Knott composed:
The Windows partition (sda1) was expanded because the old one was just about full. There's also another partion (sda2, formerly FAT32 now EXT3, that's used to exchange data between Windows & Linux. It was expanded from 2 GB to 60. /boot is on sda5. The extended partition is sda3 and LVM is sda6. Sda4 was the XP recovery partition on the old drive, but doesn't seem to have appeared on the new one. I suspect this may be due to the large size, as some partitioning utilities don't appear to work with more than 128 GB. It's not an issue as I have the recovery CDs from IBM.
Here's what fdisk shows for the old drive.
Device Boot Start End Blocks Id System /dev/sda1 * 1 1087 8723295 7 HPFS/NTFS c: /dev/sda2 1087 1349 2104484 c W95 FAT32 (LBA) d: /dev/sda3 1349 4741 27251909+ f W95 Ext'd (LBA) (extended) /dev/sda4 4741 4864 982800 1c Hidden W95 FAT32 (LBA) restore Partition 4 does not end on cylinder boundary. /dev/sda5 1349 1353 40131 83 Linux /boot /dev/sda6 1354 4740 27206046 8e Linux LVM LVM
Device Boot Start End Blocks Id System /dev/sda1 * 1 5165 41487831 7 HPFS/NTFS /dev/sda2 5166 12461 58605120 83 Linux /dev/sda3 12462 30401 144103050 5 Extended /dev/sda5 12462 12467 48163+ 83 Linux /dev/sda6 12468 15861 27262273+ 83 Linux
Device Boot Start End Blocks Id System /dev/sdb1 * 1 1910 488816 b W95 FAT32
Option 1: follow instructions in my Wed, 03 Mar 2010 09:05:28 -0500 thread post for making Windows the primary boot loader, except substitute /dev/sda5 for /dev/sda3. Option 2: install Grub to /dev/sda3 (extended) (I never do this myself, so pass on offering instructions) Option 3: install Grub to MBR (/dev/sda) (I never do this myself, so pass on offering instructions) Option 4: a) delete new sda5 b) create new sda4 in its place c) mkfs sda4 d) cp -a, rsync, or etc. the old sda5 to new sda4 e) install Grub to sda4 f) set sda4 active/bootable g) adjust /etc/fstab for relocated /boot Option 5: a) shrink sda2 by 1 cyl at end or sda5 by 1 cyl at start b) install IBM Boot Manager to sda4 c) set sda4 active/bootable Option 6&: install some other boot manager to sda4, sdb, or sda boot track -- "Our Constitution was made only for a moral and religious people. It is wholly inadequate to the government of any other." John Adams, 2nd US President Team OS/2 ** Reg. Linux User #211409 Felix Miata *** http://fm.no-ip.com/ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 2010/03/03 12:24 (GMT-0500) Felix Miata composed:
On 2010/03/03 11:35 (GMT-0500) James Knott composed:
The Windows partition (sda1) was expanded because the old one was just about full. There's also another partion (sda2, formerly FAT32 now EXT3, that's used to exchange data between Windows & Linux. It was expanded from 2 GB to 60. /boot is on sda5. The extended partition is sda3 and LVM is sda6. Sda4 was the XP recovery partition on the old drive, but doesn't seem to have appeared on the new one. I suspect this may be due to the large size, as some partitioning utilities don't appear to work with more than 128 GB. It's not an issue as I have the recovery CDs from IBM.
Here's what fdisk shows for the old drive.
Device Boot Start End Blocks Id System /dev/sda1 * 1 1087 8723295 7 HPFS/NTFS c: /dev/sda2 1087 1349 2104484 c W95 FAT32 (LBA) d: /dev/sda3 1349 4741 27251909+ f W95 Ext'd (LBA) (extended) /dev/sda4 4741 4864 982800 1c Hidden W95 FAT32 (LBA) restore Partition 4 does not end on cylinder boundary. /dev/sda5 1349 1353 40131 83 Linux /boot /dev/sda6 1354 4740 27206046 8e Linux LVM LVM
Device Boot Start End Blocks Id System /dev/sda1 * 1 5165 41487831 7 HPFS/NTFS /dev/sda2 5166 12461 58605120 83 Linux /dev/sda3 12462 30401 144103050 5 Extended /dev/sda5 12462 12467 48163+ 83 Linux /dev/sda6 12468 15861 27262273+ 83 Linux
Device Boot Start End Blocks Id System /dev/sdb1 * 1 1910 488816 b W95 FAT32
Option 1: follow instructions in my Wed, 03 Mar 2010 09:05:28 -0500 thread post for making Windows the primary boot loader, except substitute /dev/sda5 for /dev/sda3.
Option 2: install Grub to /dev/sda3 (extended) (I never do this myself, so pass on offering instructions)
Option 3: install Grub to MBR (/dev/sda) (I never do this myself, so pass on offering instructions)
Option 4: a) delete new sda5 b) create new sda4 in its place c) mkfs sda4 d) cp -a, rsync, or etc. the old sda5 to new sda4 e) install Grub to sda4 f) set sda4 active/bootable g) adjust /etc/fstab for relocated /boot
Option 5: a) shrink sda2 by 1 cyl at end or sda5 by 1 cyl at start b) install IBM Boot Manager to sda4 c) set sda4 active/bootable
Option 6&: install some other boot manager to sda4, sdb, or sda boot track
Missed option 0 (thinking sda2 was still FAT32 as on old HD): a) install Grub to sda2 b) set sda2 active/bootable -- "Our Constitution was made only for a moral and religious people. It is wholly inadequate to the government of any other." John Adams, 2nd US President Team OS/2 ** Reg. Linux User #211409 Felix Miata *** http://fm.no-ip.com/ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Felix Miata wrote:
Missed option 0 (thinking sda2 was still FAT32 as on old HD): a) install Grub to sda2 b) set sda2 active/bootable
sda2 is the Windows "My Documents" folder. Again, what's wrong with sda5? It's worked well for years. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 2010/03/03 12:47 (GMT-0500) James Knott composed:
Felix Miata wrote:
Missed option 0 (thinking sda2 was still FAT32 as on old HD): a) install Grub to sda2 b) set sda2 active/bootable
sda2 is the Windows "My Documents" folder.
Your new HD fdisk -l output says sda2 is Linux native, not something commonly used by those booting Windows.
Again, what's wrong with sda5? It's worked well for years.
Nobody can go straight to sda5 with standard MBR code. To get there requires a step/chain from sda[1-4] (using standard MBR code), or a specialized boot manager, or alien MBR code. You obviously were using alien (Grub) MBR code, the default for most Linux installations regardless whether actually needed or whether Windows is also installed. What's your sdb1 used for? -- "Our Constitution was made only for a moral and religious people. It is wholly inadequate to the government of any other." John Adams, 2nd US President Team OS/2 ** Reg. Linux User #211409 Felix Miata *** http://fm.no-ip.com/ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Felix Miata wrote:
On 2010/03/03 12:47 (GMT-0500) James Knott composed:
Felix Miata wrote:
Missed option 0 (thinking sda2 was still FAT32 as on old HD): a) install Grub to sda2 b) set sda2 active/bootable
sda2 is the Windows "My Documents" folder.
Your new HD fdisk -l output says sda2 is Linux native, not something commonly used by those booting Windows.
Again, what's wrong with sda5? It's worked well for years.
Nobody can go straight to sda5 with standard MBR code. To get there requires a step/chain from sda[1-4] (using standard MBR code), or a specialized boot manager, or alien MBR code. You obviously were using alien (Grub) MBR code, the default for most Linux installations regardless whether actually needed or whether Windows is also installed.
What's your sdb1 used for?
Any sdb would be USB as this is a notebook computer with room for only one internal drive. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Felix Miata wrote:
Again, what's wrong with sda5? It's worked well for years.
Nobody can go straight to sda5 with standard MBR code. To get there requires a step/chain from sda[1-4] (using standard MBR code), or a specialized boot manager, or alien MBR code. You obviously were using alien (Grub) MBR code, the default for most Linux installations regardless whether actually needed or whether Windows is also installed.
What's your sdb1 used for?
Well, I've finally got it going. I installed grub on the mbr. Then, when I booted, I wound up in maintenance mode because it couldn't find the "system" LVM because fstab listed the "disk/by-ID" method, instead of just stating /dev/sda5. Since I had changed disks, the disk ID didn't match. I then fired up vi and edited the fstab to show system on /dev/sda5. I can now boot into my old system. Moving Linux on LVM & XP from one drive to another, while enlarging some partitions has been quite a learning experience. While it certainly would have been easier just to reinstall, I wouldn't have learned all this. Now to see if it's possible to expand a LVM volume or if it will be necessary to create a new one and add it to the group. Perhaps enlarging can be done from rescue mode on the install DVD. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Felix Miata wrote:
Option 1: follow instructions in my Wed, 03 Mar 2010 09:05:28 -0500 thread post for making Windows the primary boot loader, except substitute /dev/sda5 for /dev/sda3.
Option 2: install Grub to /dev/sda3 (extended) (I never do this myself, so pass on offering instructions)
Option 3: install Grub to MBR (/dev/sda) (I never do this myself, so pass on offering instructions)
Option 4: a) delete new sda5 b) create new sda4 in its place c) mkfs sda4 d) cp -a, rsync, or etc. the old sda5 to new sda4 e) install Grub to sda4 f) set sda4 active/bootable g) adjust /etc/fstab for relocated /boot
Option 5: a) shrink sda2 by 1 cyl at end or sda5 by 1 cyl at start b) install IBM Boot Manager to sda4 c) set sda4 active/bootable
Option 6&: install some other boot manager to sda4, sdb, or sda boot track
Why sda4? Since sda3 is extended, fdisk will not create sda4. What's wrong with sda5? It's not part of the LVM and worked fine before. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 2010/03/03 12:38 (GMT-0500) James Knott composed:
Why sda4? Since sda3 is extended, fdisk will not create sda4. What's wrong with sda5? It's not part of the LVM and worked fine before.
Fdisk would create sda4, but only if freespace exists adjacent to sda3. Sda5 is fine, but only if either: 1-Windows is primary boot manager (using standard MBR code); or 2-Grub is installed to sda2, sda3 or sda4 (using standard MBR code); or 3-Grub is installed to MBR (alien MBR code) -- "Our Constitution was made only for a moral and religious people. It is wholly inadequate to the government of any other." John Adams, 2nd US President Team OS/2 ** Reg. Linux User #211409 Felix Miata *** http://fm.no-ip.com/ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Mon, 1 Mar 2010 23:53:45 James Knott wrote:
Dave Howorth wrote:
James Knott wrote:
Now, to duplicate the disk, I have to copy over an NTFS partition, which should be easy enough, along with the ext2 partition that contains /boot. However, the rest of the Linux system is on LVM, so I'll have to see if that pvmove works. I guess after all that stuff is copied over, the next step will be getting grub working again.
If you're trying to duplicate the disk, why are you copying partitions? Just use dd to copy the entire disk.
Cheers, Dave
PS Personally, I wouldn't use pvmove for this purpose. Since it is a move rather than a copy it leaves you more vulnerable. If you do need to look inside partitions etc then I'd copy the contents of the filesystems inside the LVM.
I also plan to increase the size of the NTFS partition. If I copy over the entire drive, then there won't be any room to expand it. Or am I missing something here?
So far, I can create a larger NTFS partition, but only the original amount of space is usable when I use dd to copy from the saved file. Parted doesn't seem to want to work with NTFS.
That's odd - I just used Parted/gparted on the weekend to move/resize several NFTS partitions on my sister-in-law's WinXP box. Do you have ntfs-3g installed? This gives you r/w access to ntfs partitions and parted may need it (but I'm not really sure if it does or not). Try SystemRescueCD -this is a live CD based on Gentoo which has a number of system management apps installed, including gparted. I know it works because that's what I used on Sunday. -- =================================================== Rodney Baker VK5ZTV rodney.baker@iinet.net.au =================================================== -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sun, 2010-02-28 at 17:50 -0500, James Knott wrote:
Felix Miata wrote:
On 2010/02/28 17:29 (GMT-0500) James Knott composed:
USB drives don't support multiple partitions.
Where did this misconception come from?
I had read that a while ago and also when I put the old drive into a USB case, none of the partitions were visible. When I put that drive back into the computer, everything is again available.
I did that with one of my smaller drives, and I can see all of the partitions on it. Maybe it's related to the electronics in the drive case? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Mike McMullin wrote:
On Sun, 2010-02-28 at 17:50 -0500, James Knott wrote:
Felix Miata wrote:
On 2010/02/28 17:29 (GMT-0500) James Knott composed:
USB drives don't support multiple partitions.
Where did this misconception come from?
I had read that a while ago and also when I put the old drive into a USB case, none of the partitions were visible. When I put that drive back into the computer, everything is again available.
I did that with one of my smaller drives, and I can see all of the partitions on it. Maybe it's related to the electronics in the drive case?
It turned out to be the PCMCIA-USB2 adapter that caused the problem. If I plug directly into the compter's USB ports, I can use multiple partitions. However, those ports are only USB1. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
James Knott said the following on 02/28/2010 05:29 PM: I have an interest here; my laptop disk is approaching EOL and I'll be doing this change in a few months ...
What is the overall objective here?
If we knew, we might be able to come up with a more effective strategy than just answering your question about DD.
As I mentioned in my first note, I'm putting in a larger drive. My original plan was to put the old drive in an external USB case, the new drive in the computer and then just copy stuff over. However, I then remembered that USB drives don't support multiple partitions.
Eh? http://freewaretest.15.forumer.com/a/howto-gt-multiple-partition-usb-stick_p... http://www.ehow.com/how_5856009_create-multiple-partitions-usb-drive.html http://forums.techarena.in/operating-systems/1208027.htm Have you tried using tools like 'gparted'?
Since this is a notebook computer, it is not possible to have both drives connected at the same time using the IDE connections.
Ah, a 'tiny' machine. No firewire, no 'extender' port. I have both on my HP laptop.
This means I have to copy the partitions to files on the USB drive and then restore them to the new drive.
I still don't see why you can't format the USB drive as a LVM. Late breaking news: I've just used gparted to partition not only a spare usb STICK but also a USB micro-drive. So there! -- All truths are easy to understand once they are discovered; the point is to discover them. -- Galileo Galilei. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sunday, 2010-02-28 at 17:29 -0500, James Knott wrote:
computer and then just copy stuff over. However, I then remembered that USB drives don't support multiple partitions.
Of course they do. - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAkuLAmUACgkQtTMYHG2NR9VksQCgjbsJHWpTu0MNBtk9nx4l3EWE 4XUAnAmnEe+7KkD8uKo6hhdGJx4JuBzF =FAex -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (8)
-
Anton Aylward
-
Carlos E. R.
-
Dave Howorth
-
Felix Miata
-
James Knott
-
Mike McMullin
-
Patrick Shanahan
-
Rodney Baker