Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Is Live Linux on Hard Disk Possible ?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
zuterus
n00b
n00b


Joined: 11 Sep 2005
Posts: 5

PostPosted: Sun Oct 08, 2006 11:34 pm    Post subject: Is Live Linux on Hard Disk Possible ? Reply with quote

Like LiveCD linux distros, is it possible to have a linux installation on a hard disk ( an external hard disk especially) which can autodetect hardware and also can be used as a normal installation ( ex. install new programs )?
I know the Gentoo LiveUSB but it has limited abilities.

LiveHD would be great since i work at office and home with different machines, synchronizing the files and installed systems take a lot of effort. ( I hate laptops :twisted: )
Back to top
View user's profile Send private message
desultory
Bodhisattva
Bodhisattva


Joined: 04 Nov 2005
Posts: 9410

PostPosted: Mon Oct 09, 2006 4:06 am    Post subject: Re: Is Live Linux on Hard Disk Possible ? Reply with quote

zuterus wrote:
Like LiveCD linux distros, is it possible to have a linux installation on a hard disk ( an external hard disk especially) which can autodetect hardware and also can be used as a normal installation ( ex. install new programs )?

If it can be done on a CD, why would it not be at least as readily accomplished with a writeable media of similar or larger capacity?

If you want to use a Gentoo based system for this project sys-apps/hwinfo will be a package you will probably want (need would be a slight overstatement).

If you just want it to work with minimal effort and do not really care what distribution it is based on look into Knoppix.
Back to top
View user's profile Send private message
zuterus
n00b
n00b


Joined: 11 Sep 2005
Posts: 5

PostPosted: Mon Oct 09, 2006 10:11 pm    Post subject: Reply with quote

Thanks desultory, hwinfo can be a start point. i agree with you, it should be possible. Like LiveCDs a kernel compiled with all drivers as modules and startup scripts that can detect hardware then loads related modules may be enough. Since i am not a linux expert may assumptions may be insufficient or wrong.
I am working on that idea, any help is welcome :wink:
Back to top
View user's profile Send private message
tobr
Guru
Guru


Joined: 29 May 2006
Posts: 330

PostPosted: Mon Oct 09, 2006 11:22 pm    Post subject: Reply with quote

If you don't care if it's gentoo or not, you could have a look at knoppix (which is a great debian-based livecd, which can be installed to HD though I never tried). (K)Ubuntu's install cd is also a live cd, although I don't know if they have a good hardware detection. Gentoo is not really an "autodetect-distro", so you would have to do it all by yourself, which kind of defeats the purpose of autodetection in your case (namely to make your life easier). http://kanotix.com/ is another one which could fit your purpose (and which can be installed to hd). But it's all debian ;-)

Just read the bit about the external hard disk: Try to find a distro which boots from usb-stick and put it on your external hd. It should be the same, if your bios supports booting from the external hd.
Back to top
View user's profile Send private message
desultory
Bodhisattva
Bodhisattva


Joined: 04 Nov 2005
Posts: 9410

PostPosted: Mon Oct 09, 2006 11:38 pm    Post subject: Reply with quote

If you do want to have the system be Gentoo based, you can still use Knoppix as a guide.
Back to top
View user's profile Send private message
zuterus
n00b
n00b


Joined: 11 Sep 2005
Posts: 5

PostPosted: Thu Mar 22, 2007 3:17 pm    Post subject: Reply with quote

I know it's a bit late reply but, by the time i worked for the idea. And i managed to configure a gentoo installation on a usb hard disk :) I've been using this for nearly 5 months and tested with different machines and no problem had come up.

So this is the HOWTO :

1- install gentoo on an usb harddisk as normal except grub installation. Don't install GRUB.

2- for kernel configuration compile most of the drivers as modules (more drivers means better portability :D ), but usb support must be embedded into kernel (it is obvious ;) ) You can use genkernell as i did, the gentoo way.
Hint: Don't compile sata and scsi drivers into kernel so the usb disk will be /dev/sda

3- For booting the system use ISOLINUX.
( For isolinux i followed this guide: isolinux howto )
Code:
emerge sys-boot/syslinux

make a directory name it bootcd :
Code:
cp /usr/lib/syslinux/isolinux.bin bootcd/isolinux.bin

copy kernel into bootcd directory :
Code:
cp /media/sda1/boot/vmlinuz-2.6.15-19-386 bootcd/linux

copy initrd :
Code:
cp /media/sda1/boot/initrd.img-2.6.15-1 bootcd/initrd.img

create a file named isolinux.cfg in bootcd directory and in that file write this :
Code:
DEFAULT linux initrd=initrd.img ro root=(your-root-dev)

for your installed system's root device, write the partition such as /dev/sda1 (if you compiled sata and scsi support as modules your usb disk device, with a high probability, will be /dev/sda as i mentioned above)

Then create the cd image :
Code:
mkisofs -o bootcd.iso -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -J -hide-rr-moved -R bootcd/

write bootcd.iso to a blank cd and boot.

Portability tips :
- Don't define SOUND_CARDS or VIDEO_CARDS so all these drivers wiil be available by alsa and xorg
- use knoppix scripts for creating xorg.conf files for different machines:
Code:
emerge mkxf86config hwsetup

for creating xorg.conf:
Code:
hwsetup -p
mkxf86config


- for every machine with different sound cards, only once run alsaconf. Alsa remembers the cards ;)
- mostly you don't need manual module loading for device drivers. udev should do it's job.
- for every different ethernet card the eth device number will be different so symbolic linking to net.eth0 will be a solution to this. I don't know a better solution maybe someone will show that.
Code:
ln -s /etc/init.d/net.eth0 /etc/init.d/net.eth1

you can make it ready for 10 different ethernet cards eth[1-10]
And you don't need to add net.eth0 to default runlevel. When eth device is found the related script will be run.
- If after booting with cd your kernel will halt and says something like root device is not available you can pass there the root device and try these: /dev/sda1 , /dev/sdb1, /dev/sdc1 ...

So that's it. Give it a try.
Back to top
View user's profile Send private message
zuterus
n00b
n00b


Joined: 11 Sep 2005
Posts: 5

PostPosted: Thu Mar 22, 2007 3:25 pm    Post subject: Reply with quote

I forgot to mention that; again for portability you should build your system for i686 or i386. Modify make.conf :
Code:
CFLAGS="-O2 -march=i686 -pipe"
Back to top
View user's profile Send private message
thedangerouscrew
Tux's lil' helper
Tux's lil' helper


Joined: 03 Nov 2004
Posts: 110

PostPosted: Thu Mar 22, 2007 9:06 pm    Post subject: Reply with quote

Simple answer is yes.

Have you checked out slax? http://slax.org
They have a forum and this question has been ask 100 times before. The live cd use to have
an option to install to the hard drive.
Back to top
View user's profile Send private message
tipp98
Tux's lil' helper
Tux's lil' helper


Joined: 28 Jan 2007
Posts: 113

PostPosted: Sat Nov 10, 2007 6:58 pm    Post subject: Reply with quote

zuterus wrote:

- for every different ethernet card the eth device number will be different so symbolic linking to net.eth0 will be a solution to this. I don't know a better solution maybe someone will show that.

This little "feature" drove me bonkers. Just got to your /etc/udev/rules.d and rename or delete the persistent-net-generator file.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum