display device
Disk /dev/sdc: 2 TiB, 2197949513728 bytes, 4292870144 sectors
2. $ mkdir /media/DiskC
Better use /media instead of /mnt, because /mnt is usually the automatic mount point, may be replaced when restarting.
3 $ mount /dev/sdc /media/DiskC
Then error occured
mount: wrong fs type, bad option, bad superblock on /dev/sdc,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.
(for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount. helper program)
This is relevant given that you are trying to mount NFS. The
/sbin/mount.nfs
helper program is provided by nfs-common
. You can install it with:sudo apt install nfs-common
On the other hand, if you are trying to mount CIFS, the helper program is provided by
cifs-utils
. You can install it with:sudo apt install cifs-utils
4. convert file type
$ sudo mkfs.ext4 /dev/sdc
goto step 3.
Done!
Auto mount on start up.
- [IMPORTANT]
sudo cp /etc/fstab /etc/fstab.old
- Create a backup of the fstab file just in case something unwanted happens. sudo blkid
- Note the UUID of the partition you want to automount.ls
-al
/dev/disk/by-uuid/
lrwxrwxrwx 1 root root 10 Sep 2 17:45 842c5c25-xxxx-xxxx-xxxx-6da95691d994 -> ../../sdb1lrwxrwxrwx 1 root root 10 Sep 2 17:45 b1c5d9e4-xxxx-xxxx-xxxx-5d4a0e0ffd5a -> ../../sdc1lrwxrwxrwx 1 root root 9 Sep 2 17:45 ceedf9aa-xxxx-xxxx-xxxx-863293374348 -> ../../sddlrwxrwxrwx 1 root root 10 Sep 2 17:46 fc9a41df-xxxx-xxxx-xxxx-e5999bd67182 -> ../../sda1sudo nano /etc/fstab
- Copy the following line to the end of the file, save it and reboot afterwards to check if it worked.
Examples
A common setup is:
UUID=<uuid> <pathtomount> <filesystem> defaults 0 0
Use
lsblk -o NAME,FSTYPE,UUID
to find out the UUIDs and filesystems of the partition you want to mount. For example:$ lsblk -o NAME,FSTYPE,UUID
NAME FSTYPE UUID
sda
├─sda2
├─sda5 swap 498d24e5-7755-422f-be45-1b78d50b44e8
└─sda1 ext4 d4873b63-0956-42a7-9dcf-bd64e495a9ff
NTFS
UUID=<uuid> <pathtomount> ntfs uid=<userid>,gid=<groupid>,umask=0022,sync,auto,rw 0 0
Examples for the
<>
variables:<uuid>
=3087106951D2FA7E
<pathtomount>
=/home/data/
<userid>
=1000
<groupid>
=1000
Use
id -u <username>
to get the userid and id -g <username>
to get the groupid.# Mount all disks
sudo mount -a
No comments:
Post a Comment