hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Hosting Security and Technology : Disk Access from the Command Line in the Debian3.1 Installer
Reply

Hosting Security and Technology Configuring and optimizing web hosting servers and operating systems, developing administration scripts, building servers, protecting against hackers, and general security (SSL certificates, etc.)
Forum Jump

Disk Access from the Command Line in the Debian3.1 Installer

Reply Post New Thread In Hosting Security and Technology Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 08-16-2005, 10:26 PM
j@ckrabbit j@ckrabbit is offline
Junior Guru Wannabe
 
Join Date: Jun 2004
Location: SF, CA
Posts: 79

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?

__________________
http://hostinghacks.net

Reply With Quote


Sponsored Links
  #2  
Old 08-17-2005, 01:31 AM
tamasrepus tamasrepus is offline
Web Hosting Master
 
Join Date: Dec 2004
Location: New York City, NY, USA
Posts: 735
Are you sure the drivers for your hard disk controllers have been loaded?

__________________
Samat Jain | Rhombic Networks, LLC - Partner, CTO

Reply With Quote
  #3  
Old 08-17-2005, 07:08 AM
deuce868 deuce868 is offline
Junior Guru
 
Join Date: Jan 2003
Location: MI
Posts: 229
Exactly, it doesn't seem like the drive is there. Are you sure it's hda? Maybe sda? or hdb? Is the drive on a controller like a pci card?

Reply With Quote
Sponsored Links
  #4  
Old 08-17-2005, 08:37 AM
Criminal#58369 Criminal#58369 is offline
Web Hosting Master
 
Join Date: Jul 2004
Posts: 928

Reply With Quote
  #5  
Old 08-17-2005, 09:37 PM
j@ckrabbit j@ckrabbit is offline
Junior Guru Wannabe
 
Join Date: Jun 2004
Location: SF, CA
Posts: 79
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)

__________________
http://hostinghacks.net

Reply With Quote
  #6  
Old 08-17-2005, 09:44 PM
j@ckrabbit j@ckrabbit is offline
Junior Guru Wannabe
 
Join Date: Jun 2004
Location: SF, CA
Posts: 79
Quote:
Originally posted by Criminal#58369
Lol funny seen ur post here also
Good eye there! I have started a writeup for installing VHCS on Debian and that is directly where this information will be going so I thought I would post the question up at eh VHCS forum also.

In reality I probably should track down some list populated by the Debian development team since this question seems like it may be more about the design choices they have made for the installer disk than my lack of knowledge at the linux hardware level. Gentoo ; Slackware ; Redhat ; Knoppix all seem to allow direct disk access without these types of headaches.

__________________
http://hostinghacks.net

Reply With Quote
  #7  
Old 08-17-2005, 10:26 PM
deuce868 deuce868 is offline
Junior Guru
 
Join Date: Jan 2003
Location: MI
Posts: 229
You could try the tclug mailing list. There are some really good Debian guys from U of MN on that list that could probably help. I've not setup softwre raid before so I've always used the installer setup.

Reply With Quote
  #8  
Old 08-18-2005, 11:23 AM
tamasrepus tamasrepus is offline
Web Hosting Master
 
Join Date: Dec 2004
Location: New York City, NY, USA
Posts: 735
You're right--the Debian installer CD is *not* a LiveCD. In fact the netinstall Debian CD I last used did not even have a rescue mode...

I'm not sure why you want to bypass the installer... I've setup a Linux software RAID1 setup along with LVM2 with no problems, all within the installer. Don't use the guided partitioner, use the"Manually set up partitions" option.

Since you're using the installer CD differently than it was intended, I'm not sure how much help you'll get from "official" Debian support circles. Maybe you want to look at "Debian From Scratch."

__________________
Samat Jain | Rhombic Networks, LLC - Partner, CTO

Reply With Quote
  #9  
Old 08-18-2005, 08:22 PM
j@ckrabbit j@ckrabbit is offline
Junior Guru Wannabe
 
Join Date: Jun 2004
Location: SF, CA
Posts: 79
Quote:
Originally posted by deuce868
You could try the tclug mailing list. There are some really good Debian guys from U of MN on that list that could probably help. I've not setup softwre raid before so I've always used the installer setup.
Thanks for the tipoff. I think at this point I do need to locate some hardware level gurus so I'll head out and track down some on an email list. tclug sounds as good as any place to start...

__________________
http://hostinghacks.net

Reply With Quote
  #10  
Old 08-18-2005, 08:33 PM
j@ckrabbit j@ckrabbit is offline
Junior Guru Wannabe
 
Join Date: Jun 2004
Location: SF, CA
Posts: 79
Quote:
Originally posted by tamasrepus
You're right--the Debian installer CD is *not* a LiveCD. In fact the netinstall Debian CD I last used did not even have a rescue mode...
If you type "expert" at the boot prompt it will drop you into a shell and also mount the target disks into a directory '/target' so you might be able to manipulate the files as if it were a rescue disk. In general the Debian 3.1 installer seems fully stacked except for this "minor" isue of not having disk access.

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 '/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.

Quote:
I'm not sure why you want to bypass the installer... I've setup a Linux software RAID1 setup along with LVM2 with no problems, all within the installer. Don't use the guided partitioner, use the"Manually set up partitions" option.
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...

__________________
http://hostinghacks.net

Reply With Quote
  #11  
Old 08-18-2005, 08:42 PM
deuce868 deuce868 is offline
Junior Guru
 
Join Date: Jan 2003
Location: MI
Posts: 229
Quote:
Originally posted by j@ckrabbit
Thanks for the tipoff. I think at this point I do need to locate some hardware level gurus so I'll head out and track down some on an email list. tclug sounds as good as any place to start...
http://www.mn-linux.org/

Reply With Quote
  #12  
Old 08-18-2005, 10:42 PM
tamasrepus tamasrepus is offline
Web Hosting Master
 
Join Date: Dec 2004
Location: New York City, NY, USA
Posts: 735
Quote:
Originally posted by j@ckrabbit
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 '/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.
Those kind of device names are used by devfs. devfs then creates symlinks (like /dev/hda) to the appropriate entries, which it hasn't apparently in the case of the Debian installer. You may want to check if that is in use by the Debian installer CD, because I don't see those types of devices used on my Debian system.

__________________
Samat Jain | Rhombic Networks, LLC - Partner, CTO

Reply With Quote
  #13  
Old 08-19-2005, 05:42 PM
j@ckrabbit j@ckrabbit is offline
Junior Guru Wannabe
 
Join Date: Jun 2004
Location: SF, CA
Posts: 79
Thanks for that info. Hitting 'devfs' around google was actually 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.

__________________
http://hostinghacks.net

Reply With Quote
  #14  
Old 08-19-2005, 05:59 PM
tamasrepus tamasrepus is offline
Web Hosting Master
 
Join Date: Dec 2004
Location: New York City, NY, USA
Posts: 735
If you're insisting on bypassing the Debian installer, I'd suggest trying Debian from Scratch:

http://people.debian.org/~jgoerzen/dfs/html/

You've *significantly* more control over the Debian install process. I've seen it compared to Gentoo (sans the compiling).

Bar that, you can use a real live CD and bootstrap Debian via a chroot (see the Debian installation manual for details). The idea with this method is you boot with a live CD, prepare your disks, setup RAID or LVM, create filesystems, mount them, untar the Debian bootstrapping distribution (which sets up a basic fileystem, /dev entries, etc), chroot into that, and setup your system till it can boot by itself. I'd recommend doing this personally, as it is what I've done when the Debian installer does not cut it.

__________________
Samat Jain | Rhombic Networks, LLC - Partner, CTO

Reply With Quote
  #15  
Old 08-22-2005, 05:26 PM
j@ckrabbit j@ckrabbit is offline
Junior Guru Wannabe
 
Join Date: Jun 2004
Location: SF, CA
Posts: 79
Quote:
Originally posted by tamasrepus
http://people.debian.org/~jgoerzen/dfs/html/
This looks like an excellent product.

I downloaded and installed this over the weekend. Something funny though is that it won't let me change the root password. And I can't log into ssh without changing the password first. Since my servers are kept in a closet with standing room only I like to get into an ssh backdoor to do the heavy lifting.

I've also encountered another problem with the Debian Sarge installer which is that LILO is the preferred bootloader for raid'ed disks (it can duplicate two bootable mbr records on separate disks) but I'm encountering problems when installing LILO to /dev/md disks during the Sarge installation process. It seems to fail when it comes time to mark the root partition as 'active'. It looks like the best workaround for the time being is to install grub during the installation and then fix LILO after booting into the newly installed system.

__________________
http://hostinghacks.net

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
Web Host WireNine Launches Line of VPS Plans, Company Blog Web Hosting News 2012-10-26 11:55:26
Web Host Rackspace Adds FreeBSD 9, CentOS 6.3 Support to Cloud Servers Web Hosting News 2012-07-30 12:47:10
Web Host A2 Hosting Launches Customizable VPS Hosting Plans Web Hosting News 2012-06-07 15:11:57
Hosting Automation Software Provider 1H.com Adds Debian Support Web Hosting News 2011-11-15 21:53:57
Softaculous Adds 17 New Apps to Auto Installer Library Web Hosting News 2011-09-12 17:51:10


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

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

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?