Networkspace layerd filesystem

Post Reply
Yagi
Posts: 9
Joined: Tue Nov 15, 2011 2:55 pm

Networkspace layerd filesystem

Post by Yagi » Tue Nov 15, 2011 4:03 pm

After playing with my NS2 for a while i found this wonderfull forum and after reading a lot i must admit
that there are some very clever people overhere :D
Maybe someone can give me a hint/answer on the following.

I already stripped/cleaned and changed a lot on my NS2 and everything works fine for me, but i have
some trouble understanding this layerd file system on the NS2, what i want is to put everything on one/two partition(s)
and use it as a small Linux box.

What i understand (i think) is that the bootloader starts the kernel which is on SDA6, and that the kernel starts
the root file system which is on SDA7, after this the layerd file system is build using SDA8 and SDA9.
On SDA8 is the 'default' system which give the possibility to make a factory reset, on SDA9 are the files that
are different from the files on SDA8 or are newer.

My idea is to put all the files from SDA8 on SDA7 and after that overwrite the ones that are different from SDA9.
Will this work? or do i have to change something more? (i'm not a Linux expert)

Offcourse i have to make a bigger SDA7 partition and no longer need SDA8/SDA9 and SDA10

Maybe someone can give me some hints on how to do this.

Greetings Yagi

Mijzelf
Posts: 6199
Joined: Mon Jun 16, 2008 10:45 am

Re: Networkspace layerd filesystem

Post by Mijzelf » Wed Nov 16, 2011 4:01 pm

It should work, but why would you do it? It will save some space but you will loose the possibility to easily revert stupid mistakes.

Yagi
Posts: 9
Joined: Tue Nov 15, 2011 2:55 pm

Re: Networkspace layerd filesystem

Post by Yagi » Thu Nov 17, 2011 3:53 pm

Mijzelf wrote:It should work, but why would you do it? It will save some space but you will loose the possibility to easily revert stupid mistakes.
Thanks for the reply, i want to do it to get some 'overview' of the whole system, SDA8 is read only with files on it i will never use, so i want to cleanup this.
on SDA9 are the differences if i list a directory on SDA9 some files are from SDA9 some files are from SDA8 (maybe it's me but this confuses me),
and i want to do it for backup purposes, i dump my partitions every now and then, SDA6 will never change (i still use kernel 2.6.22.18) so for backup i only
have to do SDA7.

And i want to do it to learn myself something more about Linux on embedded systems.

Question is, can i simply copy the files as i wrote earlier? or do i have to make some changes in the mounts or other things?, and if i want to update the kernel
can i simply replace the image on SDA6 (one from Lacie offcourse) or is this to simple?

Greetings Yagi

Mijzelf
Posts: 6199
Joined: Mon Jun 16, 2008 10:45 am

Re: Networkspace layerd filesystem

Post by Mijzelf » Thu Nov 17, 2011 4:25 pm

The kernel commandline is

Code: Select all

console=ttyS0,115200 root=/dev/sda7 ro reset=0 productType=ASTON_KW
So the kernel will use sda7 as rootfs. No init program is supplied, so the kernel will use the default, sda7/sbin/init. This happens to be a script, and if you read it, you'll see the only thing it does is creating the unionfs of sda8 and sda9, and then switch root:

Code: Select all

    # 5. New Switch to the new RootFS
    #===========================================================================
    cd $union_base
    mkdir -p $oldroot
    pivot_root . $oldroot
	<snip>
    #===========================================================================
    # 7. Execute init from the new RootFS
    #===========================================================================
    exec /sbin/init < /dev/console > /dev/console 2>&1
So yes, you can just copy sda8 to sda7. (It won't fit, but that's no problem, I suppose). There is one small problem, sda7 is mounted ro (see commandline) while the system on sda8 expects a writable rootfs. Fortunately there is an easy work-around. sda8/sbin/init is a symlink to initng, which is the 'actual init'. So you can exchange sda8/sbin/init by a script:

Code: Select all

#!/bin/sh
mount -o remount,rw /dev/sda7 /
exec /sbin/initng
Make sure the script is executable. I *think* this will work (but I never tried).
and if i want to update the kernel can i simply replace the image on SDA6 (one from Lacie offcourse) or is this to simple?
If Lacie will ever update the kernel (don't hold your breath) you'll have to write the uImage in sda6, *and* copy /lib/modules/<kernel-version> and it's contents to your sda7.
(BTW, the Networkspace2 is supported by the Vanilla kernel, so you could compile your own.)

fvdw
Posts: 777
Joined: Wed Mar 18, 2009 11:13 pm

Re: Networkspace layerd filesystem

Post by fvdw » Thu Nov 17, 2011 7:29 pm

Mijzelf wrote: ...
(BTW, the Networkspace2 is supported by the Vanilla kernel, so you could compile your own.)
if it is a nwsp2 "classic' the nwsp2 "lite" version isn't supported (yet) ;)

Yagi
Posts: 9
Joined: Tue Nov 15, 2011 2:55 pm

Re: Networkspace layerd filesystem

Post by Yagi » Fri Nov 18, 2011 1:02 pm

@mijzelf, Thanks again for the info, i'm going to try this, this evening and see if i can get this to work.

Earlier i did look at /sbin/init on SDA7 but with my basic knowledge of Linux i had no clue of what was going on.
all i knew/understand that it was something the same as the old autoexec.bat in DOS
pa. I thought that $union_base was a system variable, but now i see it's made in libunionfs, i think i took
it much to difficult. :mrgreen:
fvdw wrote:
Mijzelf wrote: ...
(BTW, the Networkspace2 is supported by the Vanilla kernel, so you could compile your own.)
if it is a nwsp2 "classic' the nwsp2 "lite" version isn't supported (yet) ;)
I'm a lucky man, all my NS2's are the classic version, so maybe as a Linux lesson i can try to compile this
kernel, or use the one from fvdw :mrgreen:
And i really thought that Lacie would update there kernel with newer firmware releases, but even the latest
version 2.1.2 still uses 2.6.22.18

Greetings Yagi

Yagi
Posts: 9
Joined: Tue Nov 15, 2011 2:55 pm

Re: Networkspace layerd filesystem

Post by Yagi » Sat Nov 19, 2011 7:25 pm

Ok, some progress :mrgreen:

Everything is now on SDA7 and the NS2 boots and i have SSH access, so far so good
but not all is working the way it should.
First thing i forgot was that in fstab is an entry to mount SDA7 as read only, when i
comment it out things gone a lot better, but still not the way as my other NS2 where
i borrowed the partition dumps from.

current fstab

Code: Select all

# Swap partition entry 
/dev/sda5	swap	swap	defaults	0 0

# Mount the ROOT filesystem from the hard drive
#/dev/sda7	/	ext3	defaults,ro	1 1	

# Mount the virtual proc filesystem
none		/proc	proc	defaults	0 0

#UserData
/dev/sda2	/mnt/bigdisk			xfs	defaults,rw	1 2
my current partitions

Code: Select all

[root@FRXNAS ~]# cat /proc/partitions
major minor  #blocks  name

   8     0  156290904 sda
   8     1          1 sda1
   8     2  154280227 sda2
   8     5     256977 sda5
   8     6       8001 sda6
   8     7    1743021 sda7
  31     0        512 mtdblock0
[root@FRXNAS ~]# 
It's my 160Gb test HDU :mrgreen:

Even a df looks fine, it works without SDA8/SDA9/SDA10 :D

Code: Select all

[root@FRXNAS ~]# df -h
Filesystem                Size      Used Available Use% Mounted on
rootfs                    1.6G    413.8M      1.1G  26% /
/dev/sda7                 1.6G    413.8M      1.1G  26% /
udev                     10.0M     40.0k     10.0M   0% /dev
/dev/sda2               147.1G    172.0k    147.1G   0% /mnt/bigdisk
[root@FRXNAS ~]#
but when i look at my default.runlevel

Code: Select all

initial
dbus
udev
hald
clock
dhcdbd
logrotate
syslogd
klogd
swap
modules
mountfs
mountuserfs
raid
usb
hostname
NetworkManager
getty/1
sshd
cron
#thumbd
#Vanaf hier eigen proggies
ledje
http
proftpd
samba
pm
ntpd
#nzbget
pow_but
and when i look what's really executed...

Code: Select all

[root@FRXNAS ~]# ps
  PID USER       VSZ STAT COMMAND
    1 root      3188 S    initng [runlevel/default]
    2 root         0 SW<  [kthreadd]
    3 root         0 SWN  [ksoftirqd/0]
    4 root         0 SW<  [events/0]
    5 root         0 SW<  [khelper]
   34 root         0 SW<  [kblockd/0]
   55 root         0 SW<  [input-watchdog]
   65 root         0 SW   [pdflush]
   66 root         0 SW   [pdflush]
   67 root         0 SW<  [kswapd0]
   68 root         0 SW<  [aio/0]
   69 root         0 SW<  [unionfs_siod/0]
  186 root         0 SW<  [scsi_eh_0]
  187 root         0 SW<  [scsi_eh_1]
  202 root         0 SW<  [mtdblockd]
  309 root         0 SW<  [kjournald]
  323 root      2988 S    watch -n3600 date >> /var/log/test_mem.log;python /usr/sbin/ps_mem >> /var/log/test_mem.log 2>/dev/null 
  324 root      2988 S    watch -n3600 date >> /var/log/ps_mem.log; ps >> /var/log/ps_mem.log 2>/dev/null 
  359 root         0 SW<  [xfslogd/0]
  360 root         0 SW<  [xfsdatad/0]
  366 root         0 SW<  [khubd]
  369 root      1740 S <  /sbin/udevd --daemon 
  613 root      2988 S    /sbin/getty 115200 ttyS0 
  626 root         0 SW<  [xfsbufd]
  627 root         0 SW<  [xfssyncd]
  648 root      2484 S    /bin/bash /sbin/smart_spindown 
  682 root      1688 S    /usr/sbin/syslogd -n -m 0 
  684 root      2592 S    /usr/sbin/klogd -n -c 1 
  685 root      1688 S    /usr/sbin/cron 
  686 messageb  2332 S    /usr/bin/dbus-daemon --system --fork 
  687 root      5820 S    /usr/sbin/hald --daemon=no --retain-privileges 
  690 root      1908 S    /sbin/dhcdbd --system 
  695 root      4104 S    hald-runner 
  721 root      4200 S    hald-addon-input: Listening on /dev/input/event0
  722 root      4196 S    /usr/libexec/hald-addon-leds 
  729 root     13980 S    /usr/sbin/NetworkManager 
  733 root     14980 S    /usr/sbin/smbd -F -s /etc/samba/smb.conf 
  734 root      9016 S    /usr/sbin/nmbd -F 
  735 root     11900 S    /usr/sbin/winbindd -F 
  736 root      8724 S    /usr/sbin/ntpd -sd 
  737 root     10656 S    /usr/bin/python -OO /opt/bin/pow_but.py 
  741 root      1692 S    /usr/sbin/ntpd -sd 
  745 root      9600 S    proftpd: (accepting connections)
  749 root      4136 S    /usr/sbin/sshd 
  753 root     12136 S    /usr/sbin/winbindd -F 
  756 root     11980 S    /usr/sbin/winbindd -F 
  758 root     11976 S    /usr/sbin/winbindd -F 
  762 root     14980 S    /usr/sbin/smbd -F -s /etc/samba/smb.conf 
  837 root     11920 R    sshd: root@ttyp0  
  841 root      2540 S    -sh 
 1700 root      2852 S    /bin/sleep 30 
 1703 root      3060 R    ps 
[root@FRXNAS ~]# 
I'm missing a lot, i have ftp, but no http, and the script ledje which give me visual HDU
activity isn't executed...
Other things such as my Python script for the power button is running, when i press the power button
it gives me the right feedback it should, but nothing happens...
I use NGC for rebooting/power down, so i guess NGC isn't running, when i want to check this i got this
error.

Code: Select all

[root@FRXNAS ~]# ngc
Error connecting to initng socket
[root@FRXNAS ~]#
OK now you lost me...

I have no idea what is going on, some things work other things don't, but why i have no clue.
maybe it's a permission issue, when i copy a file to my ftp directory i have to change permissions
before i can download it.
The content of SDA7 is a copy from SDA8 and after that a copy from SDA9.

For extra information this is my dmesg

Code: Select all

Linux version 2.6.22.18 (sbs@grp-horus) (gcc version 4.2.1) #1 Thu Oct 29 22:03:30 CET 2009
CPU: ARM926EJ-S [56251311] revision 1 (ARMv5TE), cr=00053177
Machine: netspace_v2
Using UBoot passing parameters structure
Memory policy: ECC disabled, Data cache writeback
On node 0 totalpages: 65536
  DMA zone: 512 pages used for memmap
  DMA zone: 0 pages reserved
  DMA zone: 65024 pages, LIFO batch:15
  Normal zone: 0 pages used for memmap
CPU0: D VIVT write-back cache
CPU0: I cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
CPU0: D cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
Built 1 zonelists.  Total pages: 65024
Kernel command line: console=ttyS0,115200 root=/dev/sda7 ro reset=0 productType=ASTON_KW
PID hash table entries: 1024 (order: 10, 4096 bytes)
Console: colour dummy device 80x30
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 256MB 0MB 0MB 0MB = 256MB total
Memory: 256384KB available (2764K code, 200K data, 476K init)
Calibrating delay loop... 799.53 BogoMIPS (lpj=3997696)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16

CPU Interface
-------------
SDRAM_CS0 ....base 00000000, size 256MB 
SDRAM_CS1 ....disable
SDRAM_CS2 ....disable
SDRAM_CS3 ....disable
PEX0_MEM ....base e8000000, size 128MB 
PEX0_IO ....base f2000000, size   1MB 
INTER_REGS ....base f1000000, size   1MB 
NFLASH_CS ....base fa000000, size   2MB 
SPI_CS ....base f4000000, size  16MB 
BOOT_ROM_CS ....no such
DEV_BOOTCS ....no such
CRYPT_ENG ....base f0000000, size   2MB 

  Marvell Development Board (LSP Version KW_LSP_4.2.7_patch2)-- netspace_v2  Soc: MV88F6281 Rev 3 LE

 Detected Tclk 166666667 and SysClk 200000000 
MV Buttons Device Load
Register Marvell USB EHCI Host controller #0
PEX0 interface detected no Link.
PCI: bus0: Fast back to back transfers enabled
SCSI subsystem initialized
NET: Registered protocol family 2
Time: kw_clocksource clocksource has been installed.
IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
TCP established hash table entries: 8192 (order: 4, 65536 bytes)
TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
TCP reno registered
Use the XOR engines (acceleration) for enhancing the following functions:
  o RAID 5 Xor calculation
  o kernel memcpy
  o kenrel memzero
Number of XOR engines to use: 4
cesadev_init(c000ef10)
MV Buttons Driver Load
mv_rtc mv_rtc: rtc core: registered mv_rtc as rtc0
mv_rtc mv_rtc: Kirkwood SoC RTC added
gpio-hd-power gpio-hd-power: GPIO Hard Disk power device initialized
Registered led device: ns:blue:front
gpio-usb gpio-usb: USB GPIO's initialized
VFS: Disk quotas dquot_6.5.1
Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
Registering unionfs 2.5.1 (for 2.6.22.19)
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0xf1012000 (irq = 33) is a 16550A
serial8250.0: ttyS1 at MMIO 0xf1012100 (irq = 34) is a 16550A
INIT Marvell Ethernet Driver: mv_netdev
Loading Marvell Ethernet Driver:
  o Cached descriptors in DRAM
  o DRAM SW cache-coherency
  o Multi RX Queue support - 4 RX queues
  o Multi TX Queue support - 2 TX Queues
  o TCP segmentation offload enabled
  o Receive checksum offload enabled
  o Transmit checksum offload enabled
  o Network Fast Processing (Routing) supported
  o Driver ERROR statistics enabled
  o Driver INFO statistics enabled
  o Proc tool API enabled
  o Rx descripors: q0=128 q1=128 q2=128 q3=128
  o Tx descripors: q0=532 q1=532
  o Loading network interface(s):
    o eth0, ifindex = 1, GbE port = 0

Warning: Giga 1 is Powered Off

mvFpRuleDb (c07a8000): 2048 entries, 8192 bytes
Integrated Sata device found
scsi0 : Marvell SCSI to SATA adapter
scsi1 : Marvell SCSI to SATA adapter
scsi 0:0:0:0: Direct-Access     Seagate  ST3160827AS      3.42 PQ: 0 ANSI: 5
Disk topology: host_no=0 channel=0 id=0
sd 0:0:0:0: [sda] 312581808 512-byte hardware sectors (160042 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 23 00 10 00
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, supports DPO and FUA
sd 0:0:0:0: [sda] 312581808 512-byte hardware sectors (160042 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 23 00 10 00
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, supports DPO and FUA
 sda: sda1 < sda5 sda6 sda7 > sda2
sd 0:0:0:0: [sda] Attached SCSI disk
sd 0:0:0:0: Attached scsi generic sg0 type 0
SPI Serial flash detected @ 0xf4000000, 512KB (128sec x 4KB)
mice: PS/2 mouse device common for all mice
input: gpio-keys as /class/input/input0
i2c /dev entries driver
at24 0-0050: 512 byte 24c04 EEPROM (writable)
md: linear personality registered for level -1
md: raid0 personality registered for level 0
md: raid1 personality registered for level 1
raid6: int32x1     73 MB/s
raid6: int32x2     80 MB/s
raid6: int32x4     83 MB/s
raid6: int32x8     75 MB/s
raid6: using algorithm int32x4 (83 MB/s)
md: raid6 personality registered for level 6
md: raid5 personality registered for level 5
md: raid4 personality registered for level 4
raid5: measuring checksumming speed
   arm4regs  :   726.400 MB/sec
   8regs     :   505.600 MB/sec
   32regs    :   598.000 MB/sec
raid5: using function: arm4regs (726.400 MB/sec)
device-mapper: ioctl: 4.11.0-ioctl (2006-10-12) initialised: dm-devel@redhat.com
Registered led device: ns:red:front
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
Freeing init memory: 476K
eth0: link down
eth0: started
EXT3-fs: INFO: recovery required on readonly filesystem.
EXT3-fs: write access will be enabled during recovery.
kjournald starting.  Commit interval 5 seconds
EXT3-fs: sda7: orphan cleanup on readonly fs
ext3_orphan_cleanup: deleting unreferenced inode 55553
EXT3-fs: sda7: 1 orphan inode deleted
EXT3-fs: recovery complete.
EXT3-fs: mounted filesystem with ordered data mode.
EXT3 FS on sda7, internal journal
eth0: link up, full duplex, speed 100 Mbps
SGI XFS with ACLs, security attributes, realtime, large block numbers, no debug enabled
SGI XFS Quota Management subsystem
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
ehci_marvell ehci_marvell.70059: Marvell Orion EHCI
ehci_marvell ehci_marvell.70059: new USB bus registered, assigned bus number 1
ehci_marvell ehci_marvell.70059: irq 19, io base 0xf1050100
ehci_marvell ehci_marvell.70059: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
Adding 256968k swap on /dev/sda5.  Priority:-1 extents:1 across:256968k
XFS mounting filesystem sda2
Ending clean XFS mount for filesystem: sda2
Sorry for the long post, i wanted to give as much as possible information.

Greetings Yagi

Mijzelf
Posts: 6199
Joined: Mon Jun 16, 2008 10:45 am

Re: Networkspace layerd filesystem

Post by Mijzelf » Sat Nov 19, 2011 7:53 pm

Yagi wrote:First thing i forgot was that in fstab is an entry to mount SDA7 as read only
Good catch.
Error connecting to initng socket
According to Google that means that initng is crashed. I suppose one of the services is upset by the new partition setup. Have a look at the mountfs and mountuserfs scripts.

Are you using a script as /sbin/init? In that case you can change it to intercept the bootlog:

Code: Select all

#!/bin/sh
mount -o remount,rw /dev/sda7 /
exec >>/var/log/bootlog 2>&1
exec /sbin/initng

Yagi
Posts: 9
Joined: Tue Nov 15, 2011 2:55 pm

Re: Networkspace layerd filesystem

Post by Yagi » Sun Nov 20, 2011 5:11 pm

Error connecting to initng socket
According to Google that means that initng is crashed. I suppose one of the services is upset by the new partition setup. Have a look at the mountfs and mountuserfs scripts.
Well there are some others that have a reference to the old directory structure:

initial.i
mdadm.i
raid.i (i disabled this one as i think it's no longer necessary)
unionfs.i

mdadm.i and unionfs.i are not in default.runlevel, when are they used?
google tells me that mdadm also has something to do with a software raid,
a thing i think i no longer need.

initial.i looks rather important to me, but when i remove the reference to the
old directory structure the NS2 no longer boots...

Code: Select all

service initial/snapshots {
	need = initial/mountvirtfs;
	env EDCONF=/oldroot/snapshots/EDMINI;
	script start = {
		echo "Mounting $EDCONF"
		if [ -d ${EDCONF}/var ]; then
			/bin/mount -n -o bind ${EDCONF}/var /var
			/bin/rm -rf ${EDCONF}/tmp
			/bin/mkdir -p ${EDCONF}/tmp
			/bin/mount -n -o bind ${EDCONF}/tmp /tmp
		fi
	}
	script stop = {
		echo "Cleaning stale PID files"
		find /var/run -name *.pid -exec rm -f {} \;
		echo "Mounting root as RO "
		line="`/oldroot/sbin/unionctl / --list | head -n1`"
		RW_SNAP="`echo $line | awk '{print $1}'`"
		if [ ! -z "$RW_SNAP" ]; then
			kernel_rev=`uname -r | awk -F "." '{print $3}'`
			if [ $kernel_rev -lt 22 ]; then
			    /oldroot/sbin/unionctl / --mode $RW_SNAP ro
			else
			    /bin/mount -t unionfs -o remount,ro none /
			fi
		fi
	}
}
Are you using a script as /sbin/init? In that case you can change it to intercept the bootlog:

Code: Select all

#!/bin/sh
mount -o remount,rw /dev/sda7 /
exec >>/var/log/bootlog 2>&1
exec /sbin/initng
Yes, i use this script, i will try the bootlog and see what's going wrong, thanks this is very helpfull information.

Greetings Yagi

Yagi
Posts: 9
Joined: Tue Nov 15, 2011 2:55 pm

Re: Networkspace layerd filesystem

Post by Yagi » Fri Nov 25, 2011 5:44 pm

Well after a week with a lot of testing, i think the idea is not possible :(
I get some strange errors, and why they happen i have no clue.
pa. normally i have a trigger for my LEDS called hdd, when i use this trigger
the leds (blue or red) will give me HDD activity feedback.
Now i don't have this trigger...???... in the bootlog i get an error on the line where
i normally use this trigger.

Also the problem with initng, the 'no socket error' i think has something todo with
the entrys in /dev, om my working NS2 i have a initng directory/entry, on my 'all
on sda7 nas' i don't have this entry, even after i removed all the services that gave
me bad errors in default.runlevel.

Editing initial.i in an attempt to change to the new directory structure only results
in a none booting NS2...
I have to remove the HDD to see the last bootlog for more details, so i think i'm stuck
with this layered file system.

Greetings Yagi

Mijzelf
Posts: 6199
Joined: Mon Jun 16, 2008 10:45 am

Re: Networkspace layerd filesystem

Post by Mijzelf » Fri Nov 25, 2011 7:00 pm

The /sbin/init on the original sda7 starts with executing

Code: Select all

initFileSystem()
{
    debug_msg "Initializing filesystem"
    for dir in proc sys root dev ; do
        [ -d /$dir ] || mkdir /$dir
        [ -d /$dir ] || fallback "Could not create /$dir"
    done

    debug_msg "Mounting /proc"
    mount -t proc none /proc
    checkError $? "Unable to mount /proc"

    debug_msg "Mounting /sys"
    mount -t sysfs none /sys
    checkError $? "Unable to mount /sys"

    debug_msg "Populating /dev"
    mount -n -o size=10M,mode=0755 -t tmpfs udev /dev
    checkError $? "Unable to mount /dev"
    /sbin/udevstart

    [ -L /dev/stdin ] || ln -s /proc/self/fd/0 /dev/stdin
    [ -L /dev/stdout ] || ln -s /proc/self/fd/1 /dev/stdout
    [ -L /dev/stderr ] || ln -s /proc/self/fd/2 /dev/stderr
    for i in 0 1 2 3 4 ; do
        [ -b /dev/md$i ] || mknod /dev/md$i b 9 $i
        [ -b /dev/md$i ] || fallback "Could not create /dev/md$i"
    done
    debug_msg "Mounting /dev/pts"
    mkdir -p /dev/pts
    mount -t devpts devpts /dev/pts
    checkError $? "Unable to mount /dev/pts"

    debug_msg "Mounting /dev/shm"
    mkdir -p /dev/shm
    mount -vt tmpfs none /dev/shm
    checkError $? "Unable to mount /dev/shm"
}
And as far as I see, this is nowhere undone. I'd expect the mounts to become obsolete, due to the root switching, but maybe I'm overlooking something. And at least /sbin/udevstart is executed, which can also has effect after the switch.

Yagi
Posts: 9
Joined: Tue Nov 15, 2011 2:55 pm

Re: Networkspace layerd filesystem

Post by Yagi » Sat Dec 24, 2011 8:40 pm

Many thanks for the help Mijzelf, but after some attempts i gave up, and gone back to my 'old'
stripped down layerd filesystem NS2. :D

It's a clean little Linux box without the horrible unicorn, my third NS2 is running Xmail so perfectly
that it can replace my window$ server 2003 mailserver, including webmail/spamassassin etc.

The whole idea of one partition was to save some HDU bytes, but that's more because my roots
are in the ZX81 era, i think i have to live with the modern idea that we can spill bytes :mrgreen:

Grtzz Yagi

Post Reply