Mounting a new disk in Linux

-> How to mount a new disk in Linux ?

#Create a partition
sudo fdisk /dev/sdb

#Verify using lsblk
sdb 8:16 0 2G 0 disk
└─sdb1 8:17 0 2G 0 part /

#Create a filesystem
sudo mkfs -t ext4 /dev/sdb1

#Mount it
sudo mount -t ext4 …


This content originally appeared on DEV Community and was authored by Santhosh Balasa

-> How to mount a new disk in Linux ?

#Create a partition
sudo fdisk /dev/sdb

#Verify using lsblk
sdb      8:16   0    2G  0 disk
└─sdb1   8:17   0    2G  0 part /

#Create a filesystem
sudo mkfs -t ext4 /dev/sdb1

#Mount it 
sudo mount -t ext4 /dev/sdb1 /kafka

#Verify using lsblk
sdb      8:16   0    2G  0 disk
└─sdb1   8:17   0    2G  0 part /kafka

-> How to bind a folder to this new disk and keep its data ?

sudo mount -t ext4 /dev/sdc1 /obs_parser

#Bind
sudo mount -o bind /vagrant /obs_parser

#Edit /etc/fstab entry (optional)
/vagrant /obs_parser none defaults,bind 0 0

#lsblk
sdc      8:32   0   41G  0 disk
└─sdc1   8:33   0   41G  0 part /obs_parser


This content originally appeared on DEV Community and was authored by Santhosh Balasa


Print Share Comment Cite Upload Translate Updates
APA

Santhosh Balasa | Sciencx (2021-05-31T03:17:22+00:00) Mounting a new disk in Linux. Retrieved from https://www.scien.cx/2021/05/31/mounting-a-new-disk-in-linux/

MLA
" » Mounting a new disk in Linux." Santhosh Balasa | Sciencx - Monday May 31, 2021, https://www.scien.cx/2021/05/31/mounting-a-new-disk-in-linux/
HARVARD
Santhosh Balasa | Sciencx Monday May 31, 2021 » Mounting a new disk in Linux., viewed ,<https://www.scien.cx/2021/05/31/mounting-a-new-disk-in-linux/>
VANCOUVER
Santhosh Balasa | Sciencx - » Mounting a new disk in Linux. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/05/31/mounting-a-new-disk-in-linux/
CHICAGO
" » Mounting a new disk in Linux." Santhosh Balasa | Sciencx - Accessed . https://www.scien.cx/2021/05/31/mounting-a-new-disk-in-linux/
IEEE
" » Mounting a new disk in Linux." Santhosh Balasa | Sciencx [Online]. Available: https://www.scien.cx/2021/05/31/mounting-a-new-disk-in-linux/. [Accessed: ]
rf:citation
» Mounting a new disk in Linux | Santhosh Balasa | Sciencx | https://www.scien.cx/2021/05/31/mounting-a-new-disk-in-linux/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.