Upstart on Ubuntu, btrfs

Started by Tapewolf, May 02, 2010, 04:56:26 AM

Previous topic - Next topic

Tapewolf

I've almost succeeded in converting the root filesystem to btrfs, however something is failing with the mount during startup and / ends up read-only.
If I manually mount /dev/sda6 / -o remount,rw (or whatever) it works and the system is usable from that point on.

At this stage I have a choice - either frig it into working, or reformat it as ext3 again and wait until the tools have caught up (naturally I backed it up prior to this endeavour, and /boot and /home/jpmorris are on ext2 and ext3 respectively).

It occurs to me that I can probably force it to do the abovementioned remount after 'mountall' has run, but I'm not familiar enough with Upstart to know where it should go.  I still have the 32-bit install running, so I can go in and fix things if I break them, so no big deal there.

Any suggestions?  Anyone done this kind of stuff before?

J.P. Morris, Chief Engineer DMFA Radio Project * IT-HE * D-T-E


RobbieThe1st

If I had the problem, I'd try adding it to the root crontab(sudo crontab -e) as an @reboot line.
It -may- work, and its probably not the best solution, but it just might work.

Pasteris.ttf <- Pasteris is the font used for text in DMFA.

VAE

Not that much of an expert, but one of the things i would do , if the normal,fstab mount was getting messed up is just put a shellscript with the above command -  /sbin/mount /dev/sda6 / -o remount,rw and insert its execution into the rc.d  scripts just after normal mount is done.
What i cannot create, i do not understand. - Richard P. Feynman
This is DMFA. Where major species don't understand clothing. So innuendo is overlooked for nuendo. .
Saphroneth



llearch n'n'daCorna

wouldn't work, danman. At that point of the boot process on debian/ubuntu, it's runnign off an initrd, so anything you edit has to be pushed into there.

I'm... hrm.

Have you looked in /var/log/boot to see what mountall is objecting to, tape? boot and dmesg and the like?
Thanks for all the images | Unofficial DMFA IRC server
"We found Scientology!" -- The Bad Idea Bears

VAE

Ouch - my system (slackware) does not use an ramdisk - i have  used this kludge to resolve something else before.
But still - one can insert it somewhere in the scripts at the beginning, no? I mean , it mounts / read only, so launching mount from there should not be a problem...
What i cannot create, i do not understand. - Richard P. Feynman
This is DMFA. Where major species don't understand clothing. So innuendo is overlooked for nuendo. .
Saphroneth



Tapewolf

Quote from: danman on May 02, 2010, 07:28:37 AM
Not that much of an expert, but one of the things i would do , if the normal,fstab mount was getting messed up is just put a shellscript with the above command -  /sbin/mount /dev/sda6 / -o remount,rw and insert its execution into the rc.d  scripts just after normal mount is done.

I could be wrong, but my understanding is that Upstart replaces those and they're just kept around for compatibility.  It might not actually scan them anymore.

I think the correct location in this instance is /etc/init/mountall.conf
...however, getting it to mount (or remount) / at this point just fails, for some reason it really doesn't seem to be able to mount the btrfs filesystem until later on.

No idea what's going on, I might have to give up and go back to ext3.

Quote from: llearch n'n'daCorna on May 02, 2010, 08:48:42 AM
wouldn't work, danman. At that point of the boot process on debian/ubuntu, it's runnign off an initrd, so anything you edit has to be pushed into there.

I haven't made one, it's just using a custom kernel with all the filesystems statically linked.

QuoteHave you looked in /var/log/boot to see what mountall is objecting to, tape? boot and dmesg and the like?

They're blank, because it can't write to them at the critical point.

J.P. Morris, Chief Engineer DMFA Radio Project * IT-HE * D-T-E


llearch n'n'daCorna

#6
The initramfs scripts are a bit interesting, because they use the system mount switch to switch the root fs from the initramfs to the physical disk after the system boots. So depending on when in the cycle your scripts are, can change which of two identically-named scripts get run. And when the ramfs is root, the real disk is usually not mounted at all, because it's usually waiting to be checked etc.

It's all a bit mystical, but you _can_ figure it out. The tricky part is getting your script into the ramdisk in the first place.


Tape, is it possible that the default scripts are trying to fsck it as ext3 rather than btrfs?


... also, what advantages does btrfs give you over ext2/3/4 or reiserfs?

Edit:
Tape, dmesg is printing out the kernel memory. I can guarantee you that _that_ is writable, because it's a memory construct. ;-]

Sounds to me like the btrfs driver isn't in the kernel, and the module isn't available until later... possible?
Thanks for all the images | Unofficial DMFA IRC server
"We found Scientology!" -- The Bad Idea Bears

Tapewolf

Quote from: llearch n'n'daCorna on May 02, 2010, 09:09:10 AM
The initramfs scripts are a bit interesting, because they use the system mount switch to switch the root fs from the initramfs to the physical disk after the system boots. So depending on when in the cycle your scripts are, can change which of two identically-named scripts get run. And when the ramfs is root, the real disk is usually not mounted at all, because it's usually waiting to be checked etc.
It's all a bit mystical, but you _can_ figure it out. The tricky part is getting your script into the ramdisk in the first place.
Yes, so as a rule I don't bother.

QuoteTape, is it possible that the default scripts are trying to fsck it as ext3 rather than btrfs?
No.  There was an earlier problem where btrfsck was complaining about the -a option and aborting.  I used a shell wrapper around btrfsck to ignore -a if it was passed.
fsck is completing, but the mount isn't.

What's aggravating is that in Ubuntu they have moved the actual process of finding the filesystems and mounting them into a binary program called 'mountall' which isn't present in Debian.  I haven't got the source code for it yet, frankly if it gets to that point I'll probably roll back the thing.

Quote... also, what advantages does btrfs give you over ext2/3/4 or reiserfs?
It's basically the spiritual successor to Reiser, which has a few problems with maintenance and future directions now that its architect is in jail.
Basically I want to use it on / for a year or so and then decide if I want to move /home over to it, because it has zfs-style checksumming and other anti-corruption features.
As an aside, home is currently 500GB and takes over 30 minutes to fsck, which it does every 22 frigging days, usually when I just want to quickly check something before going to work.  I'm not entirely sure that btrfs would solve that problem, but hey, I was an early adopter of Reiserfs back in the day, so it's just the sort of thing I'd do as an experiment.

Quote
Tape, dmesg is printing out the kernel memory. I can guarantee you that _that_ is writable, because it's a memory construct. ;-]
Yes, that has 13 seconds of stuff.  It doesn't say anything interesting, unfortunately.  I can give you a dump of it if you're curious.

QuoteSounds to me like the btrfs driver isn't in the kernel, and the module isn't available until later... possible?
I'm 99% sure it's statically-linked into the kernel.  In fact, I've just double-checked the config options.  AFAIK it would just have panicked the moment it tried to mount for the purpose of starting init if that was the case, rather than booting mostly and continually complaining as the scripts fail because they can't write to the filesystem.

J.P. Morris, Chief Engineer DMFA Radio Project * IT-HE * D-T-E


llearch n'n'daCorna

Hrm. It _should_ fail, though. And yes, the reiserfs problem of the architect being in jail did make a number of people object. I can't see why - after all, his ability to code isn't dependant on if he killed his wife or not, in the same way that the government isn't dependant on if the president boinks his intern or not. But I can see how people might jump to conclusions...

Getting slightly back to the point, tune2fs can adjust the 22 days thing for you. And, since i think you said it was ext3, I'd put it at something like 180 days or 90 mounts, myself...

Hrm. I'll turn it over in my head and see if anything comes up. :-/
Thanks for all the images | Unofficial DMFA IRC server
"We found Scientology!" -- The Bad Idea Bears

Tapewolf

Quote from: llearch n'n'daCorna on May 02, 2010, 09:49:25 AM
Hrm. It _should_ fail, though. And yes, the reiserfs problem of the architect being in jail did make a number of people object. I can't see why - after all, his ability to code isn't dependant on if he killed his wife or not, in the same way that the government isn't dependant on if the president boinks his intern or not. But I can see how people might jump to conclusions...
Personally I agree, but IIRC it has caused a number of the developers to jump ship, which is more worrying to me from a practical viewpoint than whether Hans Reiser is or is not in jail.  Chris Mason, who is the lead on btrfs was actually an ex-Reiser developer, IIRC.
Politics aside, btrfs is supposed to have most of the goodies from zfs and it's ultimately intended to replace ext4, so I'm interested to see what it's like.

QuoteGetting slightly back to the point, tune2fs can adjust the 22 days thing for you. And, since i think you said it was ext3, I'd put it at something like 180 days or 90 mounts, myself...
Yeah, I set it to 60 mounts yesterday, I think.  Any idea how you can get that information back out of the FS while it's running?

I think it was 22 mounts actually, but since I power this machine on and off as I need it, it basically came to the same thing at the end of the day.

J.P. Morris, Chief Engineer DMFA Radio Project * IT-HE * D-T-E


llearch n'n'daCorna

tune2fs <partition> will print out a list of what it has, IIRC. Certainly tune2fs has the option to print it out...
Thanks for all the images | Unofficial DMFA IRC server
"We found Scientology!" -- The Bad Idea Bears

Tapewolf

Quote from: llearch n'n'daCorna on May 02, 2010, 11:42:54 AM
tune2fs <partition> will print out a list of what it has, IIRC. Certainly tune2fs has the option to print it out...

I can't remember if I tried that.  I was looking for options to print it out, but I didn't seem to get anyway.

Now, for those who might wish to try this at home, the reason it was failing was because I still had 'errors=continue' in the /etc/fstab entry for root.  ButterFS doesn't recognise this and the mount failed.  I set it to 'defaults' instead.

I was able to remove all the crap I added into /etc/init/mountall.conf and it all works fine.

J.P. Morris, Chief Engineer DMFA Radio Project * IT-HE * D-T-E


hapless

Quote from: Tapewolf on May 02, 2010, 01:34:41 PM
Quote from: llearch n'n'daCorna on May 02, 2010, 11:42:54 AM
tune2fs <partition> will print out a list of what it has, IIRC. Certainly tune2fs has the option to print it out...

I can't remember if I tried that.  I was looking for options to print it out, but I didn't seem to get anyway.

dumpe2fs -h /dev/sdXX
Chaosnet device not responding - check breaker on the Unibus

Tapewolf

Quote from: hapless on May 02, 2010, 02:36:09 PM
dumpe2fs -h /dev/sdXX

Oh, right.  Documentation implied that would dump the superblocks, and not any data that was useful to what I was attempting.  Should have tried it, I guess.

J.P. Morris, Chief Engineer DMFA Radio Project * IT-HE * D-T-E


llearch n'n'daCorna

tune2fs -l <device> will also print a whole pile of stuff.
Thanks for all the images | Unofficial DMFA IRC server
"We found Scientology!" -- The Bad Idea Bears

ShadesFox

So do you have btrfs running now?  I would like to try it too, mostly for its support for silly things like rolling back file systems to a certain date.  Especially when I do silly things like delete massive files off the disks that will require several days to redownload.  And fsck on 3 TB disk arrays is terrible.
The All Purpose Fox

Tapewolf

Quote from: ShadesFox on May 02, 2010, 05:34:09 PM
So do you have btrfs running now?  I would like to try it too, mostly for its support for silly things like rolling back file systems to a certain date.  Especially when I do silly things like delete massive files off the disks that will require several days to redownload.  And fsck on 3 TB disk arrays is terrible.

I do.  To summarise, the most important things for a Ubuntu installation were:
1. Making sure you have btrfs available at boot time.  I used a custom-compiled kernel, the stock one may not support it.
2. A wrapper around btrfsck so that it ignores the -a parameter
3. options as 'defaults' in the fstab

Apart from that, it was just a matter of converting from ext3 to btrfs using btrfs-convert, this obviously has to be done from a secondary installation or a livecd since you can't convert / while the machine is running ;-)

I do still have one problem, and that is that Windows 7 has started to destroy Grub each time it is booted, rendering the machine unbootable afterwards.  I am still looking into this.

J.P. Morris, Chief Engineer DMFA Radio Project * IT-HE * D-T-E


VAE

can you not set MBR to read only? Is usually called virus protection in bios...
What i cannot create, i do not understand. - Richard P. Feynman
This is DMFA. Where major species don't understand clothing. So innuendo is overlooked for nuendo. .
Saphroneth



Tapewolf

Quote from: danman on May 03, 2010, 08:37:35 AM
can you not set MBR to read only? Is usually called virus protection in bios...
IIRC I got out of the habit of doing that when I was using LILO as the bootloader, but no - this BIOS doesn't seem to support that.

Besides, Windows 7 has now completely destroyed itself, to whit:

Status: 0xc000000f
Info: The boot selection failed because a required device is inaccessible.

Repairing from the DVD fails, saying that it cannot repair the boot manager.

This is irritating because I was playing Fallout 3, but that game and Oblivion were the only things I was actually using Windows for anyway.  I will have to ponder my next move carefully.
Maybe a new thread is in order since the problem has moved into a completely different realm.

J.P. Morris, Chief Engineer DMFA Radio Project * IT-HE * D-T-E


Mao

Can't much help you on the Ubuntu side of things or even the issue itself, but I'm surprised to see Windows 7 having a glitch with GRUB.

VAE

Sorry for slight threadjack, but is F3 as good as the previous two?
What i cannot create, i do not understand. - Richard P. Feynman
This is DMFA. Where major species don't understand clothing. So innuendo is overlooked for nuendo. .
Saphroneth



Tapewolf

Quote from: danman on May 03, 2010, 09:26:42 AM
Sorry for slight threadjack, but is F3 as good as the previous two?

I wouldn't know, I haven't played them.  I'm not really into post-apocalypse scenarios, read far too many as a kid.  I took up this one because Keaton kept saying how great it was, and I did like Morrowind and Oblivion.  It took a little getting into, but I can definitely see why she likes it.

J.P. Morris, Chief Engineer DMFA Radio Project * IT-HE * D-T-E


ShadesFox

Have you been using Photoshop or other Adobe programs on Windows 7?  If you do then the Adobe programs will overwrite the last block of the MBR as part of its copy protection mechanisms.
The All Purpose Fox

Tapewolf

Quote from: ShadesFox on May 03, 2010, 10:23:52 AM
Have you been using Photoshop or other Adobe programs on Windows 7?  If you do then the Adobe programs will overwrite the last block of the MBR as part of its copy protection mechanisms.
No, and that sounds like a good reason never to do so.

J.P. Morris, Chief Engineer DMFA Radio Project * IT-HE * D-T-E