Trying to format a sandisk pendrive using bash
My sandisk pendrive is write protected and i have tried everything to repair it but nothing worked. Now finally i am trying to format it using bash in my windows machine. But commands like fdisk -l are not running. Can someone help?
fdisk: cannot open /proc/partitions: No such file or directory
And df or mount dont show my pendrive which is connected
root@DESKTOP-FGQQE3V:~# fdisk -l
fdisk: cannot open /proc/partitions: No such file or directory
root@DESKTOP-FGQQE3V:~# df
Filesystem 1K-blocks Used Available Use% Mounted on
rootfs 459892424 417204692 42687732 91% /
root 459892424 417204692 42687732 91% /root
home 459892424 417204692 42687732 91% /home
data 459892424 417204692 42687732 91% /data
cache 459892424 417204692 42687732 91% /cache
mnt 459892424 417204692 42687732 91% /mnt
none 459892424 417204692 42687732 91% /dev
none 459892424 417204692 42687732 91% /run
none 459892424 417204692 42687732 91% /run/lock
none 459892424 417204692 42687732 91% /run/shm
none 459892424 417204692 42687732 91% /run/user
C: 459892424 417204692 42687732 91% /mnt/c
D: 514935804 444943028 69992776 87% /mnt/d
root@DESKTOP-FGQQE3V:~# mount
rootfs on / type lxfs (rw,noatime)
root on /root type lxfs (rw,noatime)
home on /home type lxfs (rw,noatime)
data on /data type lxfs (rw,noatime)
cache on /cache type lxfs (rw,noatime)
mnt on /mnt type lxfs (rw,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
none on /dev type tmpfs (rw,noatime,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,noatime,gid=5,mode=620)
none on /run type tmpfs (rw,nosuid,noexec,noatime,mode=755)
none on /run/lock type tmpfs (rw,nosuid,nodev,noexec,noatime)
none on /run/shm type tmpfs (rw,nosuid,nodev,noatime)
none on /run/user type tmpfs (rw,nosuid,nodev,noexec,noatime,mode=755)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noatime)
C: on /mnt/c type drvfs (rw,noatime,uid=1000,gid=1000)
D: on /mnt/d type drvfs (rw,noatime,uid=1000,gid=1000)
linux bash partitioning mount usb-flash-drive
add a comment |
My sandisk pendrive is write protected and i have tried everything to repair it but nothing worked. Now finally i am trying to format it using bash in my windows machine. But commands like fdisk -l are not running. Can someone help?
fdisk: cannot open /proc/partitions: No such file or directory
And df or mount dont show my pendrive which is connected
root@DESKTOP-FGQQE3V:~# fdisk -l
fdisk: cannot open /proc/partitions: No such file or directory
root@DESKTOP-FGQQE3V:~# df
Filesystem 1K-blocks Used Available Use% Mounted on
rootfs 459892424 417204692 42687732 91% /
root 459892424 417204692 42687732 91% /root
home 459892424 417204692 42687732 91% /home
data 459892424 417204692 42687732 91% /data
cache 459892424 417204692 42687732 91% /cache
mnt 459892424 417204692 42687732 91% /mnt
none 459892424 417204692 42687732 91% /dev
none 459892424 417204692 42687732 91% /run
none 459892424 417204692 42687732 91% /run/lock
none 459892424 417204692 42687732 91% /run/shm
none 459892424 417204692 42687732 91% /run/user
C: 459892424 417204692 42687732 91% /mnt/c
D: 514935804 444943028 69992776 87% /mnt/d
root@DESKTOP-FGQQE3V:~# mount
rootfs on / type lxfs (rw,noatime)
root on /root type lxfs (rw,noatime)
home on /home type lxfs (rw,noatime)
data on /data type lxfs (rw,noatime)
cache on /cache type lxfs (rw,noatime)
mnt on /mnt type lxfs (rw,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
none on /dev type tmpfs (rw,noatime,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,noatime,gid=5,mode=620)
none on /run type tmpfs (rw,nosuid,noexec,noatime,mode=755)
none on /run/lock type tmpfs (rw,nosuid,nodev,noexec,noatime)
none on /run/shm type tmpfs (rw,nosuid,nodev,noatime)
none on /run/user type tmpfs (rw,nosuid,nodev,noexec,noatime,mode=755)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noatime)
C: on /mnt/c type drvfs (rw,noatime,uid=1000,gid=1000)
D: on /mnt/d type drvfs (rw,noatime,uid=1000,gid=1000)
linux bash partitioning mount usb-flash-drive
1
Possible duplicate of What can I do if my USB flash drive is write-protected or read-only?
– Tetsujin
Jan 21 at 7:58
add a comment |
My sandisk pendrive is write protected and i have tried everything to repair it but nothing worked. Now finally i am trying to format it using bash in my windows machine. But commands like fdisk -l are not running. Can someone help?
fdisk: cannot open /proc/partitions: No such file or directory
And df or mount dont show my pendrive which is connected
root@DESKTOP-FGQQE3V:~# fdisk -l
fdisk: cannot open /proc/partitions: No such file or directory
root@DESKTOP-FGQQE3V:~# df
Filesystem 1K-blocks Used Available Use% Mounted on
rootfs 459892424 417204692 42687732 91% /
root 459892424 417204692 42687732 91% /root
home 459892424 417204692 42687732 91% /home
data 459892424 417204692 42687732 91% /data
cache 459892424 417204692 42687732 91% /cache
mnt 459892424 417204692 42687732 91% /mnt
none 459892424 417204692 42687732 91% /dev
none 459892424 417204692 42687732 91% /run
none 459892424 417204692 42687732 91% /run/lock
none 459892424 417204692 42687732 91% /run/shm
none 459892424 417204692 42687732 91% /run/user
C: 459892424 417204692 42687732 91% /mnt/c
D: 514935804 444943028 69992776 87% /mnt/d
root@DESKTOP-FGQQE3V:~# mount
rootfs on / type lxfs (rw,noatime)
root on /root type lxfs (rw,noatime)
home on /home type lxfs (rw,noatime)
data on /data type lxfs (rw,noatime)
cache on /cache type lxfs (rw,noatime)
mnt on /mnt type lxfs (rw,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
none on /dev type tmpfs (rw,noatime,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,noatime,gid=5,mode=620)
none on /run type tmpfs (rw,nosuid,noexec,noatime,mode=755)
none on /run/lock type tmpfs (rw,nosuid,nodev,noexec,noatime)
none on /run/shm type tmpfs (rw,nosuid,nodev,noatime)
none on /run/user type tmpfs (rw,nosuid,nodev,noexec,noatime,mode=755)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noatime)
C: on /mnt/c type drvfs (rw,noatime,uid=1000,gid=1000)
D: on /mnt/d type drvfs (rw,noatime,uid=1000,gid=1000)
linux bash partitioning mount usb-flash-drive
My sandisk pendrive is write protected and i have tried everything to repair it but nothing worked. Now finally i am trying to format it using bash in my windows machine. But commands like fdisk -l are not running. Can someone help?
fdisk: cannot open /proc/partitions: No such file or directory
And df or mount dont show my pendrive which is connected
root@DESKTOP-FGQQE3V:~# fdisk -l
fdisk: cannot open /proc/partitions: No such file or directory
root@DESKTOP-FGQQE3V:~# df
Filesystem 1K-blocks Used Available Use% Mounted on
rootfs 459892424 417204692 42687732 91% /
root 459892424 417204692 42687732 91% /root
home 459892424 417204692 42687732 91% /home
data 459892424 417204692 42687732 91% /data
cache 459892424 417204692 42687732 91% /cache
mnt 459892424 417204692 42687732 91% /mnt
none 459892424 417204692 42687732 91% /dev
none 459892424 417204692 42687732 91% /run
none 459892424 417204692 42687732 91% /run/lock
none 459892424 417204692 42687732 91% /run/shm
none 459892424 417204692 42687732 91% /run/user
C: 459892424 417204692 42687732 91% /mnt/c
D: 514935804 444943028 69992776 87% /mnt/d
root@DESKTOP-FGQQE3V:~# mount
rootfs on / type lxfs (rw,noatime)
root on /root type lxfs (rw,noatime)
home on /home type lxfs (rw,noatime)
data on /data type lxfs (rw,noatime)
cache on /cache type lxfs (rw,noatime)
mnt on /mnt type lxfs (rw,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
none on /dev type tmpfs (rw,noatime,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,noatime,gid=5,mode=620)
none on /run type tmpfs (rw,nosuid,noexec,noatime,mode=755)
none on /run/lock type tmpfs (rw,nosuid,nodev,noexec,noatime)
none on /run/shm type tmpfs (rw,nosuid,nodev,noatime)
none on /run/user type tmpfs (rw,nosuid,nodev,noexec,noatime,mode=755)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noatime)
C: on /mnt/c type drvfs (rw,noatime,uid=1000,gid=1000)
D: on /mnt/d type drvfs (rw,noatime,uid=1000,gid=1000)
linux bash partitioning mount usb-flash-drive
linux bash partitioning mount usb-flash-drive
asked Jan 21 at 4:05
Rahul DesaiRahul Desai
63
63
1
Possible duplicate of What can I do if my USB flash drive is write-protected or read-only?
– Tetsujin
Jan 21 at 7:58
add a comment |
1
Possible duplicate of What can I do if my USB flash drive is write-protected or read-only?
– Tetsujin
Jan 21 at 7:58
1
1
Possible duplicate of What can I do if my USB flash drive is write-protected or read-only?
– Tetsujin
Jan 21 at 7:58
Possible duplicate of What can I do if my USB flash drive is write-protected or read-only?
– Tetsujin
Jan 21 at 7:58
add a comment |
1 Answer
1
active
oldest
votes
If you're using the "linux subsystem" feature in Windows, it won't work.
This shell does not have access to the 'real' devices connected to the machine.
I guess the easiest solution would be to use a small Linux virtual machine or to boot a linux system.
New contributor
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1396456%2ftrying-to-format-a-sandisk-pendrive-using-bash%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
If you're using the "linux subsystem" feature in Windows, it won't work.
This shell does not have access to the 'real' devices connected to the machine.
I guess the easiest solution would be to use a small Linux virtual machine or to boot a linux system.
New contributor
add a comment |
If you're using the "linux subsystem" feature in Windows, it won't work.
This shell does not have access to the 'real' devices connected to the machine.
I guess the easiest solution would be to use a small Linux virtual machine or to boot a linux system.
New contributor
add a comment |
If you're using the "linux subsystem" feature in Windows, it won't work.
This shell does not have access to the 'real' devices connected to the machine.
I guess the easiest solution would be to use a small Linux virtual machine or to boot a linux system.
New contributor
If you're using the "linux subsystem" feature in Windows, it won't work.
This shell does not have access to the 'real' devices connected to the machine.
I guess the easiest solution would be to use a small Linux virtual machine or to boot a linux system.
New contributor
New contributor
answered 2 days ago
Michał StońMichał Stoń
1
1
New contributor
New contributor
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1396456%2ftrying-to-format-a-sandisk-pendrive-using-bash%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Possible duplicate of What can I do if my USB flash drive is write-protected or read-only?
– Tetsujin
Jan 21 at 7:58