If you have dual booted kali or other Linux distribution into Windows then the windows drives won't be mounted during after login. And, you may want to type in you password each time you logged in to mount the drive in Kali.
There is a file in etc folder of Kali which keeps information of what to mount during login. You just need to add you drive which you want to mount in that file.
The file name is fstab. You need to open the file in any editor and add you drive in the file.
So, let's do this.
Mounting Drive
First to check what drives are already added in the file to be mounted upon login. Use command.
cat /etc/fstab
As you can see in above SS(screenshot), there is three drives mounted, one is the root drive in which Linux is installed and second one is swap. And both is necessary for an OS to run. The last that is in the file is CDROM. You may not have this drive in your file. Note that you may also not have swap which is not that necessary but if you do have swap that's better.
Now if you need to add another drive to be mounted upon login then you add that in this file. Before adding, you need to know the UUID of that drive. For that you can type below command.
sudo blkid
It will show the details of each drive for both mounted and umounted ones.
Now, suppose you need to mount some drive with UUID='THISISMYUUID'. Along with UUID, you need to provide values for mount point, type, options, dump and pass with a single space in between them.
Your mount point value will be the path for you drive. use /media path by default. In media you can give any folder and name for the drive you want. Like if I want my drive to be name as 'C' inside folder name windows. I can give mount point value as
/media/windows/C
You will get the type of the drive with the
sudo blkid
command.You can 'rw' by default in in for options. 0 in dump and 2 for pass value. Remember pass value 1 is reserved for root drive. So, don't provide pass value 1 in any case unless its root drive.
You can see what else can we provide instead of default value by typing command
man fstab
So final line that you have to add at end in the file is
UUID=THISISMYUUID /media/windows/C ntfs rw 0 2
For adding if you simply open the file with command
nano /etc/fstab
. It may not be writable/editable. So, to edit the file. use the command with sudo i.e. sudo nano /etc/fstab
.Save file with ctrl+O and exit with ctrl+X.
Remember this is not the end. Don't forget to run the command
systemctl daemon-reload
after saing the file. Otherwise, if there is any mistake in what you have added and you restarted or next time when you start your machine, it won't able to boot successfully and you might not be able to login at all.
0 Comments
Your comment will be moderated.