[nSLUG] Making use of an SSD

Stephen Gregory nslug at kernelpanic.ca
Wed Oct 17 16:51:49 ADT 2012


On Wed, Oct 17, 2012 at 3:17 PM, Dop Ganger <nslug at fop.ns.ca> wrote:
> On Wed, 17 Oct 2012, Joel Maxuel wrote:
>
>> 4. mount them to a temporary point (/mnt/usr, /mnt/opt/)
>> 5. cp -a the original data to the temporary points
>
>
> A speedup for you, by using a different process for reading and writing:
>
> ( cd /usr && tar -cf - ./ ) | ( cd /mnt/usr && tar -xvf - )

try

tar -C <source_dir> -cf - | tar -C <dest_dir> -xvf -

it saves spawning two shells to run the stuff in ()

When copying files like this I always use the special bind mount for
the source directories. It protects against the case where a
filesystem is mounted within the tree you are copying. In cases like
this, you usually do not want to dive into that other filesystem.

to copy var:
mount -o bind /var /mnt/var-old
tar -C /mnt/var-old cf - | tar -C /mnt/var-new xvf -

You can copy root this way. I have done it several times. I rarely
bother with dropping to single user mode first.

# partition new ssd
mkfs.ext4 <new_partition>
mkdir /mnt/root-new  /mnt/root-old
mount -o bind / /mnt/root-new
tar --depth -C /mnt/root-new cf - | tar -C /mnt/root-new xvf -
chroot /mnt/root-new
# edit /etc/fstab to use new_partition as /
# update grub.cfg or menu.lst  on debian: update-grub
# exit chroot
umount /mnt/root-new
umount /mnt/root-old
reboot

and maybe mess around with grub once or twice to get everything
settled. (keep a live cd on hand for this)


-- 
sg


More information about the nSLUG mailing list