LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-07-2003, 09:59 AM   #1
Xiangbuilder
Member
 
Registered: Apr 2003
Location: Shandong province China
Distribution: fedora core 1.0
Posts: 206

Rep: Reputation: 30
How to build this distribution?


I want to build a Linux system just by copying the files from existing linux system.
How to do this?
Maybe, you will type many words to answer this question.
So, if you wouldn't like doing this, just ignore.
Sorry for that.
Thank you.
 
Old 09-07-2003, 10:09 AM   #2
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 60
That's all covered in the Linux From Scratch book.

Oops, I didn't read carefully, I thought you wanted to build Linux From Scratch

Last edited by fancypiper; 09-07-2003 at 11:11 AM.
 
Old 09-07-2003, 10:44 AM   #3
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 270Reputation: 270Reputation: 270
Unless your speaking of installing an LFS system, I don't think you can just copy files over to create a whole new system. It would have to be setup the same with the same hardware to make it easy.

Are you trying to just create like a mirror image of one system to put on another?

I'm moving this out of LFS and into Linux - General as it doesn't appear your speaking of LFS, as with LFS you can't copy the files, you have to have an existing system installed and do lots of compiling, etc.
 
Old 09-07-2003, 10:12 PM   #4
Xiangbuilder
Member
 
Registered: Apr 2003
Location: Shandong province China
Distribution: fedora core 1.0
Posts: 206

Original Poster
Rep: Reputation: 30
Thank you.

I don't want to build LFS, because I will spend many times compiling.
Some friends always spends more than twenty hours building it.
I don't like that.

Thank you.
 
Old 09-07-2003, 10:19 PM   #5
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 60
# Clone a distro to another drive or move directories around
Install drive in box (assuming IDE1 slave for examples) and ensure BIOS can detect it. Boot into Linux and login to your user's account. Open an x terminal and partition and format the new drive as you wish
Code:
[fancy@tinwhistle fancy]$ su -
Password: 
[root@tinwhistle root]# fdisk /dev/hdb
Exit with w to write the partition table.

Format the partitions with the chosen filesystems:
mke2fs /dev/hdbX -> ext2
mke2fs -j /dev/hdbX -> ext3
mkswap -> swap
mkreiserfs -> reiserfs
mkfs.xfs -> xfs

Make directories for source and destination mount points. You need these to keep out of an endless loop of copying itsself over and over.
Code:
[root@tinwhistle root]# mkdir /mnt/source
[root@tinwhistle root]# mkdir /mnt/destination
Mount your os partitions that you want to clone on /mnt/source
Mount your partitions on the new drive, making directory entries for your separate partitions (/boot, /home, /var etc.). If you are just copying a directory such as var, just cd to the directory you wish to copy instead of mounting partitions on /mnt/source.

Now, cd to /mnt/source and pipe it over with tar
Code:
[root@tinwhistle root]# cd /mnt/source
[root@tinwhistle source]# tar cf - . | (cd /mnt/destination && tar xBfp -)
Edit /etc/fstab as needed, install the boot loader if you moved a whole distro, and it should work when it is installed in it's final position when configured for the hardware.
 
Old 09-08-2003, 01:06 AM   #6
Xiangbuilder
Member
 
Registered: Apr 2003
Location: Shandong province China
Distribution: fedora core 1.0
Posts: 206

Original Poster
Rep: Reputation: 30
Thank you.
It is a good method to copy the whole existing linux OS.
If I want to build a Linux system as tiny as possible just by copying the files from existing linux system.
How to do this?
I believe that there must be a way to do this, but I can't do.

A Chinese website has explain how to do this, but not clearly.
I try to translate shortly, it maybe is useful to someone, my English is poor:

1.edit /boot/grub/grub.conf
2.create some necessary empty directories: /dev; /proc; /etc; /sbin; /bin; /lib; /mnt; /usr.
3.copy some necessary files from the existing linux OS's directories to the new linux OS's corresponding directories.
/dev:
console、kmem、mem、null、ram、tty*, etc. (I don't like the word "etc" here, my installation was failed maybe just because of it. note that some files such as console can be copyed by the command: cp, a friend told me use the command:
Code:
#cd /;
#tar cf - dev | (cd /NEWLINUX; tar xf -)
)
/etc:
rc.d/*; fstab; inittab; passwd; group; shadow;
/bin and /sbin:
init、getty (mingetty)、login、mount、bash。
/lib;
ld.so (it is to a.out), or ld-linux.so (it is to ELF).

There is a file ld-linux.so.2 in /lib of my existing OS, however, there are no ld.so and ld-linux.so. So I copy /lib/ld-linux.so.2 to /NEWLINUX/lib/.
Finally, I can boot up the new OS and into its partition, however a error message said init mising, try to boot up without init. Maybe I can use some commands to boot up it without init. The website said: "if you don't want boot up the system through init, you can link init to /bin/bash. However, the person ddidn't point out how to make this link, maybe it is very simple in his opinion.

Thank you.

To do this, I should know much more knowledges about operating system than now I know, I am afraid. It is very difficult to me.

Last edited by Xiangbuilder; 09-08-2003 at 01:19 AM.
 
Old 09-14-2003, 09:09 AM   #7
pe2338
Member
 
Registered: Dec 2002
Location: Bucharest,RO
Distribution: debian etch, sarge and sid
Posts: 407

Rep: Reputation: 30
look for /sbin/init in the existing linux.
If you don't like/want to use init (although I would recomend it) make a symlink from /sbin/init to /bin/bash with

ln -s

more info on ln
man ln
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Anjuta - Build Distribution error schmmd Linux - General 1 02-07-2006 04:35 AM
lfs 6.1 build on which linux distribution aneel Linux From Scratch 2 09-21-2005 08:24 AM
How they build a new distribution billybilly Linux - General 1 10-14-2004 12:05 PM
How do i Build my own linux distribution ? CheeseX Linux - Distributions 1 01-31-2004 03:20 AM
Anjuta won't build distribution jpbarto Programming 0 06-26-2003 11:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:55 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