Re: Best way to migrate disks

2012-03-26 Thread Stan Hoeppner
On 3/25/2012 2:48 PM, Marc Auslander wrote:

 As far as the root partition itself, just make a new file system in
 the partition you want to be the new boot and use tar to copy the old
 root over.  Make sure you don't copy anything mounted on root - just
 root itself.

'cp -a' worked fine for me the last time I did such a boot/root
filesystem migration to a new disk.  What advantage does tar have here?

-- 
Stan


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4f70816a.9000...@hardwarefreak.com



Re: Best way to migrate disks

2012-03-26 Thread Andrei POPESCU
On Lu, 26 mar 12, 09:47:06, Stan Hoeppner wrote:
 On 3/25/2012 2:48 PM, Marc Auslander wrote:
 
  As far as the root partition itself, just make a new file system in
  the partition you want to be the new boot and use tar to copy the old
  root over.  Make sure you don't copy anything mounted on root - just
  root itself.
 
 'cp -a' worked fine for me the last time I did such a boot/root
 filesystem migration to a new disk.  What advantage does tar have here?

I'll add 'rsync -ax' in the mix. 'x' will take care of ignoring other 
filesystems (like /dev /sys or whatever).

Kind regards,
Andrei
-- 
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic


signature.asc
Description: Digital signature


Re: Best way to migrate disks

2012-03-26 Thread Marc Auslander
Stan Hoeppner s...@hardwarefreak.com writes:

 On 3/25/2012 2:48 PM, Marc Auslander wrote:

 As far as the root partition itself, just make a new file system in
 the partition you want to be the new boot and use tar to copy the old
 root over.  Make sure you don't copy anything mounted on root - just
 root itself.

 'cp -a' worked fine for me the last time I did such a boot/root
 filesystem migration to a new disk.  What advantage does tar have here?

 -- 
 Stan

Sorry to cause confusion.  I've always used tar for this purpose and
so my fingers know what to do.  cpio was always an alternative.

In newer versions of Unix, cp also has been extended to be useable for
this purpose.

Probably I should of just said copy the file system contents.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/87zkb3ti32@aptiva.optonline.net



Re: Best way to migrate disks

2012-03-25 Thread Olaf Reitmaier Veracierta

On 03/25/2012 01:16 AM, Marc Shapiro wrote:
I have an old 40GB disk and a recently purchased 1TB disk.  The new 
disk has been partitioned into a 2GB swap partition, two 500MB 
partitions that are currently empty and the remainder is an LVM2 PV 
which I have added to my VG, so I now have plenty of space.  So far, 
so good.


My problem is that I am still booting off of the 40GB disk and my / 
partition has pretty much run out of space (it is about 280MB).  I 
want to migrate everything from there into one of the 500MB partitions 
on the new drive and boot from there.  What is the best way to do 
this?  Any suggestions?


Marc




First, make a backup. Don't modify anything on the old disk, just in the 
new one!!!


What are the 500 MB partitions for? Well It does not matters, but I will 
use them in this example. I always do this on my laptops.


Make identical (size) volumes on LVM in the new disk as many partitions 
you have on the old disk.


Now reboot with debian live cd or usb stick and bring up LVM or... do 
all of this without reboot directly from your current system running but 
stop as many services as you can.


Then supossing your old disk is:

old disk: sda1=/boot (1GB), sda2=swap (9GB), sda3=/ (30GB)

You must configure your new disk similar to this:

new disk: sdb1=/boot (500M), sdb2=none (500M), sdb3=lvm=rest(999GB). In 
lvm at vg00 you must create: lvswap (9GB), lvroot (30GB).


Then use the command dd to copy each partition... one by one... byte 
by byte:


dd if=/dev/sda3 of=/dev/vg00/lvroot

The same with /dev/sda1 and all the none swap partions of your old disk.

Later copy the boot sector with GRUB: dd if=/dev/sda of=/dev/sdb bs=512 
count=1


You must mount and edit the /boot/grub/menu.lst and 
/boot/grub/device.maps in the NEW DISK to fit the new hardware names... 
adjust sda to sdb.


Disconnect the old disk and boot from new one installed as master on 
your mother board.


Done!

If anything fails you always can start all over again your old disk is save.

--
-
   You don't know where your shadow will fall,
Somebody.-
-
 Ing. Olaf Reitmaier Veraciertaola...@gmail.com
-
 Personal Web Page -- http://olafrv.com -- i...@olafrv.com
-


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4f6eba41.4080...@gmail.com



Re: Best way to migrate disks

2012-03-25 Thread Stan Hoeppner
On 3/25/2012 12:46 AM, Marc Shapiro wrote:
 I have an old 40GB disk and a recently purchased 1TB disk.  The new disk
 has been partitioned into a 2GB swap partition, two 500MB partitions
 that are currently empty and the remainder is an LVM2 PV which I have
 added to my VG, so I now have plenty of space.  So far, so good.
 
 My problem is that I am still booting off of the 40GB disk and my /
 partition has pretty much run out of space (it is about 280MB).  I want
 to migrate everything from there into one of the 500MB partitions on the
 new drive and boot from there.  What is the best way to do this?  Any
 suggestions?

Need more details.  Output of fdisk -l for both drives, lilo/grub conf
files, and /etc/fstab would be helpful, as well as the LVM config.

-- 
Stan


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4f6ec21f.8000...@hardwarefreak.com



Re: Best way to migrate disks

2012-03-25 Thread Camaleón
On Sat, 24 Mar 2012 22:46:21 -0700, Marc Shapiro wrote:

 I have an old 40GB disk and a recently purchased 1TB disk.  The new disk
 has been partitioned into a 2GB swap partition, two 500MB partitions
 that are currently empty and the remainder is an LVM2 PV which I have
 added to my VG, so I now have plenty of space.  So far, so good.
 
 My problem is that I am still booting off of the 40GB disk and my /
 partition has pretty much run out of space (it is about 280MB).  I want
 to migrate everything from there into one of the 500MB partitions on the
 new drive and boot from there.  What is the best way to do this?  Any
 suggestions?

I would try with Clonezilla run from a LiveCD.

Greetings,

-- 
Camaleón


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/jkmuie$q88$1...@dough.gmane.org



Re: Best way to migrate disks

2012-03-25 Thread Marc Shapiro

On 03/24/12 23:58, Stan Hoeppner wrote:

On 3/25/2012 12:46 AM, Marc Shapiro wrote:

I have an old 40GB disk and a recently purchased 1TB disk.  The new disk
has been partitioned into a 2GB swap partition, two 500MB partitions
that are currently empty and the remainder is an LVM2 PV which I have
added to my VG, so I now have plenty of space.  So far, so good.

My problem is that I am still booting off of the 40GB disk and my /
partition has pretty much run out of space (it is about 280MB).  I want
to migrate everything from there into one of the 500MB partitions on the
new drive and boot from there.  What is the best way to do this?  Any
suggestions?


Need more details.  Output of fdisk -l for both drives, lilo/grub conf
files, and /etc/fstab would be helpful, as well as the LVM config.

Sorry, I just realized this morning that I had not mentioned that I am 
using lilo, not GRUB.  (NOTE: All three lvm partitions are in a single 
volume group, so that is all taken care of.  All that I need to migrate 
is the / partition so that I can get some extra space for it.  I may 
move the swap on the new drive into the lvm.  No reason not to really, 
is there?  If I do that, however, it can wait until after I am able to 
boot from the new disk.


/boot/lilo.conf:

boot=/dev/disk/by-id/ata-WDC_WD400EB-00CPF0_WD-WCAAT1261081
large-memory
compact
lba32
vga=normal
prompt
timeout=100
default=Linux

image=/vmlinuz
root=UUID=5e0d4da4-aba3-4965-8fb4-788501b0fe69
initrd=/initrd.img
label=Linux
read-only

image=/vmlinuz.old
root=UUID=5e0d4da4-aba3-4965-8fb4-788501b0fe69
initrd=/initrd.img.old
label=Linux_Old
read-only

image=/boot/memtest86+.bin
label = memtest86+

#other=/dev/hdc1
#   label=Win98SE
#   map-drive=0x80
#   to=0x81
#   map-drive=0x81
#   to=0x80



As for the rest:
# /etc/fstab: static file system information.
#
# file system mount point   type  options   dump 
pass


UUID=5e0d4da4-aba3-4965-8fb4-788501b0fe69   /   ext3 
errors=remount-ro   0   1
UUID=babd50db-38b8-4b64-940a-6832af5bd0a9   noneswap 
sw 00
proc/proc   procdefaults 
0  0
none/proc/bus/usb   usbfs   defaults 
0  0
/dev/mapper/vg1-tmp /tmpext3defaults 
0  2
/dev/mapper/vg1-var2/varext3defaults 
0  2
/dev/mapper/vg1-usr /usrext3defaults 
0  2
/dev/mapper/vg1-photos  /usr/local/photos ext3  defaults 
0  2
/dev/mapper/vg1-home/home   ext3defaults 
0  2
/dev/mapper/vg1-vDisks  /home/testuser/VirtualBoxDisks  ext3 
defaults0   2


#
# Removeable Media
#

#/dev/lasonic   /media/mp3r vfatdefaults,user,noauto 
0  0
/dev/fd0/media/floppy   autouser,noauto 
0  0
/dev/cdrom5 /media/cdromiso9660 ro,user,noauto 
0  0
#/dev/sdb1  /media/pen  vfatuser,umask=,noauto 
0  0
#/dev/sdb1  /media/camera   vfatuser,umask=,noauto 
0  0
UUID=A8B0-984A  /media/mp3a vfatdefaults,user,noauto 
0  0
LABEL=PHILIPS   /media/mp3r vfatdefaults,user,noauto 
0  0
UUID=DA74-E37F  /media/sandisk  vfatdefaults,user,noauto 
0   0
UUID=A8B0-984A  /media/eclipse  vfatdefaults,user,noauto 
0  0
UUID=261A-40DE  /media/kingston vfatdefaults,user,noauto 
0  0
UUID=0C50-B006  /media/mp3r2vfatdefaults,user,noauto 
0  0
UUID=6A3D-C6A2  /media/pen/anna vfatdefaults,user,noauto 
0   0
obexfs#-b74:A7:22:01:5D:ED /media/phone fusedefaults,user,noauto 
0  0



Old drive:

Disk /dev/sda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xa51aa51a

   Device Boot  Start End  Blocks   Id  System
/dev/sda1   *   1  36  289138+  83  Linux
/dev/sda2  37  72  289170   83  Linux
/dev/sda3  73232318081157+  8e  Linux LVM
/dev/sda42324486520418615   8e  Linux LVM


New Drive:

Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
222 heads, 30 sectors/track, 293322 cylinders
Units = cylinders of 6660 * 512 = 3409920 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x20677b30

   Device Boot  Start End  Blocks   Id  System
/dev/sdc1   1 631 2101215   82  Linux swap / Solaris
/dev/sdc2 632 781  499500   83  Linux
/dev/sdc3 782 931  499500   83  Linux
/dev/sdc4 932  293322   

Re: Best way to migrate disks

2012-03-25 Thread Olaf Reitmaier Veracierta

On 03/25/2012 12:44 PM, Marc Shapiro wrote:
Sorry, I just realized this morning that I had not mentioned that I am 
using lilo, not GRUB. 
Well, with dd is almost the same, just copy the first sector as I've 
shown it to you:


dd if=/dev/sda of=/dev/sdb bs=512 count=1

More info:
http://members.storm.ca/%7Eyan/Hard-Disk-Upgrade.html
http://lilo.alioth.debian.org/olddoc/html/user_21-5.html

(NOTE: All three lvm partitions are in a single volume group, so that 
is all taken care of). 

You still can use dd to copy partitions between disks.

If the old partition you want to copy is on LVM you don't need to stop 
all services just make a snapshot volume then use dd.


  I may move the swap on the new drive into the lvm.  No reason not to 
really, is there? 
The only valid reason is an affirmative answer to: Are you going to 
resize your swap space in the future?


If I do that, however, it can wait until after I am able to boot from 
the new disk.

Yes, it can wait and you can be disable it if you want.

--
-
   You don't know where your shadow will fall,
Somebody.-
-
 Ing. Olaf Reitmaier Veraciertaola...@gmail.com
-
 Personal Web Page -- http://olafrv.com -- i...@olafrv.com
-


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4f6f72b7.8050...@gmail.com



Re: Best way to migrate disks

2012-03-25 Thread Marc Auslander
You are probably asking a more subtle question that I'm going to
answer but ...

As far as the root partition itself, just make a new file system in
the partition you want to be the new boot and use tar to copy the old
root over.  Make sure you don't copy anything mounted on root - just
root itself.

Then edit fstab in the obvious way to account for the new UUID of the
new root.

Assumine LILO can boot from the partition on the larger disk, fix
lilo.conf in the obvious way, run lilo, and remember to make the new
root partion bootable.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/87limowjfm@aptiva.optonline.net



Re: Best way to migrate disks (SOLVED)

2012-03-25 Thread Marc Shapiro

On 03/24/12 23:25, Olaf Reitmaier Veracierta wrote:

On 03/25/2012 01:16 AM, Marc Shapiro wrote:

I have an old 40GB disk and a recently purchased 1TB disk. The new
disk has been partitioned into a 2GB swap partition, two 500MB
partitions that are currently empty and the remainder is an LVM2 PV
which I have added to my VG, so I now have plenty of space. So far, so
good.

My problem is that I am still booting off of the 40GB disk and my /
partition has pretty much run out of space (it is about 280MB). I want
to migrate everything from there into one of the 500MB partitions on
the new drive and boot from there. What is the best way to do this?
Any suggestions?

Marc




First, make a backup. Don't modify anything on the old disk, just in the
new one!!!


Thanks to everyone who replied.  I asked here first to find a 'Debian' 
answer, but I probably should have just Googled it.  I found several 
sites advocating piping the results of find to cpio and this worked 
perfectly.  All I had to do after that was to add a new stanza to 
lilo.conf and update fstab in the new partition, then run lilo.  Works 
like a charm.


Marc


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4f6fe840.5040...@gmail.com



Best way to migrate disks

2012-03-24 Thread Marc Shapiro
I have an old 40GB disk and a recently purchased 1TB disk.  The new disk 
has been partitioned into a 2GB swap partition, two 500MB partitions 
that are currently empty and the remainder is an LVM2 PV which I have 
added to my VG, so I now have plenty of space.  So far, so good.


My problem is that I am still booting off of the 40GB disk and my / 
partition has pretty much run out of space (it is about 280MB).  I want 
to migrate everything from there into one of the 500MB partitions on the 
new drive and boot from there.  What is the best way to do this?  Any 
suggestions?


Marc


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4f6eb12d.1080...@gmail.com