Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED]frustrations using SDHC solid state disks -EeePC
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
stardotstar
l33t
l33t


Joined: 10 Feb 2006
Posts: 720
Location: 2074/SYD/NSW/AU

PostPosted: Fri Apr 25, 2008 2:53 am    Post subject: [SOLVED]frustrations using SDHC solid state disks -EeePC Reply with quote

I have snipped this from a post on the eeeusers forum because it is not getting any response - not a crit of their community; but maybe someone would be interested in this experience from a pure gentooers point of view and maybe someone would be able to comment whether they have eee experience or not - I have heard of many running gentoo happily on the eee... And I have not given up... currently I can get it to work fine on an external hdd...

---snip -->
Hi all,

I am rather out of time and patience for getting a stable Gentoo build onto my EeePC; a task to which I committed myself with great enthusiasm.

I am far from incompetent with Gentoo Linux, Debian and the *buntu distros although I freely admit that hardware level troubleshooting when it comes to disks and low level drivers is quite beyond my expertise.

Allow me to put my circumstances in perspective and perhaps someone will see the flaw in how I am proceeding and all will become clear.

The fact of the matter is that I can't get a Gentoo build to complete on my Eee - not on the internal SD card, not on the SDHC in the slot and/or any combination of partitions between the two and even attempts to mount bind the write/space intensive directories to an external HDD.

The frustrating thing is that the machine really does seem to be fine; it behaves very predictably until the dreaded "No space left on device" or "Cannot open: no such file or directory" errors - usually when copying (decompressing tarballs) and occasionally when simply trying to execute a command from (for example) /bin or /usr/bin

I have the 4G internal solid state disk and have read extensively about the pros and cons, FUDs and Opinions about how likely one distro or one approach to utilising the disk space vs another can impact device life. In fact to begin with I left the default install in tact and worked entirely off an 8G SDHC in the internal bay. I was booting successfully in via a 4GB Toshiba U3 USB Stick using the Gentoo based System Rescue CD 1.0.1 and found that everything I needed to begin a Gentoo install simply worked out of the box:

Networking on the wired LAN worked on boot; the display was more than adequete, RAM sufficient, touchpad for GDM fine, the keyboard I have quickly become used to.

So I enthusiastically launched into building a TinyGentoo (embedded) system on the box since I figured that I would only be struggling with a slightly unfamiliar install of Gentoo and its related packages and toolsets - I did not expect to be frustrated at so many stages with unfamiliar hardware issues appearing apparently out of nowhere to completely bulldoze the progress.

After getting so far into a TinyGentoo (uClibc) install - to the point of having had the little box successfully compile GCC4.1.2 from source over several hours of uninterrupted operation monitored and managed from an ssh session on my Gentoo based Intel MacBook Pro I suddenly found the machine unresponsive and the system disintegrating before my eyes:

I detailed one instance of this in this thread here:
http://forum.eeeuser.com/viewtopic.php?id=25172

Following on from several attempts I began to see a pattern; the solid state disks would simply not cope with the demand of installation and appear full or display a directory of files that were inaccessible when called.

I decided to get bold and do a vanilla gentoo install using the minimal installer etc; ie take the uClibc issues out of the picture as well as simplifying the partitioning and structure of the build. This met with the same fate.

So I gave the Debian installer a try. I use Debian Stable on my web servers and was quite satisfied that it was a reasonable intermediate step for my Eee since I was beginning to want a working install on it at all let alone my distro of first choice!

Debian Lenny installed fine on the main disk and wireless worked out of the box as promised and I was once again enthused about proceeding. Since I had by this time elected to install over the Xandros internal build I was committed to rewriting the internal SDD so I figured I'd have another crack at gentoo using the fundamental elements from the debian terminal and gentoo installers to prep a usb installer.

This was complicated by the fact that I could only get one of my usb drives to work correctly as a boot disk.

I figured that I was getting distracted and returned to building a simple clean gentoo on the internal disk.

I partitioned with ext2 for boot, ext3 for root and everything else to keep it simple.

The install progressed as though it would just go straight through - formatting and initialising the disks, mounting the partitions and proc and binding dev. Unpacking the stage3 tarball worked perfectly (I extracted it onto the internal disk after copying it to there to try and avoid speed/cache issues with pulling it over from another disk (esp the much faster external HDD). I was able to unpack the initial portage snapshot as well - which was a very exciting and encouraging breakthrough - usually - even with over 1.8G free the disk would baulk and say it was full or no such file or directory - couldn't open etc... So I proceeded with the chroot and the env-update worked fine; I also found all my chrooted binaries worked and the path statements were sane and fully operational.

This was the furthest I had got in so far (save from the gcc compile I had managed to get to earlier) and it was proceeding like a normal gentoo install (I have been doing these for several years - on lots of notebooks and desktops).

I had the proxy configured to get through my corp firewall and successfully used emerge-webrsync to pull down the latest portage to proceed when... mid way through unpacking the portage tree - same problem - no space left on device followed by Cannot open: no such file or directory ...

Disapointment, frustration.

I will return to Debian - to see if that works well a second time and then stays stable and operational and perhaps will put it down to something I simply don't have the time or expertise to fathom at the moment. But I am sorely dissapointed that a lightweight Gentoo build was not as easy for me to achieve as I fully expected.

I have detailed my (lack of) progress at a forum I dedicated to my sort of hacks at getting Gentoo fully sorted and you may find a link to that in another of my posts (I don't want to draw audience and participation away from this excellent site - especially to a narrative of failure!

If anyone can provide some insight or suggestions as to why I might be suffering this amount of trouble I would appreciate it.

The current state of the device is quoted below to show the basics of my situtation. As you can see there is no space issue.

Code:
sysresccd ~ # cat /proc/partitions
major minor  #blocks  name

   7     0     154840 loop0
   8     0    3907512 sda
   8     1      40131 sda1
   8     2    3863632 sda2
   8    16    3899711 sdb
   8    17    3899695 sdb1
   8    32  117220824 sdc
   8    33  117218241 sdc1
   8    48    7977472 sdd
   8    49    3913781 sdd1
   8    50     984312 sdd2
   8    51    3077928 sdd3
sysresccd ~ #
sysresccd ~ # df -h /
Filesystem            Size  Used Avail Use% Mounted on
tmpfs                 245M   14M  231M   6% /
sysresccd ~ # df -h /mnt/gentoo
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2             3.7G  1.5G  2.0G  44% /mnt/gentoo
sysresccd ~ # df -h /mnt/gentoo/usr/portage
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2             3.7G  1.5G  2.0G  44% /mnt/gentoo
sysresccd ~ # cat /etc/mtab     
tmpfs / tmpfs rw 0 0
/dev/sdb1 /mnt/cdrom vfat ro,relatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1,utf8 0 0
/dev/loop0 /mnt/livecd squashfs ro,relatime 0 0
proc /proc proc rw,nosuid,nodev,noexec 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec 0 0
udev /dev tmpfs rw,nosuid,relatime 0 0
devpts /dev/pts devpts rw,nosuid,noexec 0 0
tmpfs /lib/firmware tmpfs rw 0 0
tmpfs /usr/portage tmpfs rw 0 0
usbfs /proc/bus/usb usbfs rw,noexec,nosuid,devmode=0664,devgid=85 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,noexec,nosuid,nodev 0 0
securityfs /sys/kernel/security securityfs rw,noexec,nosuid,nodev 0 0
/dev/sda2 /mnt/gentoo ext3 rw 0 0
/dev/sda1 /mnt/gentoo/boot ext2 rw 0 0
/dev/sdc1 /mnt/custom ext3 rw 0 0
none /mnt/gentoo/proc proc rw 0 0
/dev /mnt/gentoo/dev none rw,bind 0 0

Dev is properly populated:

Code:
sysresccd ~ # ls /dev
agpgart        fd       loop2   mouse1  ram12  random  sdd1    stdout  tty16  tty27  tty38  tty49  tty6   urandom         usbdev1.5_ep00  usbmon1  vcs6
bus            full     loop3   mptctl  ram13  rd      sdd2    tgt     tty17  tty28  tty39  tty5   tty60  usbdev1.1_ep00  usbdev1.5_ep81  usbmon2  vcsa
cdrom          fuse     loop4   null    ram14  rtc     sdd3    tts     tty18  tty29  tty4   tty50  tty61  usbdev1.1_ep81  usbdev1.5_ep82  usbmon3  vcsa1
cdrom1         gpmctl   loop5   nvram   ram15  scd0    sg0     tty     tty19  tty3   tty40  tty51  tty62  usbdev1.2_ep00  usbdev2.1_ep00  usbmon4  vcsa12
cdrom2         hpet     loop6   oldmem  ram2   sda     sg1     tty0    tty2   tty30  tty41  tty52  tty63  usbdev1.2_ep02  usbdev2.1_ep81  usbmon5  vcsa2
cdrw           initctl  loop7   port    ram3   sda1    sg2     tty1    tty20  tty31  tty42  tty53  tty7   usbdev1.2_ep81  usbdev3.1_ep00  vcs      vcsa3
cdrw1          input    mapper  ptmx    ram4   sda2    sg3     tty10   tty21  tty32  tty43  tty54  tty8   usbdev1.3_ep00  usbdev3.1_ep81  vcs1     vcsa4
console        kmsg     md      pts     ram5   sdb     sg4     tty11   tty22  tty33  tty44  tty55  tty9   usbdev1.3_ep02  usbdev4.1_ep00  vcs12    vcsa5
core           log      md0     ram0    ram6   sdb1    shm     tty12   tty23  tty34  tty45  tty56  ttyS0  usbdev1.3_ep81  usbdev4.1_ep81  vcs2     vcsa6
dac960_gam     loop     mem     ram1    ram7   sdc     sr0     tty13   tty24  tty35  tty46  tty57  ttyS1  usbdev1.4_ep00  usbdev5.1_ep00  vcs3     watchdog
device-mapper  loop0    misc    ram10   ram8   sdc1    stderr  tty14   tty25  tty36  tty47  tty58  ttyS2  usbdev1.4_ep01  usbdev5.1_ep81  vcs4     zero
disk           loop1    mouse   ram11   ram9   sdd     stdin   tty15   tty26  tty37  tty48  tty59  ttyS3  usbdev1.4_ep82  usbmon0         vcs5
sysresccd ~ #

and the processes that are alive are normal

Code:
sysresccd ~ # ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.1   1620   568 ?        Ss   07:02   0:03 init [3] 
root         2  0.0  0.0      0     0 ?        S<   07:02   0:00 [kthreadd]
root         3  0.0  0.0      0     0 ?        S<   07:02   0:00 [migration/0]
root         4  0.0  0.0      0     0 ?        S<   07:02   0:00 [ksoftirqd/0]
root         5  0.0  0.0      0     0 ?        S<   07:02   0:00 [watchdog/0]
root         6  0.0  0.0      0     0 ?        S<   07:02   0:00 [events/0]
root         7  0.0  0.0      0     0 ?        S<   07:02   0:00 [khelper]
root       150  0.0  0.0      0     0 ?        S<   07:02   0:00 [kblockd/0]
root       152  0.0  0.0      0     0 ?        S<   07:02   0:00 [kacpid]
root       153  0.0  0.0      0     0 ?        S<   07:02   0:00 [kacpi_notify]
root       234  0.0  0.0      0     0 ?        S<   07:02   0:00 [cqueue/0]
root       240  0.0  0.0      0     0 ?        S<   07:02   0:00 [ata/0]
root       241  0.0  0.0      0     0 ?        S<   07:02   0:00 [ata_aux]
root       243  0.0  0.0      0     0 ?        S<   07:02   0:00 [ksuspend_usbd]
root       249  0.0  0.0      0     0 ?        S<   07:02   0:00 [khubd]
root       252  0.0  0.0      0     0 ?        S<   07:02   0:00 [kseriod]
root       288  0.0  0.0      0     0 ?        S<   07:02   0:02 [kswapd0]
root       330  0.0  0.0      0     0 ?        S<   07:02   0:00 [aio/0]
root       332  0.0  0.0      0     0 ?        S<   07:02   0:00 [btrfs/0]
root       360  0.0  0.0      0     0 ?        S<   07:02   0:00 [unionfs_siod/0]
root       588  0.0  0.0      0     0 ?        S<   07:02   0:00 [netxen]
root       592  0.0  0.0      0     0 ?        S<   07:02   0:00 [scsi_tgtd/0]
root       673  0.0  0.0      0     0 ?        S<   07:02   0:00 [scsi_eh_2]
root       675  0.0  0.0      0     0 ?        S<   07:02   0:00 [scsi_eh_3]
root       812  0.0  0.0      0     0 ?        S<   07:02   0:00 [scsi_eh_4]
root       813  0.0  0.0      0     0 ?        S<   07:02   0:00 [usb-storage]
root       816  0.0  0.0      0     0 ?        S<   07:02   0:00 [scsi_eh_5]
root       817  0.0  0.0      0     0 ?        S<   07:02   0:00 [usb-storage]
root       820  0.0  0.0      0     0 ?        S<   07:02   0:00 [scsi_eh_6]
root       821  0.0  0.0      0     0 ?        S<   07:02   0:00 [usb-storage]
root       834  0.0  0.0      0     0 ?        S<   07:02   0:00 [kpsmoused]
root      1968  0.0  0.0      0     0 ?        S<   07:02   0:00 [ksnapd]
root      2523  0.0  0.0      0     0 ?        S<   07:02   0:00 [jfsIO]
root      2524  0.0  0.0      0     0 ?        S<   07:02   0:00 [jfsCommit]
root      2525  0.0  0.0      0     0 ?        S<   07:02   0:00 [jfsSync]
root      2663  0.0  0.0      0     0 ?        S<   07:02   0:00 [rpciod/0]
root      2824  0.0  0.0      0     0 ?        S<   07:02   0:00 [xfslogd/0]
root      2825  0.0  0.0      0     0 ?        S<   07:02   0:00 [xfsdatad/0]
root      2829  0.0  0.0      0     0 ?        S<   07:02   0:00 [xfs_mru_cache]
root      3294  0.0  0.0      0     0 ?        S<   07:02   0:00 [loop0]
root      5085  0.0  0.1   1884   728 ?        S<s  07:02   0:01 /sbin/udevd --daemon
root      6652  0.0  0.1   2700   760 ?        Ss   07:02   0:00 /usr/sbin/syslog-ng
root      8459  0.0  0.0   1832   392 ?        Ss   07:02   0:00 /usr/sbin/gpm -m /dev/input/mice -t ps2
root      8686  0.0  0.1   3984   908 ?        Ss   07:03   0:00 /usr/sbin/sshd
root      8751  0.0  0.5   4364  2928 tty1     Ss+  07:03   0:00 /bin/zsh --login
root      8753  0.0  0.4   3820  2260 tty2     Ss+  07:03   0:01 /bin/zsh --login
root      8755  0.0  0.4   3820  2232 tty3     Ss+  07:03   0:01 /bin/zsh --login
root      8757  0.0  0.4   3820  2236 tty4     Ss+  07:03   0:01 /bin/zsh --login
root      8758  0.0  0.4   3820  2236 tty5     Ss+  07:03   0:01 /bin/zsh --login
root      8759  0.0  0.4   3820  2232 tty6     Ss+  07:03   0:01 /bin/zsh --login
root      9055  0.4  0.0      0     0 ?        S<   07:10   0:23 [kjournald]
root      9059  0.0  0.0      0     0 ?        S<   07:11   0:00 [kjournald]
root      9154  0.0  0.0   1644   296 ?        Ss   07:36   0:00 /sbin/dhcpcd -n -t 10 -h sysresccd eth0
root      9245  0.0  0.0      0     0 ?        S    07:57   0:00 [pdflush]
root      9279  0.0  0.0      0     0 ?        S    08:12   0:00 [pdflush]
root      9282  0.4  0.4   6740  2176 ?        Ss   08:46   0:00 sshd: root@pts/0
root      9287  0.3  0.3   2748  1580 pts/0    Ss   08:46   0:00 -bash
root      9306  0.0  0.1   2256   912 pts/0    R+   08:49   0:00 ps aux

Notice the behaviour below (if you'll excuse the purile humor ;-)

Code:
sysresccd ~ # touch me
sysresccd ~ # rm me
rm: remove regular empty file `me'? y
sysresccd ~ # cd /mnt
sysresccd mnt # touch me
sysresccd mnt # rm me
rm: remove regular empty file `me'? yes
sysresccd mnt # cd /mnt/gentoo
sysresccd gentoo # touch me
touch: cannot touch `me': No space left on device
sysresccd gentoo # cd /mnt/gentoo/boot/
sysresccd boot # touch me
sysresccd boot # rm me
rm: remove regular empty file `me'? y
sysresccd boot #

We know that only the partition that has been having to take the unpacking of the system on it has failed to work - /dev/sda2; the tmpfs and /dev/sda1 are still operational.

I wonder how debian did its install so well?? Anyway I have no problem with Debian and will return there for the moment while I regather strength.

Regards,
\\'\\_\_
_________________
\\'
ab extra
ab aeterno
a posse ad esse
ad fontes
\\'


Last edited by stardotstar on Tue Apr 29, 2008 4:36 am; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 27779
Location: 56N 3W

PostPosted: Fri Apr 25, 2008 3:18 pm    Post subject: Reply with quote

stardotstar,

gcc wants a fair amount of space in /var/tmp/portage to build, as that is on your /, I suspect its filling up.
With such a small amount of space (4G), you will need to flush /usr/portage/distfiles fairly frequently and make sure no broken build are left in /var/tmp/portage.

You may be out of inodes, rather than disk space. When your root fills up, what does
Code:
df -h
show?
Thats the space used for files.
What about
Code:
df -i
that shows your inode use.
Every file needs at least one inode, so when they are all used, you cannot create any more files, even if you have empty space.

ext3 or any journaled filesystem is a bad idea on flash memory. First, it needs extra writes to the journal, which causes wear issues. Secondly, flash is slow compared to a real hard drive and a journal makes it slower.

Since you have another Gentoo install, mount /usr/portage over nfs from the other machine. That way you get the benefit of your portage tree and distfiles without using any of your precious local 4G. If you have a /usr/portage/packages, be careful with that as it holds binary packages that have been made for and by the other architecture.

You cannot compare Gentoo installs with binary installs. Gentoo needs more space to install as it has /usr/portage for ebuilds and source files and uses space in /var/tmp/portage for building packages. Binary distros don't have any of that.

You can install Gentoo as if it were a binary install - build it in a chroot on some donor machine, then tart it up for the install. This process is called a stage4. You can leave behind all the things you will not need on the target machine.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
hielvc
Advocate
Advocate


Joined: 19 Apr 2002
Posts: 2776
Location: Oceanside, Ca

PostPosted: Sat Apr 26, 2008 12:26 am    Post subject: Reply with quote

stardotstar,

I have a 4g and I'm thinking about putting gentoo on it also. I would not try to build on the eeepc though unless I used a usb drive orlarge usb or SD drives. Your going to wipe out that SSD memory using it to build gentoo. Unless your desktop is reallly old and slow use a partition or a dir to build it in and maintain it.
_________________
An A-Z Index of the Linux BASH command line
Back to top
View user's profile Send private message
stardotstar
l33t
l33t


Joined: 10 Feb 2006
Posts: 720
Location: 2074/SYD/NSW/AU

PostPosted: Sat Apr 26, 2008 12:12 pm    Post subject: Reply with quote

Hi Guys,

Firstly, Neddy, fantastic advice as always; I am as always indebted to you for the time you take to understand and respond to so many varied questions.

I think I begin to understand what else may be causing this kind of behavior after your points about the need for inodes and root on tmpfs. I will attempt to grok this in fullness and begin again. Furthermore I will follow your advice and post df -i and h as soon as I can.

I was certainly working to minimize the impact on the internal disk but your insight into the implications of the tmpfs and inodes etc is something that gives me a great deal of encouragement!

Hielvc I understand the problematic issue of thrashing out sdhc cards, (there are a number of very interesting if not controversial articles doing the rounds) I have been trying to avoid using it intensively as much as possible and it is quite possible that this has contributed to my problems. When gave up and tried to do a full install on the internal disk and it failed and then I repeated the exercise on the external hdd I was perplexed but I am beginning to understand the full implications of using a source based meta-distro.

Your responses are very much appreciated guys.

Will
_________________
\\'
ab extra
ab aeterno
a posse ad esse
ad fontes
\\'
Back to top
View user's profile Send private message
cwr
Veteran
Veteran


Joined: 17 Dec 2005
Posts: 1288

PostPosted: Sat Apr 26, 2008 8:02 pm    Post subject: Reply with quote

For lightweight machines (in my case a _very_ old Pentium) it was easiest for
me to keep all the portage sources off the machine on a local NAS box; ftp
could pick them up very quickly. I expect you could set up one of your other
boxes as an ftp server, which would save a lot of space.

And I've usually found that I need to unpack a portage snapshot on an ext3
filesystem on a separate partition built with extra inodes,
ie. mkfs -t ext3 -T news.

An awful lot of junk can accumulate in /var/spool/portage, too, after a couple
of build failures; more than enough to put a small filesystem over the top.
Then when portage fails most of the files are deleted, and you never find out
what happened. I tend to work from the command line, and open a separate
terminal to check current usage with "df".

Good luck - Will
Back to top
View user's profile Send private message
stardotstar
l33t
l33t


Joined: 10 Feb 2006
Posts: 720
Location: 2074/SYD/NSW/AU

PostPosted: Sun Apr 27, 2008 12:41 am    Post subject: Reply with quote

Guys, this is a fantastic truly Gentoo set of replies :D

I am going to forge ahead as suggested.

In my original notes which if anyone could be bothered to read a tale of aborted and misconceived first attempts is here ;) (not to mention the gransiose claim of howto "gentoo fast on an eeePC" :lol: :oops:
http://www.sourcepoint.com.au/a3gis/forum/viewforum.php?f=2

Anyway I am researching the filesystem fundamentals of inodes and will again try to work up a stage 4 install similar to my original intentions:

Code:
sysresccd / # mkdir /mnt/ext_var
sysresccd / # mkdir /mnt/backup
sysresccd / # mkdir /mnt/usb
sysresccd / # mount -t ext2 /dev/sdc2 /mnt/backup
sysresccd / # mount /dev/sd
sda   sda1  sda2  sda3  sda4  sdb   sdb1  sdc   sdc1  sdc2  sdd   sdd1  sdd2  sdd3  sdd4  sde   sde1

sysresccd / # mount -t ext2 /dev/sdd3 /mnt/ext_var

sysresccd / # mount --bind /mnt/ext_var/var /var/
sysresccd / # mount --bind /mnt/ext_var/tmp /tmp
sysresccd / # mount --bind /mnt/ext_var/usr/portage/distfiles /usr/portage/distfiles


That's probably very crude and so forth but it was my intention to save the solid state disks as much as possible.

I don't think I understand the basics of mount binding especially when chroot is implicated - ie do I mount the disk first to a normal mount point and then bind it prior to chrooting or do I wait until I have chrooted and then mount and mount bind...?

(oh and cwr - I am only working from command line - that's the primary joy of gentoo for me - all else follows the terminal :) - so I relate to your approach)
_________________
\\'
ab extra
ab aeterno
a posse ad esse
ad fontes
\\'
Back to top
View user's profile Send private message
stardotstar
l33t
l33t


Joined: 10 Feb 2006
Posts: 720
Location: 2074/SYD/NSW/AU

PostPosted: Sun Apr 27, 2008 9:06 am    Post subject: Reply with quote

Sadly it seems that in my frustration I have wiped the offending partitions - probably in a frenzy of "try another approach" on Friday afternoon.

I may give some recovery tools a go having done a thorough read and research on ext2/3 and perhaps, if I can recover the filesystem/s I can discover if it was an inode problem or something else worth reporting for analysis here.

Once again thanks for the help.

WIll
_________________
\\'
ab extra
ab aeterno
a posse ad esse
ad fontes
\\'
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 27779
Location: 56N 3W

PostPosted: Sun Apr 27, 2008 12:04 pm    Post subject: Reply with quote

stardotstar,

testdisk will scan for what looks like partitions and offer to rebuild the partition table for you.
However, if you have already done a mkfs your data will be gone, even if you recover the partition table(s).
More exactly, you data will still be there but all the pointers to it in the file system meta data will be cleared.

Heres a quick guide ... do this on another system with Gentoo already installed. The CPU in this host system needs to be upwards compatible with the target eeepc CPU.

First, make an empty file on the host for what will be your eeepc install. You will do maintainace here for the eeepc in the future.
We then format the file as if it were a partition and mount it, so we need a mount point too.
Code:
dd if=/dev/zero of=/home/<user>/eeepc.file bs=1024000 count=1024
mke2fs /home/<user>/eeepc.file
This makes an empty file, about 10G and formats it with the ext2 filesystem.
You can play with inodes here is you want to. This will not be the filesystem that ends up on the eeepc but its a bad thing to make a journalled filesystem in a file thats held on a journalled filesystem.
Next, create the mount point and mount it.
Code:
mkdir /mnt/eeepc
mount -o loop,rw -t ext2 /home/<user>/eeepc.file /mnt/eeepc
You need loop support in your kernel, or as a module.
You now have about 10G of space to install for your eeepc.
Contine with a normal Gentoo Stage 3 install but with one changed step. Do not fetch a portage snapshot.
After the stage 3 is untared in /mnt/eeepc and you have done the mount proc ... mount -o bind /dev ... by following the handbook, do
Code:
mkdir  /mnt/eeepc/usr/portage
mount -o bind /usr/portage  /mnt/eeepc/usr/portage
This attaches your outside the chroot /usr/portage to the inside the chroot /usr/portage, so your portage tree and all your distfiles are there.

Now
Code:
chroot /mnt/eeepc /bin/bash
and contine with the install - but set everything to suit the eeepc, not the system you are installing on.
Do not install grub to the MBR, not until you have moved things to the eeepc anyway.

The move phase consists of moving only the things you need to the eeepc. You can use any data transfer to the eeepc that both systems support. Note that when you
Code:
umount  /usr/portage
from outside the chroot, the whole tree and distfiles disappears from inside the chroot.
You will not need 10G, thats enough for a desktop install the way I have outlined.

Good luck.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
stardotstar
l33t
l33t


Joined: 10 Feb 2006
Posts: 720
Location: 2074/SYD/NSW/AU

PostPosted: Sun Apr 27, 2008 9:42 pm    Post subject: Reply with quote

NeddySeagoon, thank you for that fantastic tutorial.

What I propose is that I attempt a new build with your approach in mind with one small change.

I will boot the E from the live CD/USB and go about an install as you recommend but on my external HDD.

I know this works because I managed it last time as long as I didn't use the solid state disks.

I would use another gentoo system but when I am at work I only have the E available next to my OSX Mac.

I take it that the final step in this would be to format the E's internal disk - or an SDHC in the slot for that matter; with a boot part (ext2 around 32MB) and the remainder
with ext3 and then copy everything over from the build on the external disk (the 10G loopback FS you defined) to the ext3 root on the E. - or would I do it with a dd?

Then complete the install by switching into the E (chroot) and mounting the internal boot partition; and installing grub to the MBR.

Since Dev and Proc are auto populated will I need to have anything other than an empty directory there in the tree or are there special copying switches I will need to use -

(I will go off and research this myself in the mean time.)

Only other question at this time is to understand how mount bind survives chroot in tact - obviously I have found that sym links get broken ...

Thanks again.
Will
_________________
\\'
ab extra
ab aeterno
a posse ad esse
ad fontes
\\'
Back to top
View user's profile Send private message
stardotstar
l33t
l33t


Joined: 10 Feb 2006
Posts: 720
Location: 2074/SYD/NSW/AU

PostPosted: Sun Apr 27, 2008 10:14 pm    Post subject: Reply with quote

BTW - the problem is indeed inode exhaustion:

the testdisk tool recovered my partition(s) and upon mounting the old build and doing

df -i and df -h I saw that despite there being over 2G free the inode usage was 100% - 241920 - what a great lesson in filesystem handling :)
_________________
\\'
ab extra
ab aeterno
a posse ad esse
ad fontes
\\'
Back to top
View user's profile Send private message
stardotstar
l33t
l33t


Joined: 10 Feb 2006
Posts: 720
Location: 2074/SYD/NSW/AU

PostPosted: Tue Apr 29, 2008 4:41 am    Post subject: Reply with quote

Following the guidance I have had here I ended up with the following solution:

Build the gentoo system for the E from the E on an external USB-HDD using two partitions
One partition was what would ultimately be the main root partition of the E.
The second is a mount bind location for /var/tmp and /usr/portage that is used whenever maintanance has to happen

I proceeded with a normal handbook build did some custom E-centric kernel stuff and then moved the root over to the second partition of the internal sdhc and made the necessary changes to fstab and grub.

Boots fast and clean and shouldn't be thrashing the internal fixed solid state disk because I have got home, an experimental swap and /var/tmp and /tmp on the 8G sdhc in the slot.

Now to kernel optimisation, madwifi-ng and X

uvesafb first :grin:

Thanks for all kthe help guys!

Will
_________________
\\'
ab extra
ab aeterno
a posse ad esse
ad fontes
\\'
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 27779
Location: 56N 3W

PostPosted: Tue Apr 29, 2008 7:04 pm    Post subject: Reply with quote

stardotstar,

-o bind does not survive a chroot. With -o bind, you actually mount the same thing in two places.
Once inside and once outside the chroot.

If the eeepc has a flash drive, you should not use ext3 on it. The journal causes a lot of extra writes which age the flash and slow things down.

You can save more space on the eeepc - you don't need gcc and friends. It can stay in the maintainence partition on your USB hard drive. Its all a matter of how much you need the space or inodes.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
stardotstar
l33t
l33t


Joined: 10 Feb 2006
Posts: 720
Location: 2074/SYD/NSW/AU

PostPosted: Tue Apr 29, 2008 10:53 pm    Post subject: Reply with quote

Hi Neddy Seagoon, I am working hard to grok this fully and onto my fifth gentoo install with this little beast.

Until I really have my head around the mount binds and the implications of traversing bindings for maintenance both during and after install I think I will continue to build and build again.

Here is the initial steps for my current approach:

Code:
/dev/sdc3 /mnt/custom ext3 rw 0 0
/dev/sdc4 /mnt/windows vfat rw 0 0
/dev/sdc2 /mnt/gentoo ext3 rw 0 0
/dev/sda2 /mnt/targetroot ext3 rw 0 0
/dev/sda1 /mnt/gentoo/boot ext2 rw 0 0
/mnt/custom/tmp /mnt/gentoo/tmp none rw,bind 0 0
/mnt/custom/var/tmp /mnt/gentoo/var/tmp none rw,bind 0 0
/mnt/custom/usr/portage /mnt/gentoo/usr/portage none rw,bind 0 0
/mnt/custom/usr/local/portage /mnt/gentoo/usr/local/portage none rw,bind 0 0


The external USB HDD has been made to have a
"BuildRoot" = /dev/sdc2 ---> /mnt/gentoo
"TargetRoot" = /dev/sda2 ---> /mnt/targetroot
"ThrashBind" = /dev/sdc3 ---? /mnt/custom

I am trying to ensure that while I build the root file system for the internal disk of the eee (/dev/sda2) I am doing all the heavy writing on another partition of the USBHDD - keeping the two areas discrete from the beginning. Therefore I have var/tmp, usr/portage, usr/local/portage and tmp all bound to the BuildRoot from the ThrashBind partition...

Have I missed any critical areas of intensive disk use?

And according to your comment about -o bind not surviving a chroot - do I have to (prior to chrooting)
umount the ThrashBindings (in /mnt/gentoo) and the ThrashPartition (dev/sdc3) in /mnt/custom
chroot
mount the thrashpartition
rebind the thrashpartition thrashbindings
env-update
. /etc/profile

How then does the mount -o bind /dev /mnt/gentoo/dev work??? Surely it survives the chrooting?

I will probably want some dev tools on the e so I am unsure how lean I will make it - want to get a solid base first.

Finally I have been reading up on the impact of journaling on the flash drives and was leaning toward believing the claims that a 4G flash disk will handle 4T of writing which should be more than the life of the machine?? I guess I trust Ext3 but have never had a reason not to trust Ext2... !!!and I backup!!! There was a link I found where someone did some pretty impressive statistical work on the lifespan of a modern SDHC; I am trying to find it...

Thanks for all the assistance and advice.

Will



[update] Samsung defends flash reliability in solid-state drives
SSD Myths and Legends - "write endurance"
So I am inclined to stay safe and sound with ext3 and backups in the confident knowledge that this kind of storage will be faster, cheaper and more reliable once I need to change the eeePC...
[/update]
_________________
\\'
ab extra
ab aeterno
a posse ad esse
ad fontes
\\'
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 27779
Location: 56N 3W

PostPosted: Wed Apr 30, 2008 6:21 pm    Post subject: Reply with quote

stardotstar,

An ASCII diagram may help, Its intended to be a part of the file system tree during a gentoo install, just before the chroot.

Code:
/
/proc   
/dev
/tmp
/usr
/var

/mnt/
   gentoo/
      boot/
      proc/
      dev/
      usr/
      tmp/
      var/

When /dev (at the top of the diagram) is bind mounted to /mnt/gentoo/dev in what subsequently becomes the chroot, its the same file system mounted in two places. When you chroot, effectively throwing away the /mnt/gentoo part of the path for everything inside the chroot, /dev is still there.

A symlink to a place outside the chroot fails as nothing inside the chroot can see anything outside. chroots are often used as 'jails' on servers for this very reason. (yes you can break out but its another layer).

There is no need to replicate the partition scheme you will use on the eeepc on the install drive. The kernel hides the partition scheme from whatever copy mechanism you use, except dd and thats not needed.

The idea behind journalled file systems is that after an unclean mount, they are much faster to restore to a self consistent state than non jounalled file systems. This is really only important for huge filesystems when you don't want a fsck taking days.
On 4G, the journal is a waste of 32Mb (or more) and a disk I/O slowdown.

Neither system helps the integrity of your user data.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
stardotstar
l33t
l33t


Joined: 10 Feb 2006
Posts: 720
Location: 2074/SYD/NSW/AU

PostPosted: Wed Apr 30, 2008 9:32 pm    Post subject: Reply with quote

Thank you sir. I feel much more confident with these concepts now. I guess that is why the mtab shows multiple instances of mount binds if one mistakenly initiates the mount more than once...


(having read something of your background I think I'll just go with ext2 :) )

Best Regards,
Will
_________________
\\'
ab extra
ab aeterno
a posse ad esse
ad fontes
\\'
Back to top
View user's profile Send private message
cfriedt
n00b
n00b


Joined: 12 Sep 2003
Posts: 56
Location: Montréal, Québec

PostPosted: Sat May 10, 2008 1:47 pm    Post subject: Reply with quote

Your best bet with the EEE PC is to use a binary gentoo distribution. If you're not comfortable building a binary distribution on your own, then you should probably just use tinderbox.

First, you'll need to modify the installed grub configuration in the EEE pc (so that you can roll your own kernel, if you're into that) - search around on google for 'advanced mode' and 'persistent write' if you haven't done that already.

Next, extract a stage3 filesystem to a 4GB USB stick, and try using the following in /etc/make.conf

USE="" # edit your use flags as you see fit, but they'll be ignored by
# the binary package installation
FEATURES="-ccache getbinpkg"
EMERGE_DEFAULT_OPTS="-K"
PORTAGE_BINHOST="http://tinderbox.dev.gentoo.org/default-linux/x86"
INSTALL_MASK="*.h *.a *.la *.pc /usr/share/doc /usr/share/info /usr/lib/pkgconfig /usr/share/locale /usr/share/info /usr/share/gtk-doc /usr/include /usr/share/gnome/help /usr/share/aclocal* /usr/share/automake* /usr/share/autoconf* /usr/share/gnuconfig"

Note that INSTALL_MASK will likely need to be set on a per-package basis - another feature still missing from portage.

Emerge is still a bit annoying even when using a pure bindist, often requiring the portage tree to be present - otherwise "(masked by:)" will often appear.

You should be able to do emerge -av1 xorg-x11 gnome gdm, mozilla-firefox-bin, etc, etc.

The EEE PC and other ultra-mobile platforms are where Gentoo is noticibly lacking - portage really doesn't have the best binary package support ... eveeentually, I still think it will be a superior binary package manager too, but there is some distance to go.
Back to top
View user's profile Send private message
stardotstar
l33t
l33t


Joined: 10 Feb 2006
Posts: 720
Location: 2074/SYD/NSW/AU

PostPosted: Sun May 11, 2008 10:03 pm    Post subject: Reply with quote

Thanks for the suggestions.

So far so good. I have successfully made a minimalist gentoo using portage mount bound when needed on an external HDD

My root system is 1.9G and includes Xorg minimal and fvwm, firefox, vim, ncftp and some various tools so far. I want to get the wireless and powermanagement sorted next but on the whole I am verry happy with the outcome of this little box.

I will sus out tinderbox - not had a lot of experience with gentoo on boxes with really constrained resources before :)

I'll build one on the internal slot sd card and have a go - I like the idea of a remote portage.

Will
_________________
\\'
ab extra
ab aeterno
a posse ad esse
ad fontes
\\'
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