0

I hope this message finds you well. I am writing to you because I am attempting to format and partition a drive in OpenBSD but have been met with the following message:

virtual-server# fdisk /dev/sd1c        
fdisk: /dev/sd1c is not a character device
virtual-server# lsblk
NAME   SIZE TYPE   COMMENT          
sd0     50G SCSI   Block Device     
├─sd0a 1.0G 4.2BSD /                
├─sd0b 1.2G swap                    
├─sd0c  50G unused                  
├─sd0d 3.2G 4.2BSD /tmp             
├─sd0e 5.1G 4.2BSD /var             
├─sd0f 5.3G 4.2BSD /usr             
├─sd0g 1.0G 4.2BSD /usr/X11R6       
├─sd0h 6.8G 4.2BSD /usr/local       
├─sd0i 2.2G 4.2BSD /usr/src         
├─sd0j 6.0G 4.2BSD /usr/obj         
└─sd0k  17G 4.2BSD /home            
sd1    100G SCSI   Block Device     
└─sd1c 100G unused                  
virtual-server# 

What does fdisk: /dev/sd1c is not a character device mean? I cannot find the error listed elsewhere but wanted to better understand what the issue is.

Note: lsblk is installed from the package manager.

9
  • 1
    what if you fdisk /dev/sd1 Commented Aug 12, 2024 at 0:16
  • @JaromandaX /dev/sd1 does not exist. virtual-server# fdisk /dev/sd1 fdisk: opendev('/dev/sd1', 0x0): No such file or directory virtual-server# Commented Aug 12, 2024 at 1:14
  • that's odd. lsblk clearly states that sd1 is a block device. I'm assuming BSD (I haven't used it in 20 years) the physical devices are sd0, sd1 etc, and the partitions are the ones with letters after the 0, 1 etc? of course, the is not a character device error looks really odd Commented Aug 12, 2024 at 1:31
  • 2
    Are you saying that /dev/sd1c exists, but that /dev/sd1 does not exist? Commented Aug 12, 2024 at 5:13
  • That's not a 1, That's an L but lowercase. I'd bet you a hole in a donut sd1 doesn't exist, but that sdl does. Or vice versa if you're typing an L it's a 1. Commented Aug 12, 2024 at 20:59

1 Answer 1

0

tl;dr:  fdisk sd1

You are running the command fdisk /dev/sd1c (or fdisk /dev/sd1 as suggested in the comments).

/dev/sd1 is the absolute path to the block device interface for sd1. A block interface provides a higher level abstraction for simplifying filesystem operations and is generally the way that most processes interact with storage media -- that is, once a medium has already been initialized with a filesystem.

fdisk, however, has different needs than most other processes, when it comes to storage media access. In order to be able to initialize a device with a filesystem in the first place, fdisk needs to have raw access to the individual bytes of a device instead of viewing it through 512-byte blocks. This raw access occurs through the character device interface of a device.

Most storage devices provide both interfaces: The block device for sdN is found at /dev/sdN and the character devices is at /dev/rsdN.

So if you were to run fdisk /dev/rsd1 you should find that you are able to proceed. fdisk is smart enough to infer the absolute path, so you can save a bit of typing just by doing: fdisk sd1

1
  • Does this actually work on OpenBSD? Commented Oct 17, 2024 at 0:06

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.