| View previous topic :: View next topic |
| Author |
Message |
fergon
Joined: 06 Feb 2007 Posts: 4
|
Posted: Tue Feb 06, 2007 8:55 pm Post subject: Installing ZeroShell in Hard Disk |
|
|
Hello,
I have accomplished the following steps in order to install ZeroShell in my hard disk. At least it boots, but further probing is necessary.
Let suppose a free partition (e.g. /dev/hda5) of type ext2. We also have the LiveCD iso file (Zeroshell-1.0.beta3.iso). First, we mount this file in some folder:
# mkdir $HOME/zeroshell
# mount -t iso 9660 -o loop Zeroshell-1.0.beta3.iso $HOME/zeroshell
(Of course the mount command must be invoked from the folder that holds the .iso file. Otherwise its complete path must be provided)
Next we copy all the files to the target partition:
# mkdir /media/hda5
# mount -t auto /dev/hda5 /media/hda5
# cd $HOME/zeroshell
# cp -r * /media/hda5
# cd /media/hda5
# umount $HOME/zeroshell
In the 'isolinux' folder there are two compressed filesystem images: 'initrd.gz' and 'rootfs'. The last one contains most of the ZeroShell root file system and it is dumped to a ramdisk when working from the CD. In the next few steps this file system will be copy to the root folder of /dev/hda5:
(from /media/hda5)
# gunzip -c isolinux/rootfs > rootfs.unzip
# mkdir rootfsFolder
# mount -t auto -o loop rootfs.unzip rootfsFolder
Before copy it we need to remove some soft links that otherwise will be broken when booting from /dev/hda5
# cd rootfsFolder
# unlink sbin
# unlink usr
# unlink lib/modules
# ln -s /modules lib/modules
And we also have to modify the fstab table in /media/hda5/etc/fstab (use your favorite text editor). Be careful *not* to edit your host system fstab (which is found in /etc/fstab not in /media/hda5/etc/fstab). The /dev/hda5 must be mounted as root file system and we don't need to mount /cdrom (next you can see the new fstab):
# cat etc/fstab
/dev/hda5 / ext2 defaults 1 1
# /dev/cdrom /cdrom iso9660 ro 0 0
proc /proc proc defaults 0 0
none /sys sysfs defaults 0 0
devpts /dev/pts devpts gid=4,mode=620 0 0
shm /dev/shm tmpfs defaults 0 0
(Note that the cdrom entry is commented)
Now we can copy the contents of rootfsFolder to /media/hda5
# cp -r * ..
and unmount it.
# cd ..
# umount rootfsFolder
Note that 'rootfs.unzip' contain an image of every modification we have done, so if we need to use the original rootfs image we must use the compressed one in the 'isolinux' folder.
The initrd image does not supply device nodes for partitions in the hard disk. We need to modify it and add, at least, a device node for the target partition (/dev/hda5 in our example).
# gunzip -c isolinux/initrd.gz > initrd.unzip
# mkdir initrdFolder
# mount -t auto -o loop initrd.unzip intirdFolder
# cd initrdFolder
# mknod dev/hda5 b 3 5
Of course, we have to invoke mknod with the proper device name and major and minor numbers (see mknod man page and http://www.lanana.org/docs/device-list/ for more details. For partitions in the master device of the primary IDE -hda-, the major number is 3 and the minor one must equals the number of the partition -the number at the end of its name-).
We don't need the linuxrc script in initrd, so we modify it (use again your favorite text editor) like this:
# cat linuxrc
#!/bin/bash
#
# Modified from the original linuxrc (created by Fulvio Ricciardi 16-11-2003)
# 6-feb-2007
#
mount -t proc proc /proc
(I think it is not necessary to leave /proc to be mounted, anyway...)
Now the initrd filesystem must be unmounted and compressed again. For convenience we will put it on to the 'boot' folder, so we do with the kernel image:
# cd ..
# unmount initrdFolder
# gzip -c initrd.unzip > boot/initrd.gz
# cp isolinux/vmlinuz boot/vmlinuz
Now the system is ready! We only have to make it bootable by using our preferred boot loader. I use grub, so I added the following entries in the menu.lst file:
title ZeroShell
root (hd0,4)
kernel /boot/vmlinuz root=/dev/hda5 quiet init=/bin/init ramdisk_size=131072
initrd /boot/initrd.gz
boot
and ZeroShell boots from hard disk. Boot options are copied from the original isolinux.cfg. Further tests must be acomplished in order to ensure that everything works properly, but I hope this helps.
Thanks Fulvio for this wonderful system! _________________ Regards,
Fernando González |
|
| Back to top |
|
 |
fergon
Joined: 06 Feb 2007 Posts: 4
|
Posted: Thu Feb 08, 2007 3:27 pm Post subject: New installation method |
|
|
Hello,
When I posted the installation proccess I had only booted it up and browsed the login page. When I finally tried to login into the system, it never ends the authentication process .
I am really confused: the 'kerbynet' program (in /usr/local/apache2/cgi-bin), which is launched as a cgi script when the user press the login button, seems to start a never-end loop: it begins but it never ends (you can see it with a 'top' command from a shell prompt in the server.)
When the root file system is mounted from as a ram disk (default in the liveCD) kerbynet works without problems, so I have modified the "installation" method in a manner that the root file system still remains in a ram disk. It seems to work (at least kerbynet doesn't hang), but, again, further testing must be accomplished.
In order to install zeroshell in /dev/hda5:
# mkdir $HOME/zeroshell
# mount -t iso 9660 -o loop Zeroshell-1.0.beta3.iso $HOME/zeroshell
# mkdir /media/hda5
# mount -t auto /dev/hda5 /media/hda5
# cd $HOME/zeroshell
# cp -r * /media/hda5
# cd /media/hda5
# umount $HOME/zeroshell
Now we modify the linuxrc script in initrd in order to link /dev/cdrom to /dev/hda5 instead of to the actual CDROM device.
# mkdir initrdFolder
# gunzip -c isolinux/initrd.gz > initrd.unzip
# mount -t auto -o loop initrd.unzip initrdFolder
# cd initrdFolder
# cp linuxrc linuxrc.old
# cat > linuxrc << EOF
> #!/bin/bash
> #
> # linuxrc by Fulvio Ricciardi 16-11-2003
> # Modified by Fernando Gonzalez 7-2-2007
> mount -t proc proc /proc
> if mount -t auto /dev/hda5 /cdrom 2>/dev/null ; then
> echo Success
> echo -n "Loading root filesystem into RAM device... "
> if gzip -dc /cdrom/isolinux/rootfs >/dev/ram2 2>/dev/null ; then
> echo Success
> umount /cdrom
> /sbin/insmod /lib/loop.ko
> mount -o loop /dev/ram2 /cdrom
> cd /cdrom/dev
> ln -s hda5 cdrom
> cd /
> umount /cdrom
> else
> echo Fail
> umount /dev/hda5 > /dev/null
> fi
> else
> echo "Fail"
> fi
>
> EOF
# mknod dev/hda5 b 3 5
# cd ..
# umount initrdFolder
# cp isolinux/initrd.gz initrd.gz.old
# gzip -c initrd.unzip > isolinux/initrd.gz
(I am not sure if it is necessary or not to create the device node.)
And we change fstab in rootfs to mount /dev/cdrom as ext2 instead of iso9660:
# mkdir rootfsFolder
# gunzip -c isolinux/rootfs > rootfs.unzip
# mount -t auto -o loop rootfs.unzip rootfsFolder
# cd rootfsFolder
# cp etc/fstab etc/fstab.old
# cat > etc/fstab << EOF
> /dev/ram2 / ext2 defaults 1 1
> /dev/cdrom /cdrom ext2 ro 0 0
> proc /proc proc defaults 0 0
> none /sys sysfs defaults 0 0
> devpts /dev/pts devpts gid=4,mode=620 0 0
> shm /dev/shm tmpfs defaults 0 0
>
> EOF
# cd ..
# umount rootfsFolder
# cp isolinux/rootfs isolinux/rootfs.old
# gzip -c rootfs.unzip > isolinux/rootfs
Now the system is ready, only rest to make it bootable. With grub, append in /boot/grub/menu.lst
title ZeroShell
root (hd0,4)
kernel /isolinux/vmlinuz quiet root=/dev/ram2 ramdisk_size=131072 init=/bin/init
initrd /isolinux/initrd.gz
boot
-------------------------------------------------------
It must be improved: Although booting from hard disk, the whole root file system is mounted as a ram disk. I think it can be a problem if there is not enough memory installed.
I hope this can be helpful. Any idea about why kerbynet hangs when it the root file system is mounted from a partition in hard disk?  _________________ Regards,
Fernando González |
|
| Back to top |
|
 |
fulvio Site Admin
Joined: 01 Nov 2006 Posts: 997
|
Posted: Mon Feb 12, 2007 4:23 pm Post subject: |
|
|
Try to use cp -rp that preserves the permissions better than cp -r
Take in mind that the kerbynet cgi runs with the apache web server privileges. Hence the /etc/sudo program must have the setuid flag active.
Try if it works after you use the command chmod u+s /etc/sudo
Regards
Fulvio |
|
| Back to top |
|
 |
fergon
Joined: 06 Feb 2007 Posts: 4
|
Posted: Sun Feb 18, 2007 5:56 pm Post subject: It works |
|
|
Thanks Fulvio,
It works well by changing the 'cp -r' in the first post:
**************************************************************
Now we can copy the contents of rootfsFolder to /media/hda5
# cp -r * ..
and unmount it.
**************************************************************
for 'cp -a' when copying the contents of rootfsFolder:
**************************************************************
Now we can copy the contents of rootfsFolder to /media/hda5
# cp -a * ..
and unmount it.
**************************************************************
Regards,
Fernando _________________ Regards,
Fernando González |
|
| Back to top |
|
 |
marcin
Joined: 21 Nov 2006 Posts: 8
|
Posted: Tue Feb 20, 2007 8:26 am Post subject: |
|
|
Thank you for your how-to. I'm at the end of it and i'm a little bit stuck. I have to make it bootable. You suggest to use grub. But ZeroShell doesn't install grub, does it? When i run shell prompt from ZeroShell console, i don't see /boot/grub/menu.lst.... I see directory /mnt/sdb1/boot/grub but there's no menu.lst. I created my own and added what you said to add but after reboot, there's 'No operating system installed'....
How to install grub loader from ZeroShell 'shellprompt'?
Thanx. |
|
| Back to top |
|
 |
fergon
Joined: 06 Feb 2007 Posts: 4
|
Posted: Tue Feb 20, 2007 7:20 pm Post subject: Making the system bootable |
|
|
Hello,
I'm sorry. I forgot to say that I was using a previously installed system (Ubuntu) as a "host" system so I have grub already installed. In order to "install" Zeroshell I booted Ubuntu and followed the steps.
It seems that you have done it from zeroshell 'shellprompt', and that you don't have any other OS in your disk. I suppose you have to obtain grub and install it following the instructions in http://www.gnu.org/software/grub/. I will try it... _________________ Regards,
Fernando González |
|
| Back to top |
|
 |
marcin
Joined: 21 Nov 2006 Posts: 8
|
Posted: Fri Feb 23, 2007 3:23 pm Post subject: |
|
|
Yes, i used clean hard drive (without any OS).
After some time i was able to install ZeroShell (AFAIR there's grub-install somewhere in /usr or /var) but after all i had to switch to IPCOP because VPN available on ZeroShell is different than VPN on IPCOP and i didn't have much time to get know how to connect net-to-net VPN from ZS to Procurve router.
Anyway, ZeroShell is great (with http proxy and scanning for viruses by clamav it will be even more powerful).
Best regards. |
|
| Back to top |
|
 |
Lohuis
Joined: 23 Nov 2008 Posts: 4 Location: UAE
|
Posted: Sun Nov 23, 2008 5:45 am Post subject: Kernel Panic |
|
|
thanks for this way that we can install zeroshell on HDD and change its FS ...
i did it step by step , my HDD part was sda3 instead of hda5 , so i modified some things , also regarding the files editing (CAT ..) i used text editor in ubuntu and replaced all the content with the lines you mention ..
then i tried to boot , a Kernel Panic error occurs :
| Code: | | kernel panic - not syncing : VFS : unable to mount root fs on unknown-block (1,2) |
i dont know exactly what this error means ...
anyhow , is there is another way to make zeroshell FS editable ??? i just want to modify the user interface to add and remove some options ...
waiting for the professionals help  |
|
| Back to top |
|
 |
Howie69
Joined: 26 Dec 2008 Posts: 2
|
Posted: Fri Dec 26, 2008 12:49 am Post subject: Re: Kernel Panic |
|
|
| Lohuis wrote: | thanks for this way that we can install zeroshell on HDD and change its FS ...
i did it step by step , my HDD part was sda3 instead of hda5 , so i modified some things , also regarding the files editing (CAT ..) i used text editor in ubuntu and replaced all the content with the lines you mention ..
then i tried to boot , a Kernel Panic error occurs :
| Code: | | kernel panic - not syncing : VFS : unable to mount root fs on unknown-block (1,2) |
i dont know exactly what this error means ...
anyhow , is there is another way to make zeroshell FS editable ??? i just want to modify the user interface to add and remove some options ...
waiting for the professionals help  |
If you changed everything to sda3 instead of hda5, I bet you forgot to change the root image in the grub entry, this part:
| fergon wrote: |
Now the system is ready, only rest to make it bootable. With grub, append in /boot/grub/menu.lst
title ZeroShell
root (hd0,4)
kernel /isolinux/vmlinuz quiet root=/dev/ram2 ramdisk_size=131072 init=/bin/init
initrd /isolinux/initrd.gz
boot
|
the 'root(hd0,4)' part points do /dev/hda5. If you are using sda3, I believe you would change that to 'root(hd0,2)'. Otherwise the kernel is looking in the wrong place for the root filesystem and will panic.
root(hd0,4) means 'look for root on first hard drive ( hd0 ), partition 5 ( since the bios starts counting at 0 instead of 1, the first partition would be 0, the fifth would be 4).
I hope this helps. I will be attempting to do just this on a system tomorrow. Will let you know how it goes. |
|
| Back to top |
|
 |
Lohuis
Joined: 23 Nov 2008 Posts: 4 Location: UAE
|
Posted: Fri Dec 26, 2008 11:27 am Post subject: |
|
|
thanks for your reply ...
it has been along time since i did that , but i think that changed that also as you said ...
did you succeed with installing it on a hard disk ? |
|
| Back to top |
|
 |
Howie69
Joined: 26 Dec 2008 Posts: 2
|
Posted: Mon Dec 29, 2008 2:02 am Post subject: |
|
|
Not yet. Me and my kids all ended up with the flu, so I haven't been back to work since I posted that yet.
Should be sometime this week. Will be testing the features of the captive portal on livecd first, then attempting to install to HD if all goes well. |
|
| Back to top |
|
 |
Lohuis
Joined: 23 Nov 2008 Posts: 4 Location: UAE
|
Posted: Mon Dec 29, 2008 2:55 pm Post subject: |
|
|
oh ...
i am sorry for that , i hope you and your family pass this soon . |
|
| Back to top |
|
 |
thistleknot
Joined: 26 Nov 2009 Posts: 19
|
Posted: Fri Aug 20, 2010 2:24 pm Post subject: makefs error |
|
|
makefs "filesystem larger than apparent device size"
also my ramdisk got some sort of write error on a particular number.
any ideas? It locked up at the filesystem remark. I got it to boot though! partly
IT WORKED!
btw, I never really troubleshot the makefs, but I realized it was ramdisk related.
I read the second post by the thread starter saying he needed to mount the rootfs on a ramdrive, so I heeded what he said and overlaid those steps over the initial steps, and it worked.
I read the second post and it worked. Of course mine is hda1, but it booted!
One thing to note. Zeroshell doesn't like ext2 (at least in the gui). I would recommend converting everything to ext3.
converting to ext3 worked, but for some reason in the gui, it doesn't see the hosting partition. It does see the backup partition I made (which is an ext2 clone of the first partition). I created a 3rd partition (ext3) to host the profiles, and it sees this as well. |
|
| Back to top |
|
 |
thistleknot
Joined: 26 Nov 2009 Posts: 19
|
Posted: Tue Aug 24, 2010 4:00 pm Post subject: good news and bad news |
|
|
well, I got zeroshell to boot from a hard drive following the instructions on how to make a writeable copy.
I was able to do it without using a ramdrive (and I logged in). I had enough free space to extract apt.bin (which I didn't do just yet); however, on subsequent reboot, it wouldn't boot, got a message about a bunch of files not found in /etc.
Maybe my hd is corrupt. will try again with an ssd flash card I have.
To make matters worse, my profile got corrupt.
So in theory, if I get it up and running I should be able to get those linux headers with apt-bin (cross fingers), and then compile the compat wireless drivers.
btw, the error I got earlier was related to the ramdrive, I made a menu.lst file and verified I typed everything right, and I didn't get the error the second time. |
|
| Back to top |
|
 |
ngwasuma
Joined: 26 Jul 2007 Posts: 10
|
|
| Back to top |
|
 |
xtacy
Joined: 28 Aug 2010 Posts: 20
|
Posted: Mon Aug 30, 2010 9:18 pm Post subject: Re: Kernel Panic |
|
|
while trying to setup my CF with this method...
CF is vfat/fat32 and it couldnt b properly formatted as ext2... dunno why.
1st problem got at
cp -rp * ..
it refuses to copy a bunch of filles and dirs due 2 permissions...
2nd
| fergon wrote: |
Now the system is ready, only rest to make it bootable. With grub, append in /boot/grub/menu.lst
title ZeroShell
root (hd0,4)
kernel /isolinux/vmlinuz quiet root=/dev/ram2 ramdisk_size=131072 init=/bin/init
initrd /isolinux/initrd.gz
boot
| i guess one just need to type grub and type it line by line?
but at line initrd /isolinux/initrd.gz it said "file too big to fit in memory"...
anyway i'm curios if it could work with fat32 fs? |
|
| Back to top |
|
 |
thistleknot
Joined: 26 Nov 2009 Posts: 19
|
Posted: Mon Aug 30, 2010 10:28 pm Post subject: chmod +x = write permissions? |
|
|
don't have executable permission on menu.lst?
i.e. chmod +x /boot/grub/menu.lst
vi /boot/grub/menu.lst
You could also try sudo, but I didn't have to do that.
also try
/bin/cp * -f -r -a -p /destinationFolder
I'm not sure why your getting not fitting into memory, but oh well.
And the post on physdiskwrite, I saw that posted somewhere else on the net before it ended up in the forum (help docs) jumped all over it. It is a nice tool to have, but they also have dd for windows, which I couldn't get to work
http://www.zeroshell.net/listing/physdiskwrite.pdf
But that defeats the purpose anyways. Because it's still a read-only OS essentially. All changes are lost on reboot. |
|
| Back to top |
|
 |
xtacy
Joined: 28 Aug 2010 Posts: 20
|
Posted: Tue Aug 31, 2010 7:03 am Post subject: |
|
|
thanx for reply, i'll try it.
well, what gonna happens if you'll do:
| Quote: | | /dev/cdrom /cdrom ext2 defaults 0 0 | i mean no ro attr for cdrom device?
im Interesting what i should write here if i have fat32 insead of ext2 - vfat or fat32?
and about the physdiskwrite - i did try it but it doesnt write to my CF. It was just dumb time loose with no changes in CF. |
|
| Back to top |
|
 |
ppalias
Joined: 17 Dec 2008 Posts: 1151 Location: Athens, Greece
|
Posted: Tue Aug 31, 2010 12:13 pm Post subject: |
|
|
The default line is | Code: | | /dev/cdrom /cdrom iso9660 ro 0 0 |
I don't think it is possible to install it on fat/fat32. By default when you write the image on the disk, the contents are overwritten and replaced, so you end up with partitions and filesystem contained in the image. |
|
| Back to top |
|
 |
xtacy
Joined: 28 Aug 2010 Posts: 20
|
Posted: Tue Aug 31, 2010 6:24 pm Post subject: |
|
|
| ppalias wrote: | The default line is | Code: | | /dev/cdrom /cdrom iso9660 ro 0 0 |
| but you were change it in your tutor to: | Quote: | | /dev/cdrom /cdrom ext2 ro 0 0 | . So i was guessing you mean than this "cdrom" is really hda5 due to ext2 fs and cause there is no hda5 devices described at all. So you can write just rw instead of ro.
Anyway i got the bootup menu with my fat32 formatted CF using the handy tool Universal USB Installer. but when it tries 2 boot it searches for CDROMs (i c the Probing CDROM msgs) but there is no any connected. So it gives up and hangs with kernel panic bla-bla-bla something about VFS and block(1,2)...
Im working now on initrd.gz and rootfs changes (iso's original used for now). Dunno if it helps me out...
PS It is the 3rd day im trying to install ZS to CF with no result... im not sure about my patience.... |
|
| Back to top |
|
 |
xtacy
Joined: 28 Aug 2010 Posts: 20
|
Posted: Tue Aug 31, 2010 8:47 pm Post subject: |
|
|
well fat32 fs really doesnt supportd by kernel and i got corresponding msg at boot. damn!
What should i do now?
CF refuses any fs except fat32. I did partitions using fdisk and cfdisk with writing changes but fat32 and all the CF's files was accessible after that. So i cant format it in any other fs... no ext2 - no ZS. its a deadlock and it drive me nuts! |
|
| Back to top |
|
 |
xtacy
Joined: 28 Aug 2010 Posts: 20
|
Posted: Tue Aug 31, 2010 11:03 pm Post subject: |
|
|
At last!
The key is CF need to b not partitioned at all just like HDD. But that is the thing which i couldnt do for a long time. Every time i boot linux CF mounts as hdc1(ZS) or sdb1(slax). But with no partitions it would b just hdc or sdb without any digit.
I had a problem with unpartitioning my CF. But somehow under ZS booted from CD and with help of fdisk/cfdisk (4 weird ghost partitions was deleted) i get ability to deletethe main partition but in WinXP! Or i just dont know how2 do it in linux cause fdisk/cfdisk was unable to do it. And i did it in WinXP with admin tools. After that i boot ZS from CD again and my CF was seen by fdisk -l like /dev/hdc (not hdc1 like it was b4) and i did gunzip -c ZeroShell-1.0.beta13-CompactFlash-IDE-USB-SATA-1GB.img.gz>/dev/hdc from usb-stick and tada! it works now!
And the same with HDD - before boot any live linux and doing anything like dd or gupzip>/dev/hdd you must kill all the partitions on this HDD. But with HDDs its much easier 2do. Even with admin tools in WinXP or with any partitioning soft.
Yes, linux is free but it takes a lot of your time... |
|
| Back to top |
|
 |
bumbakashe
Joined: 24 Apr 2010 Posts: 4
|
|
| Back to top |
|
 |
kostis
Joined: 16 May 2012 Posts: 2
|
Posted: Wed May 16, 2012 1:12 pm Post subject: kernel panic |
|
|
If you are experiencing the "kernel panic" message and you 're using a SATA hard disk, try to put the SATA operation in Legacy mode (disable RAID) from the boot menu (hit F2 while booting). This solved all my problems!
bumbakashe's solution didn't work for me. Try the instructions at: How to install ZeroShell on Hard Disk
Regards,
/kostis |
|
| Back to top |
|
 |
ndipit
Joined: 28 Jan 2009 Posts: 7
|
Posted: Fri Aug 03, 2012 1:10 pm Post subject: |
|
|
I've tried to install ZS2.0RC1 to hdd using instruction in 1st post.
But I couldn't mount ungzipped initrd:
| Code: | #mount -t auto -o loop initrd.unzip initrd.folder
#mount: you should specify the filesystem type |
When i specify ext2 or ext3 fs manually it says "wrong fs type" |
|
| Back to top |
|
 |
Alderon
Joined: 23 Jun 2011 Posts: 19
|
Posted: Fri Aug 10, 2012 4:20 pm Post subject: |
|
|
| It seems that ZS2RC1 doesn`t recognize FAT32 and NTFS filesystems. Try to boot from zs1b16 CD and it works. I installed 2RC1 this way successfully. |
|
| Back to top |
|
 |
ndipit
Joined: 28 Jan 2009 Posts: 7
|
Posted: Tue Aug 28, 2012 9:54 am Post subject: |
|
|
Hello all. Here my way to install ZS2.0 on HDD. Root folder is located on Hdd
Boot from your favorite liveCD linux (I've used knoppix 6.7) and execute the next steps:
- Install ZS2.0 in the usual way, as described here or on http://www.zeroshell.net/eng/documentation/
Then you must delete 2nd and 3rd partitions (all except 1st boot partition) and create your own partitions (ext3 and ext4 fs are supported)
- Create tmp folders:
| Code: | mkdir sda1
mkdir sda2
mkdir usb
mkdir iso
mkdir rootfs.dir
mkdir initrd.dir |
and mount partitions to it:
in my case HDD was /dev/sda, usb flashdrive - /dev/sdb and ZS2.0RC1 livecd iso image filename is ZeroShell-2.0.RC1.iso. You can find out flashdrive device name using dmesg or fdisk -l commands
| Code: | mount /dev/sda1 sda1
mount /dev/sda2 sda2
mount /dev/sdb1 usb
mount -o loop usb/ZeroShell-2.0.RC1.iso iso |
Copy all files and directories from previously mounted iso image to sda2:
| Code: | copy -arp iso/* sda2
rm -f sda2/isolinux |
Unpacking rootfs to hdd:
| Code: | gunzip -c iso/isolinux/rootfs > rootfs
mount -o loop rootfs rootfs.dir ##mount unpacked rootfs ext2 image
cd rootfs.dir
find . -maxdepth 1 -type l -delete ##Deleting softlinks
cp -arp ./* ../sda2
cd ../
|
Also we need to edit sda2/etc/fstab:
| Code: | /dev/sda2 / ext3 defaults 1 1
/dev/sda1 /boot ext2 defaults,ro 0 0
proc /proc proc defaults 0 0
none /sys sysfs remount 0 0
devpts /dev/pts devpts gid=4,mode=620 0 0
shm /dev/shm tmpfs defaults 0 0
usbfs /proc/bus/usb usbfs defaults 0 0 |
modification of initrd.img
| Code: | gunzip -c sda1/initrd.img > initrd.dir/initrd
cd initrd.dir
cpio -id < initrd |
Edit initrd.dir/init script (I wrote only changed strings here):
| Code: | ## if [ "$root" = ISO ] ; then
# echo "Mounting ISO image ..."
# mkdir /cdrom
# if mount "$device" /cdrom 2>/dev/null ; then
# echo -n "Loading root filesystem into RAM device... "
# if gzip -dc /cdrom/i#solinux/rootfs >/dev/ram2 2>/dev/null ; then
# echo Success
# umount /cdrom
# #/sbin/insmod /lib/loop.ko
mount $device /.root
cd /.root/dev
ln -sf $device cdrom
cd /
mount /.root/dev/cdrom /.root/cdrom 2>/dev/null
sleep 3
echo "Successfully mounted device $device"
#umount /cdrom
# else
# echo "Wrong ISO filesystem found"
# umount $device > /dev/null
# while true ; do sleep 10000 ; done
# fi
# else
# echo "Failed to mount the Live CD"
# while true ; do sleep 10000 ; done
# fi
# else
# if ! mount -n -t "$rootfstype" -o "$rootflags" "$device" /.root ; then
# no_mount $device
# cat /proc/partitions
# while true ; do sleep 10000 ; done
# else
# echo "Successfully mounted device $device"
# fi
# fi |
pack new initrd and replace the original with it:
| Code: | rm -f initrd
find -print | cpio -o -H newc | gzip -c9 > ../sda1/initrd.img |
That`s all. Reboot and try ti boot from hdd |
|
| Back to top |
|
 |
ndipit
Joined: 28 Jan 2009 Posts: 7
|
Posted: Tue Aug 28, 2012 10:11 am Post subject: |
|
|
After all described in the previous post I`ve successfully logined to web interface/
But there were some moments I want to clarify to:
1. When booting:
| Code: | | mount: according to mtab, /dev/sda2 is already mounted on / |
When I commented out "/dev/sda2 / ext3 defaults 1 1 " in /etc/fstab - the same |
|
| Back to top |
|
 |
|