Add hard drive into Linux Mint 21.1 Vera/Ubuntu/Debian
This is a condensed version on how to add hard disk into Linux Mint/Ubuntu/Debian. First check hard drives in the system, like so:$: sudo lshw -C disk
*-disk:1 description: ATA Disk product: WDC WD3200AAKX-0 vendor: Western Digital physical id: 1 bus info: scsi@1:0.0.0 logical name: /dev/sdb version: 1H15 serial: WD-WMC2E0871450 size: 298GiB (320GB) capabilities: partitioned partitioned:dos configuration: ansiversion=5 logicalsectorsize=512 sectorsize=512 signature=e32ff1f9
$: sudo parted /dev/sdb
(parted) mklabel gpt
(parted) unit GB
(parted) mkpart primary ext4 0 100%
(parted) print
Model: ATA WDC WD3200AAKX-0 (scsi) Disk /dev/sdb: 320GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 1 0.00GB 320GB 320GB ext4 primary
(parted) quit
$: sudo mkfs -t ext4 /dev/sdb1
mke2fs 1.46.5 (30-Dec-2021) /dev/sdb1 contains a ext4 file system labelled 'VMs' last mounted on /mnt/b41faa95-6135-47f6-a24e-ed1909d6fc18 on Sun Dec 25 19:06:43 2022 Proceed anyway? (y,N) y Creating filesystem with 78142464 4k blocks and 19537920 inodes Filesystem UUID: 1b7f46da-9aa6-4c30-afec-d983f35a19d5 Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872, 71663616 Allocating group tables: done Writing inode tables: done Creating journal (262144 blocks): done Writing superblocks and filesystem accounting information: done
$: sudo mkdir /mnt/vmdisk
$: sudo vim /etc/fstab
/dev/sdb1 /mnt/vmdisk ext4 defaults 0 0
$: sudo mount /mnt/vmdisk
$: sudo mkdir /mnt/vmdisk/vms
$: sudo chown -R timus:timus /mnt/vmdisk/vms
https://help.ubuntu.com/community/InstallingANewHardDrive
Comments