Fedora Core 20 SSD/HD Migration


Prerequisites

  1. Put the SSD/HD in your system (can be Sata or USB through a case with adaptor)
  2. Boot on the Fedora 20 and Perform a cleanup of all unneeded stuff to reduce the time spent, you don’t want to put old crap  :)
  3. IMPORTANT: Have a USB stick of at least 1 GB to put a Fedora 20 on it, in case you cannot boot …
  4. Check you have enough space on the SSD, ideally it should be less than 50% of usage.

Partitioning the HD(s)/SSD(s)

Using either fdisk on command line or gparted for a simple version, partition the disk according to the layout you want to have.

Formatting partitions

If you have a lot of small files, or the reverse a lot of huge file. It is better to perform the format on the command line to setup the size of inodes and other stuff according to the filesystem you have or you want.

Otherwise, if you don’t know just use gparted and stick to an ext4 filesystem.

Setting labels on partitions

Put at least the / mount point…

Copying content on the SSD/HD

  1. Mount the SSD/HD partitions
  2. If you use a ext2/ext3/ext4 filesystem, you can go for the simple tar method (I like it very much):
    1. tar cf – /boot | ( cd /mnt/ | tar xfp – )
    2. tar cf – /etc | (cd /mnt/ | tar xfp – )
    3. tar cf – /var | (cd /mnt/ | tar xfp – )
    4. tar cf – /root | (cd /mnt/ | tar xfp – )
    5. tar cf – /opt | (cd /mnt/ | tar xfp – )
    6. tar cf – /home | (cd /mnt | tar xfp – )
    7. tar cf – /tmp| (cd /mnt | tar xfp – )….
  3. Create empty dirs for
    1. dev
    2. mnt
    3. run
    4. sys
    5. proc
  4. Add symbolic links on / if any: it is the case on the 64 bits version

Update /etc/fstab in the target HD

Probably the new SSD(s)/HD(s) are having a new ID, you have to find it.

Personally,, I was too lazy so I used the old school way: /dev/sd[a-z][1-9]+.

Then modify the fstab on the new SSD/HD accordingly.

Setup boot loader (grub2)

  1. As root run the following commands
  2. grub2-install –recheck /dev/MYHARDDRIVE
  3. grub2-mkconfig -o /boot/grub2/grub.cfg
  4. sync
  5. reboot
  6. If the system does not boot use the USB key
    1. Mount partitions for instance in /mnt/sysimage/
    2. mount –bind /dev /mnt/sysimage/dev
    3. mount –bind /proc /mnt/sysimage/proc
    4. mount –bind /sys /mnt/sysimage/sys
    5. chroot /mnt/sysimage
    6. Then redo steps from 1. to 4. it should be ok :)

SSD Specific Tuning

  1. Check the SSD supports TRIM: sudo hdparm -I /dev/MYSSD | grep TRIM
  2. Ext4 changes in /etc/fstab add discard in options:
    1. Example: /dev/sdb1 /                       ext4    defaults,discard        1 1
  3. Avoid to swap too early, add this in /etc/sysctl.conf
     

    1. #SSD
      vm.swappiness = 0
  4. IO Scheduler change (create /etc/rc.d/rc.local and append this if existing, after enable the rc.local. Google this: “Fedora 20 rc.local” )
    #!/usr/bin/bash 

    #SSD Specific
    echo ‘noop’ > /sys/block/sdb/queue/scheduler
    echo ‘noop’ > /sys/block/sda/queue/scheduler

    exit 0

     

 

 

 

Comments are closed.