Rootserver Sponsor

webtropia"

Donations

Please support your operating system's further development:

donate"

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
finottiOffline
Post subject: copying old installation  PostPosted: 17.03.2014, 06:48



Joined: 2010-09-12
Posts: 493

Status: Offline
Dear all,

I've just "upgraded" my computer (new motherboard, CPU and memory, removed old graphics and sound cards).

The new motherboard (Asus Z87-Pro V-Edition) uses UEFI, while my old was a regular BIOS, so my plan to boot from my old HD did not work. (I assume that this was the problem...)

I can boot with the aptosid-2013-01 from a USB stick, so I assume I can boot from a proper install.

I should get a SSD tomorrow or the next day, and I will format it with GPT with an EFI boot partition as described in the manual. But, instead of a new install, I was hoping to copy my old one (root, not home) to the new SSD.

The plan is:

* rsync to make a exact copy;

* edit fstab to fix addresses;

* regenerate initramfs (with dpkg-reconfigure linux-image-<name>)

* hope for the best...

Should this work? Any suggestions or comments would be greatly appreciated!

By the way, I'm moving from nvidia (with nouveau) to intel, but I'm pretty sure that the proper xorg packages for intel are installed.

Thanks!

Luis
 
 View user's profile Send private message  
Reply with quote Back to top
slhOffline
Post subject: RE: copying old installation  PostPosted: 17.03.2014, 20:37



Joined: 2010-08-25
Posts: 962

Status: Offline
If you move from nouveau to intel, you shouldn't need to change or do anything (at most remove stale configuration overrides under /etc/X11/xorg.conf and /etc/X11/xorg.conf.d/*), switching from the non-free nvidia drivers would be more difficult.

These days, all mainboards should still support plain BIOS booting (but you might habe to enable a legacy BIOS CSM in your firmware menus), so your existing harddisk should even boot without problems (you will have to remove /etc/udev/rules.d/70-persistent-*, so your optical drives and network interfaces get enumerated correctly). If you move your system from HDD to SSD, you will have to install a bootsector (grub2 stage1, stage1.5) to your SSD by hand as well. Switching an installed system from BIOS booting to UEFI booting is possible (I have done it myself on several occassions), but it's generally not a procedure I'd recommend - as it involves quite a bit of experience and knowledge how the early boot procedures work together (e.g. you can only install the UEFI variant of grub, if you've already booted in UEFI mode - and breaking that vicious circle requires quite some experience).

If you want to do a new installation in UEFI mode, make sure that you already boot the live media in UEFI mode (you'll get the blue text mode grub boot menu, rather than the graphical gfxboot menu) and follow the manual for the details (partitionin requirements).
 
 View user's profile Send private message  
Reply with quote Back to top
finottiOffline
Post subject: RE: copying old installation  PostPosted: 18.03.2014, 05:08



Joined: 2010-09-12
Posts: 493

Status: Offline
Thanks, slh for the support.

Indeed, I've managed to boot from my old HD. Had to fix sound and eth0 changed to eth2 (forgot to remove /etc/udev/rules.d/70-persistent-*), but otherwise everything seems to be working well.

I am considering a fresh install on the new SSD (if I can find the time). So, to make sure I understand, when the manual says:

      Quote:

In order to create a UEFI bootable device, such as a USB stick, the contents of the aptosid ISO can be extracted to a vfat formatted partition and the partition marked as bootable.


To extract means mount (-o loop) the iso and copy (cp -a ?) the content to the vfat partition of the stick, correct?
 
 View user's profile Send private message  
Reply with quote Back to top
bfreeOffline
Post subject: Re: RE: copying old installation  PostPosted: 18.03.2014, 19:48
Team Member


Joined: 2010-08-26
Posts: 267

Status: Offline
      finotti wrote:
To extract means mount (-o loop) the iso and copy (cp -a ?) the content to the vfat partition of the stick, correct?

Correct
 
 View user's profile Send private message  
Reply with quote Back to top
finottiOffline
Post subject: Re: RE: copying old installation  PostPosted: 27.03.2014, 15:01



Joined: 2010-09-12
Posts: 493

Status: Offline
      slh wrote:
If you move from nouveau to intel, you shouldn't need to change or do anything (at most remove stale configuration overrides under /etc/X11/xorg.conf and /etc/X11/xorg.conf.d/*), switching from the non-free nvidia drivers would be more difficult.

These days, all mainboards should still support plain BIOS booting (but you might habe to enable a legacy BIOS CSM in your firmware menus), so your existing harddisk should even boot without problems (you will have to remove /etc/udev/rules.d/70-persistent-*, so your optical drives and network interfaces get enumerated correctly). If you move your system from HDD to SSD, you will have to install a bootsector (grub2 stage1, stage1.5) to your SSD by hand as well. Switching an installed system from BIOS booting to UEFI booting is possible (I have done it myself on several occassions), but it's generally not a procedure I'd recommend - as it involves quite a bit of experience and knowledge how the early boot procedures work together (e.g. you can only install the UEFI variant of grub, if you've already booted in UEFI mode - and breaking that vicious circle requires quite some experience).

If you want to do a new installation in UEFI mode, make sure that you already boot the live media in UEFI mode (you'll get the blue text mode grub boot menu, rather than the graphical gfxboot menu) and follow the manual for the details (partitionin requirements).


OK, I am having a hard time getting a USB stick boot n UEFI mode. Do I need to partition the stick with gdisk and a boot parttion (as for an ssd) or just copy the ISO contents to a single vfat parition in the stick? (I tried both, and cannot boot...)

EDIT: More details: in either case I get to a grub prompt after a few very quick grub messages fly by. (Impossible to read.) If I try "boot" at the prompt, I get "no loaded kernel".
 
 View user's profile Send private message  
Reply with quote Back to top
slhOffline
Post subject: RE: Re: RE: copying old installation  PostPosted: 27.03.2014, 22:35



Joined: 2010-08-25
Posts: 962

Status: Offline
Single FAT32 partition (GPT XOR MSDOS partition table), then just copy the files (and directories) over.
 
 View user's profile Send private message  
Reply with quote Back to top
finottiOffline
Post subject: RE: Re: RE: copying old installation  PostPosted: 28.03.2014, 03:59



Joined: 2010-09-12
Posts: 493

Status: Offline
Thanks, slh again for the support.

I hate to be a high maintenance user, but I just cannot get it to work. Here is what I've done to try to boot from the USB stick in UEFI:

* in gdisk, used option "o" to "create a new empty GUID partition table (GPT)", confirmed "y";

* option "n" to create new partition and let the defaults for start and end (to use the whole stick) and used option "0700" for "Microsoft basic data". (Also tried 8300 for "Linux filesystem".)

* formated the partition as vfat with "mkfs -t vfat /dev/sdf1";

* copied data from iso with "cp -a /path/to/iso /path/to/stick"

Tried booting and did not even get the grub prompt. So, I decided to add the boot flag with gparted. (It was msftdata before.) Retried and had the same results: no boot, no grub prompt.


BTW, I can boot with legacy bios made stick (and checked the md5sum of the iso -- it matches).

===========================================================

Since I was having a hard time booting with the stick, I decided to copy my old installation. All went fine, but I can't boot from my new SSD. Right now I can boot from my old HD...

I followed the manual to format the SSD and used EF02 (BIOS boot partition) for the first (200MB) partition, since the old HD was made for legacy BIOS.

Changed fstab and "chrooted" to the new SSD (as in the manual) and reinstalled grub with "apt-get install --reinstall grub-pc". (Which is what I assumed slh meant by "you will have to install a bootsector (grub2 stage1, stage1.5) to your SSD by hand".)

I then run "dpkg-reconfigure grub-pc" and realized it was installed in the old HD at first, so I've installed it to the SSD (in doubt, both on /dev/sdb and /dev/sdb2 -- the root partition). But I cannot boot from it. So far it is OK, as I can boot from the old HD to the new SSD, but I eventually would like to remove it.

I did get this message, though:

      Code:

root@debian[/home/finotti]# dpkg-reconfigure grub-pc
Installing for i386-pc platform.
Installation finished. No error reported.
Installing for i386-pc platform.
grub-install: warning: File system `ext2' doesn't support embedding.
grub-install: warning: Embedding is not possible.  GRUB can only be installed in this setup by using blocklists.  However, blocklists are UNRELIABLE and their use is discouraged..
Installation finished. No error reported.
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.13-5.slh.3-aptosid-amd64
[snip]


Any help would be greatly appreciated...

Best,

Luis
 
 View user's profile Send private message  
Reply with quote Back to top
slhOffline
Post subject: RE: Re: RE: copying old installation  PostPosted: 28.03.2014, 04:10



Joined: 2010-08-25
Posts: 962

Status: Offline
You need to (loop-)mount the ISO, to get to its contents, e.g.:
      Code:
# mount -o ro,loop /path/to/aptosid-*.iso /mnt/
# cp -a /mnt/* /media/wherever/your/FAT32-USB-Stick/is/mounted/
# umount /mnt/
 
 View user's profile Send private message  
Reply with quote Back to top
finottiOffline
Post subject: RE: Re: RE: copying old installation  PostPosted: 28.03.2014, 09:35



Joined: 2010-09-12
Posts: 493

Status: Offline
That's what I did... Except last time I forgot the "*" in the cp and copied the directory... (Oops...) When I've fixed it (I moved all the files AND started from scratch to be sure) I've got the grub prompt again...
 
 View user's profile Send private message  
Reply with quote Back to top
bfreeOffline
Post subject: RE: Re: RE: copying old installation  PostPosted: 28.03.2014, 13:18
Team Member


Joined: 2010-08-26
Posts: 267

Status: Offline
A little bizarre. Make sure you try all your usb ports. Can you check what $root and $prefix are set to from that grub prompt? You could also try "configfile /boot/grub/grub.cfg" and "normal".
If all else fails you could copy the contents of the iso to a big enough fat formatted EFI System Partition on your SSD and see if it will boot ok from there for you.
 
 View user's profile Send private message  
Reply with quote Back to top
finottiOffline
Post subject: RE: Re: RE: copying old installation  PostPosted: 29.03.2014, 01:11



Joined: 2010-09-12
Posts: 493

Status: Offline
Thanks for the reply, bfree.

I just tried the commands you've suggested. I did not know how to check the values of $root and $prefix, as echo did not work, but tyiping just $root, I got:

      Code:

error: unknown command -hd1'.


So, it seems it is set to hd1... $prefix gives:

      Code:

error: unknown command -(hd1)/boot/grub/x86_'.


"configfile /boot/grub/grub.cfg" gives the blue menu, but choosing the amd64 option, I get:

      Code:

error: unknown command -linux'.
error: unknown command -initrd'.


Here is some info about the stick (on /dev/sdf):

      Code:

root@debian[/home/finotti]# gdisk /dev/sdf
GPT fdisk (gdisk) version 0.8.8

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): p
Disk /dev/sdf: 7823360 sectors, 3.7 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 2D9A1ED3-6086-4622-ADA6-51B5BFAB251C
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 7823326
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048         7823326   3.7 GiB     EF00  Microsoft basic data

Command (? for help): q


root@debian[/home/finotti]# fdisk -l /dev/sdf

WARNING: GPT (GUID Partition Table) detected on '/dev/sdf'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdf: 4005 MB, 4005560320 bytes
255 heads, 63 sectors/track, 486 cylinders, total 7823360 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System                                       
/dev/sdf1               1     7823359     3911679+  ee  GPT                                           

root@debian[/home/finotti]# mount /dev/sdf1 /mnt/mnt/

root@debian[/home/finotti]# ls /mnt/mnt/                                                             
aptosid/  efi/     i18n/     autorun.inf*  efi.img*     md5sums*                                     
boot/     extras/  release/  cdrom.ico*    index.html*                                               


root@debian[/home/finotti]# md5sum tmp/aptosid-2013-01-hesperides-kde-full-i386-amd64-201305050307.iso                                                                                                     
a9bdeb73355447f047b6a763d5f7c281  tmp/aptosid-2013-01-hesperides-kde-full-i386-amd64-201305050307.iso


The UEFI recognizes the stick and gives two options: "PATRIOT" and "PATRIOT UEFI", but both yield the same result...
 
 View user's profile Send private message  
Reply with quote Back to top
bfreeOffline
Post subject: RE: Re: RE: copying old installation  PostPosted: 29.03.2014, 13:00
Team Member


Joined: 2010-08-26
Posts: 267

Status: Offline
This is all kinds of wierd, for example I really think you should see very different things between picking "PATRIOT" (should fail to do anything) and "PATRIOT UEFI" (should bring up the grub menu).

A bit of a stab in the dark, but I'm suspicious that something is still lurking in the stick from some previous attempt. Can you try blanking the stick completely (i.e. cat /dev/zero > /dev/sdX) and then partitioning again, making a new fat fs and finally copying in the contents of the iso.

If this still fails can you report what "ls ($root)/" and "ls $prefix" say and get the menu up (like with the configfile above) to also report what version of grub it says it is. Please also confirm that you tried all your usb ports.
 
 View user's profile Send private message  
Reply with quote Back to top
finottiOffline
Post subject: Re: RE: Re: RE: copying old installation  PostPosted: 29.03.2014, 17:56



Joined: 2010-09-12
Posts: 493

Status: Offline
      bfree wrote:
This is all kinds of wierd, for example I really think you should see very different things between picking "PATRIOT" (should fail to do anything) and "PATRIOT UEFI" (should bring up the grub menu).


I stand corrected. You are right, PATRIOT does not get the grub menu...

      bfree wrote:
A bit of a stab in the dark, but I'm suspicious that something is still lurking in the stick from some previous attempt. Can you try blanking the stick completely (i.e. cat /dev/zero > /dev/sdX) and then partitioning again, making a new fat fs and finally copying in the contents of the iso.

If this still fails can you report what "ls ($root)/" and "ls $prefix" say and get the menu up (like with the configfile above) to also report what version of grub it says it is. Please also confirm that you tried all your usb ports.


OK, it worked! (Besides "cat /dev/zero > /dev/sdX" I also used "rsync -a" instead of "cp -a", although the former is more likely to have been the one that made it work. But I thought I should mention anyway, in case someone else is on the same boat...)


I still have the problem of making my SSD bootable, though. Of course, a new install would do it, but by now I've already done a lot of work with the moved system... Any ideas on how to do it?

Or, is it possible to create an image of the data partition (containing / and /home) of the SSD, make a new install (to make the SSD UEFI bootable) and then copy the image on top of the new install?

I don't really mind if it is only legacy BIOS bootable, though. I am surprised that it works with the old HD, but not the new SSD.
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 12 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by Zafenio