Disk management: Difference between revisions

From Han Wiki
Jump to navigation Jump to search
Line 7: Line 7:
sda2 swap    2G [SWAP]
sda2 swap    2G [SWAP]
</syntaxhighlight>
</syntaxhighlight>
== Mirror a folder ==
* ''Last tested on Ubuntu 16.04 LTS (xenial)''
This also works between servers. The first one is on the same server.
Explanation of parameters used:
* -a: archive - preserve permissions, ownership, and timestamps
* -v: verbose
* -z: compress
<syntaxhighlight lang="bash" highlight="1">
$ rsync -azv /folder_a/ /folder_b/
</syntaxhighlight>
This one is between different servers.
<syntaxhighlight lang="bash" highlight="1">
$ rsync -azv ~/folder_a/ mhan@tom.myserver.com:~/folder_b/
</syntaxhighlight>
[[Category:System administration]]

Revision as of 12:01, 1 February 2017

List all disks and partitions

  • Last tested on Ubuntu 14.04.2 LTS (trusty)
$ sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL
NAME FSTYPE SIZE MOUNTPOINT LABEL
sda1 ext3    38G /
sda2 swap     2G [SWAP]