hdparm issue: "HDIO_GETGEO failed: Inappropriate ioctl for device" 05 September 2021, 06:37:55 Hi. You might recognise me and also you might recognise this question too, I've asked this in a previous thread but then stopped in hopes that it'd magically just start working properly. Well, it didn't, and after that, I've tried reaching people through the IRC which was very hard for me because of power outages, where i kept missing messages. And then I've tried through the telegram, which seems like there isn't anyone that knew about the problem (if I recall correctly, I did ask the problem there). But all to no avail. I think this is a bug in the `hdparm-s6` script package and I believe it's slowing down my boot speed, and it's overall very frusturating.Overall, what happens is, after I press the power on button of my computer (which uses a hard drive, not an SSD, so boot speed is already very slow), then I get greeted with my rEFInd bootloader. After choosing to boot Artix, I see a console, with fsck checking my drive for inconsistencies, then "s6-linux-init xx.xx.xx", replacing the xx with the version number. After that, I'd say it varies from 10 to 30 seconds to show the error two lines below: "@400000006132c809261ae0e5 HDIO_GETGEO failed: Inappropriate ioctl for device`It's a different number every time, I believe. Then, after that, it could take from 30 seconds to a couple minutes for it to finally boot and for agetty to ask me for my credentials.There has not been one time I've booted my computer where that exact thing didn't happen since I've switched to s6.Also, I'd really appreciate it if I could help test s6 for hard drives and if I also could help with trying some boot speed-ups for s6, I believe when I was on runit, it booted in much less time, so I think S6 has the potential to do that as well. I'm extremely sorry if any of this sounds like I am entitled, or anything similar. It's just that it's a weird issue that mostly everyone seems to answer with uncertainty, and it'd be really nice if it got solved. Thank you very much for taking time to read about my issue, and thank you for helping in advance. Last Edit: 05 September 2021, 07:15:29 by MonAaraj
Re: hdparm issue: "HDIO_GETGEO failed: Inappropriate ioctl for device" Reply #1 – 05 September 2021, 14:11:11 When I boot-test our ISOs, I'm always impressed by the boot speed of s6 - it's seems marginally faster than runit. So, the s6 need for speedup is pretty much out of the question.The "inappropriate ioctl" is from the "get_geometry" call for a hard disk device; if you have got only one hard disk, then you should take a backup of your important data immediately and do a badblocks search on it , having booted off a live ISO. If all is fine, you need more troubleshooting.
Re: hdparm issue: "HDIO_GETGEO failed: Inappropriate ioctl for device" Reply #2 – 05 September 2021, 15:51:44 The chances of hdparm affecting boot speed is slim to none since it is literally only a single oneshot script. If you have not changed the hdparm.conf file at all then by default the script actually does nothing (unless you have a PATA drive). In your case, the "HDIO_GETGEO failed: Inappropriate ioctl for device" message will occur if you run the script without any changes on a cd/dvd device. This is because the script simply executes "hdparm /dev/cdrom" (or whatever the name is) without passing any args to it at all. It does nothing in that case and is harmless.As for boot up time, the #1 blocker is pretty much always udev settling. That can't really be avoided sadly.
Re: hdparm issue: "HDIO_GETGEO failed: Inappropriate ioctl for device" Reply #3 – 05 September 2021, 20:18:41 I'd add that the boot time is irrelevant anyway, as Unix-like systems don't need to be rebooted as much as Windows. Where systemd fails compared to other inits is the much less often mentioned shutdown, which (at least more than a year ago, when I last tried a systemd distro) is not just slower, but often completely hangs.
Re: hdparm issue: "HDIO_GETGEO failed: Inappropriate ioctl for device" Reply #4 – 06 September 2021, 02:39:00 QuoteThe chances of hdparm affecting boot speed is slim to none since it is literally only a single oneshot script. If you have not changed the hdparm.conf file at all then by default the script actually does nothing (unless you have a PATA drive). In your case, the "HDIO_GETGEO failed: Inappropriate ioctl for device" message will occur if you run the script without any changes on a cd/dvd device. This is because the script simply executes "hdparm /dev/cdrom" (or whatever the name is) without passing any args to it at all. It does nothing in that case and is harmless.Ah, I see. Then I guess I was just being paranoid about it, is there a chance that error could be not outputted if it really doesn't mean much? It looks like it's saying that something went really wrong IMO. QuoteI'd add that the boot time is irrelevant anyway, as Unix-like systems don't need to be rebooted as much as Windows. Where systemd fails compared to other inits is the much less often mentioned shutdown, which (at least more than a year ago, when I last tried a systemd distro) is not just slower, but often completely hangs. I'm not really obsessing over the milliseconds, it's just that I use a hard-drive, and it happens that it takes me more than 3-5 mins to finally boot and be able to log in, and I was just wondering if anything to make it faster is possible,. I mainly just want to get work done faster when I boot, though I do have 36 services, so maybe that explains it. QuoteThe "inappropriate ioctl" is from the "get_geometry" call for a hard disk device; if you have got only one hard disk, then you should take a backup of your important data immediately and do a badblocks search on it , having booted off a live ISO. If all is fine, you need more troubleshooting. I believe this hard drive does have some bad blocks, but they are not increasing. I've been using this for a year or two after seeing the badblocks being a thing via smartctl, but I don't really know if that's the issue. I already do have my data backed up, though.
Re: hdparm issue: "HDIO_GETGEO failed: Inappropriate ioctl for device" Reply #5 – 06 September 2021, 04:24:15 Quote from: MonAaraj – on 06 September 2021, 02:39:00Ah, I see. Then I guess I was just being paranoid about it, is there a chance that error could be not outputted if it really doesn't mean much? It looks like it's saying that something went really wrong IMO. Just test it yourself. You can run simply run "hdparm /dev/whatever" right now and look at the output. On /dev/cdrom, HDIO_GETGEO will fail because a cd/dvd drive has no geometry to speak of (no sectors, heads, etc.). So it just returns nothing there. For a real hard drive, you get the geometry information. In either case, the command is harmless and merely fetches data about the drive. It's up to you to configure it by passing the appropriate arguments in the conf file.Of course, perhaps I should change the script so it's not as confusing. IIRC, I simply copied the defaults from the systemd service file.
Re: hdparm issue: "HDIO_GETGEO failed: Inappropriate ioctl for device" Reply #6 – 17 September 2021, 05:58:51 Sorry I'm late, but thank you very much! I've went with tweaking my services and after cleaning them it manages to start within a good time for my usage now, it was just my system. Thanks again!