Replacing a Laptop Hard Disk On Linux. Khalid Baheyeldin http://2bits.com. KWLUG, September 2015



Similar documents
Creating a Cray System Management Workstation (SMW) Bootable Backup Drive

USTM16 Linux System Administration

How To Set Up Software Raid In Linux (Amd64)

BackTrack Hard Drive Installation

Linux Software Raid. Aug Mark A. Davis

How you configure Iscsi target using starwind free Nas software & configure Iscsi initiator on Oracle Linux 6.4

Navigating the Rescue Mode for Linux

Red Hat Linux Administration II Installation, Configuration, Software and Troubleshooting

Drobo How-To Guide. What You Will Need. Use a Drobo iscsi Array with a Linux Server

Setup software RAID1 array on running CentOS 6.3 using mdadm. (Multiple Device Administrator) 1. Gather information about current system.

WES 9.2 DRIVE CONFIGURATION WORKSHEET

USB 2.0 Flash Drive User Manual

Cloning Complex Linux Servers

Adaptec ASR-7805/ASR-7805Q/ASR-71605/ASR-71605Q/ASR-71605E/ASR-71685/ASR SAS/SATA RAID Controllers AFM-700 Flash Backup Unit

Linux Tools for Monitoring and Performance. Khalid Baheyeldin November 2009 KWLUG

Linux Template Creation Guide. How to build your own Linux VM templates for deployment in Cloudturk.

Installing Debian with SATA based RAID

USB Bare Metal Restore: Getting Started

Ubuntu Professional Training Course Overview (E-learning, Ubuntu LTS)

RocketRAID 2640/2642 SAS Controller Ubuntu Linux Installation Guide

Installing a Second Operating System

Encrypting Your Files. Because nobody else will And would you trust them if they did?

How to Restore a Linux Server Using Bare Metal Restore

RocketRAID 174x SATA Controller Ubuntu Linux Installation Guide

Backtrack 4 Bootable USB Thumb Drive with Full Disk Encryption

README.TXT

Installing Ubuntu LTS with full disk encryption

Do it Yourself System Administration

How To Install A Safesync On A Server

Bare Metal Backup And Restore

Planning for an Amanda Disaster Recovery System

Red Hat System Administration 1(RH124) is Designed for IT Professionals who are new to Linux.

These application notes are intended to be a guide to implement features or extend the features of the Elastix IP PBX system.

Survey of Filesystems for Embedded Linux. Presented by Gene Sally CELF

!!! How To! setup storage devices!

How To Manage Your Volume On Linux (Evms) On A Windows Box (Amd64) On A Raspberry Powerbook (Amd32) On An Ubuntu Box (Aes) On Linux

LSN 10 Linux Overview

Installation GENTOO + RAID sur VMWARE

Digital Forensics Tutorials Acquiring an Image with Kali dcfldd

On Disk Encryption with Red Hat Enterprise Linux

NI Real-Time Hypervisor for Windows

PCIe AHCI-IP Demo Instruction Rev Jul-15

Implementation of Database as a Service in a Private Cloud using EUCALYPTUS

Recovering Data from Windows Systems by Using Linux

A candidate following a programme of learning leading to this unit will be able to:

INSTALL ZENTYAL SERVER

Restoring a Suse Linux Enterprise Server 9 64 Bit on Dissimilar Hardware with CBMR for Linux 1.02

AlienVault Offline Key Activation

Recover Data Like a Forensics Expert Using an Ubuntu Live CD

LVM2 data recovery. Milan Brož LinuxAlt 2009, Brno

Linux Embedded devices with PicoDebian Martin Noha

SUSE Manager in the Public Cloud. SUSE Manager Server in the Public Cloud

Recovering Data from Windows Systems by Using Linux

Advanced SUSE Linux Enterprise Server Administration (Course 3038) Chapter 5 Manage Backup and Recovery

TELE 301 Lecture 7: Linux/Unix file

RH033 Red Hat Linux Essentials or equivalent experience with Red Hat Linux..

LBNC and IBM Corporation Document: LBNC-Install.doc Date: Path: D:\Doc\EPFL\LNBC\LBNC-Install.doc Version: V1.0

EXPLORING LINUX KERNEL: THE EASY WAY!

Capturing a Forensic Image. By Justin C. Klein Keane <jukeane@sas.upenn.edu> 12 February, 2013

GL-250: Red Hat Linux Systems Administration. Course Outline. Course Length: 5 days

Acronis Backup & Recovery 10 Server for Linux. Command Line Reference

Linux System Administration

Linux System Administration on Red Hat

Installing Sun's VirtualBox on Windows XP and setting up an Ubuntu VM

Secure Web. Hardware Sizing Guide

ENTERPRISE LINUX SYSTEM ADMINISTRATION

IT6204 Systems & Network Administration. (Optional)

Linux Disaster Recovery as a Service (with rear)

Linux Disaster Recovery best practices with rear

Oracle VM Server Recovery Guide. Version 8.2

w1r3 Network Documentation

EaseUS Partition Master

Ubuntu bit + 64 bit Server Software RAID Recovery and Troubleshooting.

TECHNICAL HOWTO. Imaging Linux systems with hardware changes. author:

Support for Storage Volumes Greater than 2TB Using Standard Operating System Functionality

Total Backup Recovery Server for Linux. User s Guide

System deployment and bare metal recovery by Clonezilla

SAP Netweaver 7.3 on Amazon Cloud

Customizing Boot Media for Linux* Direct Boot

Week Overview. Installing Linux Linux on your Desktop Virtualization Basic Linux system administration

Linux Disaster Recovery best practices with rear

Add Disk Space to a VM when a Partition is Full

Computer Forensics using Open Source Tools

A Practitioner's Guide to Linux as a Computer Forensic Platform

Btrfs and Rollback How It Works and How to Avoid Pitfalls

Implementing a Weblogic Architecture with High Availability

SSD Guru. Installation and User Guide. Software Version 1.4

Learning Objectives. Chapter 1: Networking with Microsoft Windows 2000 Server. Basic Network Concepts. Learning Objectives (continued)

Oracle Linux 7: System Administration Ed 1 NEW

Extended installation documentation

HARFORD COMMUNITY COLLEGE 401 Thomas Run Road Bel Air, MD Course Outline CIS INTRODUCTION TO UNIX

The Logical Volume Manager (LVM)

Parallels Cloud Server 6.0

ALTIRIS Deployment Solution 6.8 Preboot Automation Environment

Transcription:

Replacing a Laptop Hard Disk On Linux Khalid Baheyeldin http://2bits.com KWLUG, September 2015

About Khalid 30 years in software development and software consulting First computer: Sinclair ZX Spectrum Experience: Mainframe, UNIX Open Source: Linux, Web, PHP, MySQL, Drupal Full time open source developer, contributor and consultant

About 2bits.com, Inc. Founded in 1999 as a partnership, incorporated since 2007 Drupal since 2003 Specializes in Drupal scalability and performance Site Performance Assessment Hosting selection, provisioning, tuning and management Custom Drupal module development Extensive in depth articles and testimonials at http://2bits.com

2bits.com, Inc. Clients International clients (USA, Canada, Europe, South America, China,...) Electronic Arts (EA) Johns Hopkins University Harvard University Cornell University University of Waterloo Vodafone Harper Collins Publishers Lonely Planet The White House (sort a...)

Need Help? If your site has any of these symptoms Site slow? Suffering outages? High resource usage? Services Site Performance Assessment Hosting selection, installation, configuration, and optimization

Agenda Background Partitioning Create the Filesystem Copy the old disk to the new one Some Magic Grub2, fstab, and swap Replace the disk Reboot Hibernation

Background Laptop Hard disk died Home directory is backed up daily (rsync) Replaced it with a disk I had lying around Then smartctl said it is in ill health Hence, wanted to replace it before it died With an SSD that I had lying around... OCZ Vertex 4 256GB

Hardware Since this is a laptop, you will need a USB enclosure or a esata dock

SmartMonTools Quick Demo

Partitioning The new disk has to be partitioned A multitude of options fdisk cfdisk parted gdisk Which to use depends on disk size, other operating systems on it,...etc.

Partitioning (cont'd) Tools vary in support: MBR (Master Boot Record), the old format, since the DOS days GPT (GUID Partition Table), the new format, which can accomodate larger disks Disks larger than 2TB have to use GPT For example, my 3TB esata backup disks

Partitioning (cont'd) At a minimum Ext4 partition Swap partition (= RAM size, for hibernating) In my case (bad at math, so swap first): Disk /dev/sda: 256.1 GB, 256060514304 bytes 255 heads, 63 sectors/track, 31130 cylinders, total 500118192 sectors Units = sectors of 1 * 512 = 512 bytes Device Boot Start End Blocks Id System /dev/sda1 63 16000739 8000338+ 82 Linux swap / Solaris /dev/sda2 * 16000740 500118191 242058726 83 Linux

Create the filesystem Used ext4 Most familiar with Reliable Command: mkfs t ext4 /dev/sdb2

Mount the filesystem Create a temporary mount point mkdir /mnt/disk2 Mount it mount /dev/sdb2 /mnt/disk2

Copy old disk to new Using cpio p (pass through) Copies one directory tree to another Like o (copy out)/ i (copy in) combined, but with no intermediate archive Preserves timestamps, ownership, special files,...etc. Commands: cd / find. xdev print0 cpio pa0v /mnt/disk2

Some Magic Mount virtual filesystems mount bind /dev /mnt/disk2/dev mount bind /sys /mnt/disk2/sys mount bind /proc /mnt/disk2/proc Change Root to the new disk chroot /mnt/disk2

Grub2 Using Grub1 is different from Grub2 Grub2 is the standard in newer Ubuntu releases Create new grub2 configuration on the new disk: grub mkconfig o /boot/grub/grub.cfg Ask Grub2 to install a new MBR: grub install /dev/sdb

Change fstab Find out the parition UUIDs ls l /dev/disk/by uuid/ 2aca8caa 4ee9 477a ae1a 7cc0d1f8a6a9 >../../sda1 9f491cf9 5e8d 467f a1ec 244dead0af49 >../../sdb2 cb79050e 0bd9 49a6 8c4f a9984dafb1e7 >../../sda5 Note the line for sdb2 (our root partition) Edit /etc/fstab and change the UUID in it

Enable Swap Turn off all swap swapoff a Initialize Swap mkswap /dev/sdb1 Setting up swapspace version 1, size = 8000332 KiB no label, UUID=b4b6931b e002 4e93 ab3e 14225b676754 Edit /etc/fstab and change the UUID in it

Enable Swap Turn off all swap swapoff a Initialize Swap mkswap /dev/sdb1 Setting up swapspace version 1, size = 8000332 KiB no label, UUID=b4b6931b e002 4e93 ab3e 14225b676754 Edit /etc/fstab and change the UUID in it

Replace Disks Remove new disk from USB enclosure/dock Open laptop, and replace old disk with new disk Reboot...

Grub2 Rescue? If You Are Booted Into Grub2 Rescue, then it did not write a proper MBR. Use the following commands: grub rescue> set prefix=(hd0,1)/boot/grub grub rescue> set root=(hd0,1) grub rescue> insmod normal grub rescue> normal After reboot, login, then use the command: grub install /dev/sda

Hibernation Find the UUID for the swap partition ls l /dev/disk/by uuid Edit /etc/default/grub and find: GRUB_CMDLINE_LINUX="" Change it to: GRUB_CMDLINE_LINUX="resume=UUID=Z" Replace Z above by the UUID for swap, then run: update grub

Resources Main Article (with grub1) http://bremford.org/tips/migratediskinubuntu.html My Article (with grub2) http://baheyeldin.com/node/1398 Making Hibernate Work http://www.jasom.net/how to enable hibernation in lubuntu 14 04

Questions? Questions? Comments?