<solved>fdisk unable to open drive?

Kernels & Hardware, configuring network, installing services

<solved>fdisk unable to open drive?

Postby Huecuva » 2020-03-14 03:04

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.
Huecuva
 
Posts: 116
Joined: 2017-06-09 04:00

Re: fdisk unable to open drive?

Postby Head_on_a_Stick » 2020-03-14 09:28

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

Code: Select all
# fdisk /dev/sda
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 12159
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: fdisk unable to open drive?

Postby Huecuva » 2020-03-14 16:01

Head_on_a_Stick wrote:
Code: Select all
# fdisk /dev/sda
Sorry. My bad. That's what I meant. I did put that.
Huecuva
 
Posts: 116
Joined: 2017-06-09 04:00

Re: fdisk unable to open drive?

Postby Head_on_a_Stick » 2020-03-14 16:07

Please post the full, verbatim output of
Code: Select all
# parted --list
# dmesg | grep sda
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 12159
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: fdisk unable to open drive?

Postby sunrat » 2020-03-14 20:56

fdisk is in /sbin/ . Maybe you didn't switch to root the correct way before running it ie. su - .
See 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!
User avatar
sunrat
 
Posts: 3086
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

Re: fdisk unable to open drive?

Postby Huecuva » 2020-03-14 21:05

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.
Huecuva
 
Posts: 116
Joined: 2017-06-09 04:00

Re: <solved>fdisk unable to open drive?

Postby sunrat » 2020-03-14 23:08

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!
User avatar
sunrat
 
Posts: 3086
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

Re: <solved>fdisk unable to open drive?

Postby Huecuva » 2020-03-19 01:23

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.
Huecuva
 
Posts: 116
Joined: 2017-06-09 04:00


Return to System configuration

Who is online

Users browsing this forum: No registered users and 7 guests

fashionable