WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: rebuildfstab  (Read 5436 times)

Offline mbertrand

  • Full Member
  • ***
  • Posts: 225
rebuildfstab
« on: January 10, 2014, 09:30:27 AM »
At some point I've added 'NODELALLOC' to an existing line. This was a second drive. I did backup and all is fine. We have many test computers where we all do the same thing. Some of us started noticing that the extra option we added 'NODELALLOC' was gone.
Could this had happen? Could it be rebuildfstab script bug?

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: rebuildfstab
« Reply #1 on: January 10, 2014, 10:16:35 AM »
Rebuildfstab strips out any lines that contain "Added by TC" then add lines for each block device.
If you remove the "Added by TC" the line will not be touched, but you will still get an added line.
You could request a change so that a line not be added for $DEVROOT/$DEVNAME if it is already in $TMP.

Offline mbertrand

  • Full Member
  • ***
  • Posts: 225
Re: rebuildfstab
« Reply #2 on: January 10, 2014, 10:41:35 AM »
I was actually thinking of that but that does not seem to work. Now for whatever reason I put back the option and keeped
the comment at the end did the backup, rebooted and the optoin is still there.

This is my line that I edited:

/dev/sdb1       /mnt/sdb1       ext4     noauto,users,exec,nodelalloc    0 0 # Added by TC

and it like that on reboot.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: rebuildfstab
« Reply #3 on: January 10, 2014, 10:47:49 AM »
Run rebuildfstab and see if it is still there.

Offline mbertrand

  • Full Member
  • ***
  • Posts: 225
Re: rebuildfstab
« Reply #4 on: January 10, 2014, 10:49:34 AM »
When is rebuildfstab executed? Before Restore?

Offline mbertrand

  • Full Member
  • ***
  • Posts: 225
Re: rebuildfstab
« Reply #5 on: January 10, 2014, 10:56:33 AM »
I ran rebuildfstab and the line was removed. Just to be clear, the fstab is in the .filetool.lst .
Is rebuildfstab ran also at some othertime?

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: rebuildfstab
« Reply #6 on: January 10, 2014, 11:05:20 AM »
Many things trigger it, such as inserting or removing a USB device, or clicking refresh on mnttool.
I will submit a patch.

Offline mbertrand

  • Full Member
  • ***
  • Posts: 225
Re: rebuildfstab
« Reply #7 on: January 10, 2014, 11:19:01 AM »
Yes I can confirm all of this. Putting my usb stick in removed my line. This would explain why, sometimes, when I do backup, I end up with my changes lost. I due allot of testing and backups and actually always inserting usb stick!!
So, How can I get around this? You mentioned a patch, for what exactly?

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: rebuildfstab
« Reply #8 on: January 10, 2014, 11:28:22 AM »
I submitted for approval a change to rebuildfstab to not replace fstab entries for a device that does not have "Added by TC" on the line.
If accepted, it will appear in a future release or release candidate.

Offline mbertrand

  • Full Member
  • ***
  • Posts: 225
Re: rebuildfstab
« Reply #9 on: January 10, 2014, 11:45:26 AM »
Thats great thanks. I have no idea on the procedures for getting updates. These changes will come on the next update?
Or there will be a patch? How do I know its been changed? Sorry but I don't know how this works!

Also, in the meanwhile, any temp ideas to fix this? We have many pc out there that absolutely needs this fixed.
But at the same time I don't want to change TCs files from core.gz onles thats the only way for now. I believe that I can completely bypass the rebuilt with NOFSTAB but this only during boot?

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: rebuildfstab
« Reply #10 on: January 10, 2014, 12:13:44 PM »
If you mount the drive in bootlocal.sh, you can use a full mount command.
That would not even consult fstab.
Ex:
mount -ousers,exec,nodelloc /dev/sdb1 /mnt/sdb1



Offline mbertrand

  • Full Member
  • ***
  • Posts: 225
Re: rebuildfstab
« Reply #11 on: January 10, 2014, 12:42:16 PM »
Ok thanks that sound like a good idea i'll try it.

Offline mbertrand

  • Full Member
  • ***
  • Posts: 225
Re: rebuildfstab
« Reply #12 on: January 10, 2014, 01:36:28 PM »
Confused again!. I already have in my bootlocal mount command to mount sdb1 like this:
mount $SECOND_DRIVE_MOUNT_FOLDER. Si I guess with this syntax it is using fstab for mount?
So when is the first drive getting mounted and is it using fstab?

/dev/sda1       /mnt/sda1       ext4     noauto,users,exec    0 0 # Added by TC
/dev/sdb1       /mnt/sdb1       ext4     noauto,users,exec    0 0 # Added by TC

Is tc-config mounting? I thought that lines in fstab with noauto don't get mounted?
Maybe would be better just quick explanation of how TC does mounting.
Thanks

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: rebuildfstab
« Reply #13 on: January 10, 2014, 01:55:30 PM »
Core only mounts filesystems that are the target of tce=, home=, or opt=.
All other filesystems must be mounted by the user.
The tce, home, and opt filesystems are mounted using fstab created by rebuildfstab.
They will be mounted before restore is run, so you cannot change the options by backing up fstab.
You could use mount -oremount to change the mount options on the already mounted filesystems in bootlocal.sh.
I don't know why you are concerned about this though,  because nodelalloc is the default.

Offline mbertrand

  • Full Member
  • ***
  • Posts: 225
Re: rebuildfstab
« Reply #14 on: January 10, 2014, 02:08:38 PM »
We are concerned because we have customers that sometimes need to perform some function and then restart the pc and are loosing data. We found that nodelalloc solved this problem or we think it did. When you say it is the default you mean for ext4.
It does not seem that way. Can you elaborate on this and thinks for taking the time we appreciate it.