Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
howto:install_sata [2016/05/10 20:01]
tomtom
howto:install_sata [2017/03/30 22:21]
ljf
Line 1: Line 1:
-**Work in progress** 
- 
 //​Disclaimer:​ what follows is true for LIME and LIME2 hardware.// //​Disclaimer:​ what follows is true for LIME and LIME2 hardware.//
  
Line 29: Line 27:
 <​code>​ <​code>​
 /​dev/​mmcblk0p1 /boot ext4       ​defaults ​       0       1 # /boot on the SD card /​dev/​mmcblk0p1 /boot ext4       ​defaults ​       0       1 # /boot on the SD card
-/dev/sda1 / ext4                defaults ​       0       1 # root filesystem ​on the SATA drive+/dev/sda1 / ext4                defaults ​       0       1 # root on SATA drive 
 +</​code>​ 
 + 
 +====== Stop services ====== 
 +You should stop this service before to proceed the copy, else there is a risk your mysql database to be corrupted. 
 +<​code>​ 
 +root@yunohost:/​media#​ service nginx stop 
 +root@yunohost:/​media#​ service mysql stop 
 +root@yunohost:/​media#​ service postfix stop 
 +root@yunohost:/​media#​ service rmilter stop 
 +root@yunohost:/​media#​ service dovecot stop
 </​code>​ </​code>​
  
 ====== Copying ====== ====== Copying ======
 +
 +Now you have to copy everything from the SD card to the disk. ([[https://​wiki.archlinux.org/​index.php/​Full_system_backup_with_rsync#​With_a_single_command|source]])
 +
 +<​code>​
 +mkdir -p /tmp/sata
 +mount /dev/sda1 /tmp/sata
 +rsync -aAXv --exclude={"/​dev/​*","/​proc/​*","/​sys/​*","/​tmp/​*","/​run/​*","/​mnt/​*","/​media/​*","/​lost+found"​} / /tmp/sata
 +</​code>​
 +
 +
 +Now, your SATA drive contains a complete copy of your system, but one important thing is missing: your kernel is in ''/​tmp/​sata/​boot'',​ but this folder should actually mount /​dev/​mmcblk0p1,​ which already contains the system you are currently running.
 +
 +<​code>​
 +cd /tmp/sata
 +mv boot boot.old
 +mkdir boot
 +mount /​dev/​mmcblk0p1 boot
 +rsync -av boot.old/ boot/
 +</​code>​
 +
 +Now, the ''/​boot''​ of the new system exists alongside the ''/''​ of the old system.
  
 ====== Rebooting ====== ====== Rebooting ======
  
-====== Cleaning ======+Now, cross your fingers and reboot your cube. Or the other way around if it's too hard to type. 
 + 
 +Can you log into your cube ? Congratulations ! It worked ! 
 + 
 +====== Cleaning ​up ====== 
 + 
 +Now, your old system is cluttering the ''/​boot''​ folder. To clean it up, you can remove everything in this folder, and reuse the ''/​boot.old''​ copy we did earlier. 
 + 
 +<​code>​ 
 +cd /boot 
 +rm -rf * # /!\ proceed carefully /!\ 
 +mv /boot.old/* . 
 +rmdir /boot.old 
 +</​code>​
  
 +Everything should be fine now !
  
 +An alternative approach: remove everything from ''/​boot'',​ then run ''​update-initramfs -u''​. This will regenerate everything necessary inside ''/​boot''​.
  • howto/install_sata.txt
  • Last modified: 2019/05/20 01:07
  • by tierce