LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 08-16-2005, 09:16 PM   #1
j@ckrabbit
LQ Newbie
 
Registered: Aug 2005
Posts: 8

Rep: Reputation: 0
Disk Access from the Command Line in the Debian3.1 Installer


I have recently downloaded and Debian 3.1 and started working through the installation process and have encountered something that is different about the Debian Installer disk than most of the Linux variations that I am familiar with (Redhat Slackware Gentoo Fedora) that is hanging me up somewhat. Basically, the normal hd devices in /dev don't seem to exist. So for example if I boot into the installer in 'expert' mode and then drop into a shell and try to 'fdisk /dev/hda' it is not possible because the device doesn't seem to exist:

Code:
~ # fdisk /dev/hda
Unable to open /dev/hda
I suspect this has something to do with the 'udev' package not being available on the installer but I very rarely deal with linux on this level so I'm not sure. There *is* a device that looks like:

Code:
/dev/ide/host0/bus0/target0/lun0/disk
located in the /dev directory and it appears that the Debian installer manipulates the disk in this manner but I can't seem to run fdisk on this device either. So I am wondering if someone could offer up some clues for accessing the disk directly?
 
Old 08-17-2005, 02:52 PM   #2
towjamb
Member
 
Registered: Aug 2004
Location: Canada
Distribution: Debian
Posts: 87

Rep: Reputation: 15
The installer should detect the ATA drive without udev installed.

Might you have a serial ATA hard drive, which would then become /dev/sda? Or, you may have it plugged into IDE 2 or not have have the jumpers on your drive set correctly, which would make it /dev/hdb, c or d. I'm reaching here.

Try a live CD like MepisLite, which is basically Etch, and see if the drive is picked up in fstab.
 
Old 08-17-2005, 08:49 PM   #3
j@ckrabbit
LQ Newbie
 
Registered: Aug 2005
Posts: 8

Original Poster
Rep: Reputation: 0
Gentoo ; Slackware ; Redhat ; Knoppix all seem to allow direct disk access without these types of headaches.

There are two IDE disks in the system. The plan is to mirror them in a RAID1 set. One criteria I have for using a Linux Distro is that it be able to install directly onto a a software RAID1 mirrored set of IDE disks ; which Debian wasn't able to do in version 3.0 but now the installer is capable of it in version 3.1. This type of "poor mains raid" is what I use in my production servers. I set the mbr of both disk to be bootable and then if one disk dies the system will still boot and retain all data.

Since I'm digressing a little here I'll mention that my ultimate goal is a set of instructions for installing Debian 3.1 onto mirrored disks by bypassing the guided partitioning tool. So I will need to partition the disks, create raid devices and then filesystems to format and install onto. The reason for bypassing the guided partitioning tool is for reproducibility and instructional purposes. Much in the same way the linux from scratch team ( www.linuxfromscratch.org ) often take the long way around in order to offer additional insights and learning. You can see an example of how I have written this up for installing slackware @ http://slackware.hostinghacks.net/install/ which makes extensive use of command line tools such as sfdisk and raidtools instead of the GUI partitioning tool.

So back to the core problem which is that the Debian installer disk seems to fall short of what I would expect of a live cd in terms of granting full access to the disk. It is possible that this is an oversight on the part of the Debian installer dev team but more likely there is simply an expectation of accessing the disk more directly than the way that I am used to. Here are some more clues I have come across:

Here is the output of 'ls -la /proc/ide'

Code:
~ # ls -la /proc/ide
dr-xr-xr-x    4 root     root            0 Jan  3 09:49 .
dr-xr-xr-x   36 root     root            0 Jan  3 06:16 ..
-r--r--r--    1 root     root            0 Jan  3 09:49 drivers
lrwxrwxrwx    1 root     root            8 Jan  3 09:49 hda -> ide0/hda
lrwxrwxrwx    1 root     root            8 Jan  3 09:49 hdc -> ide1/hdc
lrwxrwxrwx    1 root     root            8 Jan  3 09:49 hdd -> ide1/hdd
dr-xr-xr-x    3 root     root            0 Jan  3 09:49 ide0
dr-xr-xr-x    4 root     root            0 Jan  3 09:49 ide1
-r--r--r--    1 root     root            0 Jan  3 09:49 via
As you can see the system does recognize the ide drives.

Another note of interest is that if I use the guided partitioning tool to create a raid device it does so successfully and offers up a choice like follows:

Code:
[x] /dev/ide/host0/bus0/target0/lun0/part3
[x] /dev/ide/host0/bus1/target0/lun0/part3
(note the equivalent partitions on seperate buses)
 
Old 08-17-2005, 09:29 PM   #4
towjamb
Member
 
Registered: Aug 2004
Location: Canada
Distribution: Debian
Posts: 87

Rep: Reputation: 15
Google found this:
Installing Debian with SATA based RAID
 
Old 08-18-2005, 07:37 PM   #5
j@ckrabbit
LQ Newbie
 
Registered: Aug 2005
Posts: 8

Original Poster
Rep: Reputation: 0
That is good stuff. I used to do it that way... install onto a single disk and then mirror. But now the debian installer can install directly onto /dev/md disks.

The kernel seems to know about them and the installer manipulates them quite well ; even going as far as to mount the drives onto a directory labeled '/target'. In fact, I suspect that the installer is just a frontend to the 'mount' 'sfdisk' and 'mdadm' commands that are locate in /sbin on the installer cd. If this is the case then I would simply need to know the commands which are directed a little closer to the hardware level (e.g. sfdisk /dev/ide/host0/bus0/target0/lun0/part3) . If this is the case and '/dev/hda' is just a shortcut to something a little less human readable then what I actually need is to locate this kernel level lingo.

my preference is to use 'sfdisk' from the command line as a partitioner. The installer does seem to do a good job though so I may have to forego this 'sfdisk' fetish. But I do feel as if I am nearing an epiphany if I can just figure this one thing out...
 
Old 08-19-2005, 04:45 PM   #6
j@ckrabbit
LQ Newbie
 
Registered: Aug 2005
Posts: 8

Original Poster
Rep: Reputation: 0
Hitting 'devfs' around google was quite helpful. I think that the final verbage that I am going use will be something along these lines:

Code:
Assuming two IDE disks in a system ; the plan is to mirror them 
in a software RAID1 set.  This type of "poor mains raid" is what I use 
in my production servers.  The mbr of both disk is set to be bootable using 
Lilo with the raid-extra-boot="mbr" option and then if one disk 
dies the system will still boot and retain all data.

My normal preference is to partition from the command line
using 'sfdisk' .  However the debian installer uses "devfs nomenclature" 
for device nodes (e.g. /dev/ide/host0/bus0/target0/lun0/part3)
rather than "standard nomenclature" (e.g. /dev/hda). 
So to successfully edit the partition tables using 'sfdisk' would require
accessing the disk with 'devfs' nomenclature.  This is outside the scope 
of this document.  Hopefully this situation will improve with the next 
generation of the Debian installer.
 
A simple workaround is to use a 'live cd' such as knoppix to partition
the disks before launching the debian installer disk.  Or even better yet
is to use redhats anaconda + a kickstart file which can partition 
without user intervention.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I access metadata from the command line? WilliamMcMath Linux - General 1 11-03-2005 01:04 PM
How to read the disk stats info in the command line ICO SUSE / openSUSE 1 09-20-2005 02:13 AM
Can I access the INTERNET from the command line???? Guvvy Linux - Newbie 4 02-02-2005 09:07 PM
Access Floppy From Command Line Login?.... Stealthy_C Linux - General 1 03-05-2004 01:33 PM
How to mv data from floppy disk to hdd using command line query Linux - Newbie 4 03-14-2003 04:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 12:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration