WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Rebuilding fstab  (Read 6704 times)

Offline mbertrand

  • Full Member
  • ***
  • Posts: 225
Rebuilding fstab
« on: April 12, 2013, 08:02:04 AM »
I know that TC is scanning and updating fstab?
My fstab is in my .xfiletool.lst because I've added a line for usb stick.

My question is: what exactly is TC doing to update fstab. I have two drive and I can see that my second drive is always there and is configured to not be automatically mounted. This is correct?
What would happen if I would add a line manually for that drive and do backup? How would TC handle that?
Or maybe it may easier if someone would just explain in a nutshell the logic. I'm kind of new to Linux and sometimes a challenge for me to understand the code in the scripts.

Thanks for your time.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Rebuilding fstab
« Reply #1 on: April 12, 2013, 09:01:32 AM »
/etc/fstab is not saved.  It is rebuilt at each boot.
If you want another drive mounted at boot, add a mount command to /opt/bootlocal.sh.

Offline mbertrand

  • Full Member
  • ***
  • Posts: 225
Re: Rebuilding fstab
« Reply #2 on: April 12, 2013, 09:11:44 AM »
I have fstab in my list of files to backup beacause I added something releated to usb.
I'm going to try to explain this properly. I have two drives sda, sdb. sda1 being the bootable one.
after boot fstab contains the sdb1 configured as no auto mount and this all good. The problem is that it is configured to mount as
ext2 when it should be ext4. Now, if I go to the mount tool and mount it the fstab file gets updated(this is did not know) and now contains ext4 wich is good. So what is going on you think?

Also, because my fstab is in my xfiles.lst and I do backup the changes are persistent is this because the fstab is generated/updated before restore is done

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: Rebuilding fstab
« Reply #3 on: April 12, 2013, 09:21:33 AM »
If you want to keep a static fstab, in addition to backing it up, you need to use the "nofstab" bootcode.

But it's not clear what you want here - to automount the second drive?
The only barriers that can stop you are the ones you create yourself.

Offline mbertrand

  • Full Member
  • ***
  • Posts: 225
Re: Rebuilding fstab
« Reply #4 on: April 12, 2013, 09:30:19 AM »
The way TinyCore is doing by default is what I want but it does not seem to be detecting the right partition type for sdb1.
This what I'm doing. In bootlocal at some point I explicitly mount sdb1 using this syntax: mount moutpoint. I think using mount command this way is using fstab info (generated by TC) but fstab is ext2 when it should be ext4.

NOw for testing purpases I tried mounting sdb1 using TC mouting tool from control panel and it was able to mount it and it modified the fstab from ext2 to ext4

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11703
Re: Rebuilding fstab
« Reply #5 on: April 12, 2013, 11:20:24 AM »
Hi mbertrand
I believe  mnttool  might call  rebuildfstab  when it starts up. Try adding a rebuildfstab call to your bootlocal just prior
to the mount command and see if that makes any difference.

Offline mbertrand

  • Full Member
  • ***
  • Posts: 225
Re: Rebuilding fstab
« Reply #6 on: April 12, 2013, 11:39:45 AM »
I'll try that but I would like to know why it thinks it should be mounted as ext2 and not ext4. What is used to determine what format it should be mounted as?

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Rebuilding fstab
« Reply #7 on: April 12, 2013, 11:55:29 AM »
Read the rebuildfstab script.  You will see that it uses blkid to determine the file system type.

Also, since you put fstab in .xfiletool.lst it will NOT be backed up.

Offline mbertrand

  • Full Member
  • ***
  • Posts: 225
Re: Rebuilding fstab
« Reply #8 on: April 12, 2013, 11:57:28 AM »
Read the rebuildfstab script.  You will see that it uses blkid to determine the file system type.

Also, since you put fstab in .xfiletool.lst it will NOT be backed up.

Sorry typo I put it in .filetool.lst.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11703
Re: Rebuilding fstab
« Reply #9 on: April 12, 2013, 12:15:52 PM »
Hi mbertrand
Although it's possible, I find it hard to believe that the file system type would be misidentified upon boot up. I would
find it easier to believe that your backing up and restoring fstab is the cause of the problem. Fstab is not a static file.
It gets rebuilt every time a USB drive is plugged and unplugged.

Offline mbertrand

  • Full Member
  • ***
  • Posts: 225
Re: Rebuilding fstab
« Reply #10 on: April 12, 2013, 12:57:29 PM »
I guess fstab gets restored after it is  generated?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11703
Re: Rebuilding fstab
« Reply #11 on: April 12, 2013, 01:16:25 PM »
Hi mbertrand
Yes.

Offline mbertrand

  • Full Member
  • ***
  • Posts: 225
Re: Rebuilding fstab
« Reply #12 on: April 12, 2013, 01:24:46 PM »
Ok all has been solved and I deserve a kick in the as*. Thanks for all your help.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11703
Re: Rebuilding fstab
« Reply #13 on: April 12, 2013, 01:33:23 PM »
Hi mbertrand
Quote
... I deserve a kick in the as*.
That won't be necessary, though, I do think you should go stand in the corner and think about what you have done. ;D

Offline mbertrand

  • Full Member
  • ***
  • Posts: 225
Re: Rebuilding fstab
« Reply #14 on: April 16, 2013, 10:50:21 AM »
I'm back!! Is there a condition where after restoring fstab that the fstab is rebuilt.
I have fstab in my .files.lst. And Ive notices a few time now that after rebooting I don't have my changes. Some times it's there
and sometimes it is not.