Start and Stop Gnome#
sudo service gdm start
Mounting and formatting harddisk#
List hard disks and partitions#
# Partitions (RAW)
sudo fdisk -l
# Partitions and file format
sudo parted -l
# lists all block devices in the system as trees
lsblk
Partitioning#
# List available disk
sudo parted -l #or sudo fdisk -l
# Run partition software on target disk
sudo parted /dev/sdb
(parted) mklabel gpt
#(parted) mkpart primary ext4 0 4gb # Create primary parititon
(parted) mkpart primary ext4 0% 100%
quit
After partitioning, run sudo parted -l
and sudo fdisk -l
.
Model: ATA WDC WD80EFAX-68K (scsi)
Disk /dev/sdb: 8002GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 17.4kB 4000MB 4000MB primary
#################################################################
Disk /dev/sdd: 7.3 TiB, 8001563222016 bytes, 15628053168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: EFE420CC-767B-4F75-A23D-EC7D526C9A01
Device Start End Sectors Size Type
/dev/sdd1 34 7812500 7812467 3.7G Linux filesystem
Formatting#
# Formats the whole drive, create a new partition
sudo mkfs.ext4 /dev/sdb
# Or format a particular partition
sudo mkfs.ext4 /dev/sdb1
Extend Partition#
Mounting#
One-time Mount#
sudo mkdir /media/newhd
sudo mount /dev/sdb1 /media/newhd
cd /media/newhd
ls -l
Mount on startup#
To enable mount on boot, edit /etc/fstab
.
The /etc/fstab
file contains a list of entries in the following form:
| File System | Mount Point | FileSystem Type | Options | Dump | Pass |
Remember to create a directory before mounting.
Also, run sudo mount -a
after configuring /etc/fstab to check if the drives can be mounted successfully.
Here is an example /etc/fstab
cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Sun Aug 4 04:28:13 2019
#
# Accessible filesystems, by reference, are maintained under '/dev/disk/'.
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info.
#
# After editing this file, run 'systemctl daemon-reload' to update systemd
# units generated from this file.
#
# /dev/sdb /mnt/sdb ext4 defaults 0 0
/dev/sdb /media/JonData ext4 defaults 0 0
/dev/sdd /media/JonData2 ext4 defaults 0 0
Open fstab:
sudo vi /etc/fstab
Add the following line for ext3 file system:
/dev/sdb1 /media/newhd ext3 defaults 0 2
Add the following line for Windows FAT32 file system:
/dev/sdb1 /media/windowshd vfat defaults 0 2
Generating Private/Public SSH Keys#
Refer to link for detailed instructions.
* Generate key pairs using ssh-keygen -f [file] -t rsa -b 4096
on the local computer.
* There should be two files generated --> key and key.pub
* You have the option to add a passphrase to the keys, but it'll depend on your use case.
* Copy the public key to the server using one of the following methods:
* Method 1 - ssh-copy-id -i [public key file] [user@host]
* Method 2 - Manually append public key to ~/.ssh/authorized_keys
* Copy private key to client.
* For private keys with a passphrase, you can add it to ssh-agent
via ssh-add
. This way, you only enter the passphrase once and all subsequent logins should be passphrase-free.