Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

<solved>fdisk unable to open drive?

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
Huecuva
Posts: 135
Joined: 2017-06-09 04:00

<solved>fdisk unable to open drive?

#1 Post by Huecuva »

I have a fit-pc3 device that I have installed debian 10.3 headless on a 4GB SD card and I have a 160GB 2.5" HDD I would like to use for storage in it. This drive exists, and the lsblk command lists it as sda with 10 partitions. When I tried fdisk /dev/sda it says no such file or directory. When I type fdisk -l it lists sda and all 10 of its partitions.

Does anyone have any ideas?

Edited for proper path to device that fdisk can find but can't find.
Last edited by Huecuva on 2020-03-14 21:05, edited 2 times in total.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: fdisk unable to open drive?

#2 Post by Head_on_a_Stick »

Huecuva wrote:When I tried fdisk sda it says no such file or directory.

Code: Select all

# fdisk /dev/sda
deadbang

Huecuva
Posts: 135
Joined: 2017-06-09 04:00

Re: fdisk unable to open drive?

#3 Post by Huecuva »

Head_on_a_Stick wrote:

Code: Select all

# fdisk /dev/sda
Sorry. My bad. That's what I meant. I did put that.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: fdisk unable to open drive?

#4 Post by Head_on_a_Stick »

Please post the full, verbatim output of

Code: Select all

# parted --list
# dmesg | grep sda
deadbang

User avatar
sunrat
Administrator
Administrator
Posts: 6457
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 472 times

Re: fdisk unable to open drive?

#5 Post by sunrat »

fdisk is in /sbin/ . Maybe you didn't switch to root the correct way before running it ie. su - .
See http://forums.debian.net/viewtopic.php?f=16&t=142973
Or maybe not as that usually gives "command not found".

@HOAS - DLN has kindly stickied that topic after my request seeing as it comes up so often.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

Huecuva
Posts: 135
Joined: 2017-06-09 04:00

Re: fdisk unable to open drive?

#6 Post by Huecuva »

I did use su - to get to root, specifically because I don't need or want to install sudo on this machine, so I find myself using it often.

Anyway, this doesn't matter anymore. In the process of trying to get verbatim results for those two commands without having to manually type it all out, I was trying to mount a USB flash drive to copy the output file that I redirected them to but I was having problems with that, too. I tried to use fdisk to format it to something I could mount and that didn't work. Fdisk really sucks.

Anyway, I ended up just booting the fit-PC into gparted live and formatting them both in that.

Thanks for the help guys.

User avatar
sunrat
Administrator
Administrator
Posts: 6457
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 472 times

Re: <solved>fdisk unable to open drive?

#7 Post by sunrat »

A helpful hint for the future - when you ask about commands, copy/paste the exact commands and their outputs rather than paraphrasing or your interpretation. There may have been something in the terminal text that could help diagnosing why the command did not work as expected. For instance, if you had posted the exact commands including the terminal prompt, I could have guessed that you probably used su - .
# fdisk /dev/sda should work to start editing that disk. I would have been fascinated to find out why it didn't.
At least you got your partitioning done in the end though. :wink:
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

Huecuva
Posts: 135
Joined: 2017-06-09 04:00

Re: <solved>fdisk unable to open drive?

#8 Post by Huecuva »

sunrat wrote:A helpful hint for the future - when you ask about commands, copy/paste the exact commands and their outputs rather than paraphrasing or your interpretation. There may have been something in the terminal text that could help diagnosing why the command did not work as expected. For instance, if you had posted the exact commands including the terminal prompt, I could have guessed that you probably used su - .
# fdisk /dev/sda should work to start editing that disk. I would have been fascinated to find out why it didn't.
At least you got your partitioning done in the end though. :wink:
Yeah, sorry. I know. Poor Mr Head_on_a_Stick is a champ for dealing with my bullshit. Unfortunately, getting verbatim copy-paste results was a prohibitively complicated process for reasons beyond my immediate control and for unrelated reasons, my HTPC's connection to my wireless keyboard isn't always reliable so typing it out was equally as frustrating. However, once I was able to SSH into the thing from my desk in the other room with a proper keyboard and mouse and the ability to copy/paste. things went a lot more smoothly.

Post Reply