Showing posts with label copy. Show all posts
Showing posts with label copy. Show all posts

December 15, 2017

dd clone then resize





When you dd clone a partition to a larger disk...

for example
     sudo dd if=/dev/sdb1 of=/dev/sdc1 bs=1M conv=noerror status=progress
then it will unlikely show the correct size after mounted.

Fix it with
     sudo resize2fs /dev/sdc1


ATTENTION NOOBS:
DO NOT ARBITRARILY TYPE IN THE ABOVE COMMANDS, Be sure to use the verified correct devices or potentially suffer from total data loss.

(If you already swapped disks, then for example it might be /dev/sdb1 again)


  

May 01, 2015

BASH copy preserving timestamps in Linux and OSX




The cp command annoys me sometimes in that i expect my files to retain their time-stamps.  However, such is not the default.  To set this behavior automatically, aliases may be used.

In a Linux ~/.bashrc file, include the follwing alias:
alias cp="cp --preserve=timestamps"

In an OSX ~/.bash_profile, include the following alias:
alias cp="cp -p"

In both cases you will need to exit and restart bash.

---


Please consider crypto tipping: