• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: Adding to empty fstab  (Read 7761 times)
Tempel
Newbie
*

Karma: 0
Posts: 11


View Profile WWW
« on: March 16, 2010, 06:30:14 PM »

Dear everyone,

Some months ago, I installed a prebuilt Debian rootfs to an SD card on my SheevaPlug, and it's been working dreamily ever since.

Recently, I've decided that some extra storage capacity would be useful and would like to add an external USB drive (with its own power source, I know that).  So I went to edit /etc/fstab to mount the drive on boot, when I saw that its current contents are "# UNCONFIGURED FSTAB FOR BASE SYSTEM".

I know how to add an entry to an fstab, but I fear that just appending a line for the USB drive will make it go from some-magic-autoconfiguration into completely-broken.  I also know that there's more to an fstab than just the root partition, so I'm afraid of guessing my way through.

So, can anyone recommend how to get this filled in?  Since I think it might be relevant, here's the output of df:
Code:
Filesystem           1K-blocks      Used Available Use% Mounted on
tmpfs                   256876         0    256876   0% /lib/init/rw
udev                     10240       120     10120   2% /dev
tmpfs                   256876         4    256872   1% /dev/shm
rootfs                15413328    633608  13996764   5% /

PS: I'm considering mounting that USB drive at /home (but might just put it at /shared or something).  Any words on that?
Logged

Tempel
Newbie
*

Karma: 0
Posts: 11


View Profile WWW
« Reply #1 on: March 18, 2010, 11:29:45 AM »

Much thanks to DamonHD, who set me straight in a private message.  It turns out that all that autoconfig magic happens completely independently of the fstab.  As a result, I just needed to add the line to mount my disk, and none of the other mounted things were affected.

PS: I decided not to mount it at /home; I figured this would cause it to spin up with every login, which seems inefficient.  Then again, I've heard rumours of Seagate drives never spinning down in Linux, so I may be damned either way.  Is there any good way to watch for that without just standing by the drive and listening?
Logged

tromech
Newbie
*

Karma: 0
Posts: 2


View Profile
« Reply #2 on: April 04, 2010, 06:08:44 AM »

A related question:

I wanted to add some mount options to the root filesystem, like noatime to reduce the amount of write operations to the root fs (installed on the SD card).

However, I don't quite know where to do this, now that there are no entries in fstab. Can someone give me an advice of where to define sth. like this instead?

Thanks already.
Logged

Tempel
Newbie
*

Karma: 0
Posts: 11


View Profile WWW
« Reply #3 on: April 04, 2010, 07:28:23 AM »

I haven't tried it, but I think you can just add the rootfs entry to your fstab and add the options there.  I'm guessing that the rootfs automounts simply because it's defined in UBoot and isn't defined in the fstab; adding it to fstab should (I think) make it take those options.

I suggest giving it a try and, if your plug doesn't boot, you can take the SD card to any working computer and edit out the extra fstab line there.
Logged

dattaway
Jr. Member
**

Karma: 5
Posts: 91



View Profile WWW
« Reply #4 on: April 04, 2010, 09:27:16 AM »

If you want a nice list like fstab, but from currently mounted filesystems:

cat /etc/mtab

its the listing of currently mounted filesystems automagically created with the mount command.
Logged

tromech
Newbie
*

Karma: 0
Posts: 2


View Profile
« Reply #5 on: April 04, 2010, 03:22:14 PM »

Alright, I thought there was some other location than the fstab for these "system" partitions with my setup. Now I tried to enter the root partition with my additional options in fstab, which did work in fact. I do have some problems with the file system checks (fsck) at boot now that I didn't have before (even with setting the fstab pass flag to to 0), but I'll also get this sorted out somehow.

Thanks for the help!
Logged

madsepperl
Newbie
*

Karma: 0
Posts: 2


View Profile
« Reply #6 on: July 12, 2010, 11:30:59 PM »

Hi everyone,

I just started to play around with debian on my sheevaplug as well and ran into the same problems with fsck at boot.

With an empty /etc/fstab the system starts up without any problems:
Code:
tmpfs /lib/init/rw tmpfs rw,nosuid,mode=0755 0 0
proc /proc proc rw,noexec,nosuid,nodev 0 0
sysfs /sys sysfs rw,noexec,nosuid,nodev 0 0
udev /dev tmpfs rw,mode=0755 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0
devpts /dev/pts devpts rw,noexec,nosuid,gid=5,mode=620 0 0
rootfs / rootfs rw 0 0

Now when I add the following line to /etc/fstab in order to mount my external drive connected to the sheevaplug:
Code:
/dev/sda1 /mnt ext4 acl,user_xattr 1 2

on the next startup I run into an fsck error on the root filesystem:


EXT3 FS on mmcblk0p2, internal journal                                                                                                                                                                       
EXT3-fs: mounted filesystem with writeback data mode.                                                                                                                                                         
VFS: Mounted root (ext3 filesystem) on device 179:2.                                                                                                                                                         
Freeing init memory: 140K                                                                                                                                                                                     
INIT: version 2.86 booting                                                                                                                                                                                   
Starting the hotplug events dispatcher: udevd.                                                                                                                                                               
Synthesizing the initial hotplug events...done.                                                                                                                                                               
Waiting for /dev to be fully populated...done.                                                                                                                                                               
Activating swap...done.                                                                                                                                                                                       
Checking root file system...fsck from util-linux-ng 2.16.2
Usage: fsck.ext4 [-panyrcdfvtDFV] [-b superblock] [-B blocksize]
                [-I inode_buffer_blocks] [-P process_inode_size]
                [-l|-L bad_blocks_file] [-C fd] [-j external_journal]
                [-E extended-options] device

Emergency help:
 -p                   Automatic repair (no questions)
 -n                   Make no changes to the filesystem
 -y                   Assume "yes" to all questions
 -c                   Check for bad blocks and add them to the badblock list
 -f                   Force checking even if filesystem is marked clean
 -v                   Be verbose
 -b superblock        Use alternative superblock
 -B blocksize         Force blocksize when looking for superblock
 -j external_journal  Set location of the external journal
 -l bad_blocks_file   Add to badblocks list
 -L bad_blocks_file   Set badblocks list
fsck died with exit status 16
failed (code 16).
An automatic file system check (fsck) of the root filesystem failed. A manual fsck must be performed, then the system restarted. The fsck should be performed in maintenance mode with the root filesystem mo!
The root filesystem is currently mounted in read-only mode. A maintenance shell will now be started. After performing system maintenance, press CONTROL-D to terminate the maintenance shell and restart the .
Give root password for maintenance
(or type Control-D to continue):


I don't have the fsck problem on boot, when I boot the system from an sd-card with ubuntu.

What is different with debian ? Am I missing something ?

Many thanks in advance !

cheers,
Chris

Logged

madsepperl
Newbie
*

Karma: 0
Posts: 2


View Profile
« Reply #7 on: July 12, 2010, 11:49:50 PM »

Hi all again,

ok, I solved this issue by adding a line for / to /etc/fstab. My fstab now looks like this:

Code:
# UNCONFIGURED FSTAB FOR BASE SYSTEM
/dev/mmcblk0p2 / ext3 defaults,noatime 0 1
/dev/sda2 swap swap defaults 0 0
/dev/sda1 /mnt ext4 acl,user_xattr 1 2

The system now boots without any fsck errors [yippie ! :p ]

Still leaves the question, why ubuntu doesn't need a line for / in fstab respectively what's wrong with the debian install ?

cheers,
Chris
Logged

birdman
Sr. Member
****

Karma: 4
Posts: 443


View Profile WWW
« Reply #8 on: July 13, 2010, 05:56:16 PM »

Still leaves the question, why ubuntu doesn't need a line for / in fstab respectively what's wrong with the debian install
I had the same issue at the weekend (fsck at boot time until I added a / entry) as I switched from Ubuntu to Debian.
The difference is the S06checkroot.sh link in /etc/rcS.d, which looks for an entry for / (or a UUID entry that points at such a mounted dir).   Ubuntu doesn't have that.
The code looks as though it tries to handle the missing entry.  Not sure why it fails, but adding the line seems a reasonable workaround.
Logged

Pages: [1]
Print
Jump to: