https://www.linux.com/learn/intro-to-linux/2017/3/how-format-storage-devices-linux
https://www.certdepot.net/rhel7-create-delete-partitions/
https://askubuntu.com/questions/154180/how-to-mount-a-new-drive-on-startup
First of all your
/dev/sdb isn't partitioned. I am assuming this is the disk you want to mount.WARNING: THIS WILL DESTROY ANY DATA ON YOUR TARGET DISK
Run
sudo fdisk /dev/sdb- Press O and press Enter (creates a new table)
- Press N and press Enter (creates a new partition)
- Press P and press Enter (makes a primary partition)
- Then press 1 and press Enter (creates it as the 1st partition)
- Finally, press W (this will write any changes to disk)
Okay now you have a partition, now you need a filesystem.
- Run
sudo mkfs.ext4 /dev/sdb1 - Now you can add it to fstabYou need to add it to
/etc/fstabuse your favourite text editorBe careful with this file as it can quite easily cause your system not to boot.Add a line for the drive, the format would look like this.This assumes the partition is formatted as ext4 as per mkfs above#device mountpoint fstype options dump fsck /dev/sdb1 /home/yourname/mydata ext4 defaults 0 1
Then on the next reboot it will auto mount.
No comments:
Post a Comment