Score:0

mkdir can not create directory, no such file or directory after installing ubuntu and removing windows

li flag

So I recently installed ubuntu. Before this I had Windows installed with 3 drives i.e 'C:/','Studies:/' etc.

I only tried to remove the C drive and installed ubuntu there, which I did successfully. Now that Ubuntu is installed; when I opened Ubuntu I 'mounted' the 'Studies' drive. First it mounted as read only, so I changed it to write mode following google, using this command:

sudo mount -o remount,rw /media/mzali/Studies

But now I am getting this error when I try to create a directory or a virtual environment:

mkdir: cannot create directory ‘python_env’: No such file or directory

Note that I also get it if I use the -p tag. Below is the output of 'cat /proc/mounts'

sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
udev /dev devtmpfs rw,nosuid,relatime,size=3991148k,nr_inodes=997787,mode=755,inode64 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /run tmpfs rw,nosuid,nodev,noexec,relatime,size=805168k,mode=755,inode64 0 0
/dev/sda2 / ext4 rw,relatime,errors=remount-ro 0 0
securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev,inode64 0 0
tmpfs /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k,inode64 0 0
cgroup2 /sys/fs/cgroup cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot 0 0
pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0
bpf /sys/fs/bpf bpf rw,nosuid,nodev,noexec,relatime,mode=700 0 0
systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=29,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=1709 0 0
mqueue /dev/mqueue mqueue rw,nosuid,nodev,noexec,relatime 0 0
hugetlbfs /dev/hugepages hugetlbfs rw,relatime,pagesize=2M 0 0
debugfs /sys/kernel/debug debugfs rw,nosuid,nodev,noexec,relatime 0 0
tracefs /sys/kernel/tracing tracefs rw,nosuid,nodev,noexec,relatime 0 0
configfs /sys/kernel/config configfs rw,nosuid,nodev,noexec,relatime 0 0
none /run/credentials/systemd-sysusers.service ramfs ro,nosuid,nodev,noexec,relatime,mode=700 0 0
fusectl /sys/fs/fuse/connections fusectl rw,nosuid,nodev,noexec,relatime 0 0
/dev/loop2 /snap/core20/1778 squashfs ro,nodev,relatime,errors=continue 0 0
/dev/loop0 /snap/core20/1587 squashfs ro,nodev,relatime,errors=continue 0 0
/dev/loop1 /snap/bare/5 squashfs ro,nodev,relatime,errors=continue 0 0
/dev/loop3 /snap/firefox/1635 squashfs ro,nodev,relatime,errors=continue 0 0
/dev/loop4 /snap/firefox/2211 squashfs ro,nodev,relatime,errors=continue 0 0
/dev/loop5 /snap/gnome-3-38-2004/112 squashfs ro,nodev,relatime,errors=continue 0 0
/dev/loop6 /snap/gtk-common-themes/1535 squashfs ro,nodev,relatime,errors=continue 0 0
/dev/loop7 /snap/snapd/17883 squashfs ro,nodev,relatime,errors=continue 0 0
/dev/loop9 /snap/snapd-desktop-integration/14 squashfs ro,nodev,relatime,errors=continue 0 0
/dev/loop11 /snap/snap-store/638 squashfs ro,nodev,relatime,errors=continue 0 0
/dev/loop8 /snap/snap-store/582 squashfs ro,nodev,relatime,errors=continue 0 0
/dev/loop10 /snap/gnome-3-38-2004/119 squashfs ro,nodev,relatime,errors=continue 0 0
/dev/sda2 /var/snap/firefox/common/host-hunspell ext4 ro,noexec,noatime,errors=remount-ro 0 0
/dev/loop12 /snap/snapd-desktop-integration/49 squashfs ro,nodev,relatime,errors=continue 0 0
/dev/sda5 /boot/efi vfat rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /run/snapd/ns tmpfs rw,nosuid,nodev,noexec,relatime,size=805168k,mode=755,inode64 0 0
nsfs /run/snapd/ns/snapd-desktop-integration.mnt nsfs rw 0 0
tmpfs /run/user/1000 tmpfs rw,nosuid,nodev,relatime,size=805164k,nr_inodes=201291,mode=700,uid=1000,gid=1000,inode64 0 0
gvfsd-fuse /run/user/1000/gvfs fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0
portal /run/user/1000/doc fuse.portal rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0
/dev/sdb3 /media/mzali/Studies fuseblk rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096 0 0

I tried googling a lot, and there are a lot of answers for this issue but most of them are just to use the 'p' tag and it isn't working for me.

I switched to Ubuntu so I won't have the usual windows issues in installing different software, but this is even worse.

cn flag
please provide the actual command and response for what you tried, not just the result.
Mazhar Ali avatar
li flag
@Rinzwind which command? I am trying 'mkdir anydir' but its giving the error mentioned. The long output is for the command 'cat /proc/mounts', that is also mentioned in the question. If you are talking about the part of 'removing the C drive', then it was during Ubuntu installation. And Ubuntu is installed now.
Mazhar Ali avatar
li flag
@Rinzwind question edited.
Andrea Corbellini avatar
in flag
It's possible that you're running `mkdir` from within a directory that no longer exists. What does `pwd` say? Have you tried `cd` (without any arguments) to go back to your home directory?
Mazhar Ali avatar
li flag
@AndreaCorbellini The directory exists. If it doesn't exist, the -p tag in mkdir should create it, isn't it? Also, pwd creates the directory I am in. All the 'drives' from my windows are mounted as external hard drives I think. Check the image: https://imgur.com/a/JkMPHaO. The 4 'grey' icons (in image) on the left were my drives in windows.
Andrea Corbellini avatar
in flag
No, even with the `-p` flag, if you're in a directory that does not exist, `mkdir` will fail (if you pass a relative path, like in your case). Also note that even after you re-create a directory with the same name, you need to `cd` back into it
Mazhar Ali avatar
li flag
I fixed it. It was an issue with the ntfs file system. For some reasons windows was not completely deleted and I had to unmount, run 'ntfsfix' and then remount it for it to work.
Score:0
sa flag

Windows was not completely deleted. Unmount the 'Studies' drive, run ntfsfix and then remount the 'Studies' drive for it to work.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.