|
| |||
| /etc/fstab query A silly question. I want to move a directory tree from one partition to another on my mythbuntu system as I think it will make backup easier. It will also be a good exercise for this novice. Specifically, it currently has /etc/lib on a separate partition from /, and I want to move all of it except /etc/lib/mythtv back to the partition holding /. I plan to mount the partitions under a live distro then mv the directories to the right partitions, then edit /etc/fstab to reflect the changes. I'll be doing it on a 'spare' drive so no real grief if I mess it up. That raises a chicken and egg situation in my mind: /etc/fstab defines which partitions are to be mounted and what's on them. How then does the system at boot time (would it be the kernel?) find /etc? Phil |
| |||
| Re: /etc/fstab query Phil B writes: > How then does the system at boot time (would it be the kernel?) find > /etc? /etc has to be on the root partition. -- John Hasler jhasler@newsguy.com Dancing Horse Hill Elmwood, WI USA |
| |||
| Re: /etc/fstab query On Monday 26 October 2009 22:33 in alt.os.linux, somebody identifying as Phil B wrote... > A silly question. > > I want to move a directory tree from one partition to another on my > mythbuntu system as I think it will make backup easier. It will also > be a good exercise for this novice. > Specifically, it currently has /etc/lib on a separate partition from > /, and I want to move all of it except /etc/lib/mythtv back to the > partition holding /. > > I plan to mount the partitions under a live distro then mv the > directories to the right partitions, then edit /etc/fstab to reflect > the changes. I'll be doing it on a 'spare' drive so no real grief if I > mess it up. There's a way to do it without a live CD as well. Just "mount --bind" the root filesystem to - say - */mnt* and then copy the contents of the regularly mounted */etc/lib* filesystem to the */etc/lib* directory on the bind-mounted root filesystem - this would then be */mnt/etc/lib.* Next, you unmount the bind-mounted root filesystem and the separate */etc/lib* filesystem, but be careful here as something may actually be using files on that filesystem, so it's best to do it from single-user maintenance mode, i.e. runlevel 1. > That raises a chicken and egg situation in my mind: > /etc/fstab defines which partitions are to be mounted and what's on > them. > How then does the system at boot time (would it be the kernel?) find > /etc? The bootloader passes the filesystem designated as the root filesystem to the kernel. When the kernel is decompressed in memory - which is after the processor has been switched into protected mode (or long mode on x86-64) - the boot parameters and such are copied from low memory to high memory so the kernel will still have access to that information once the low memory that was used by the realmode code - i.e. bootloader and kernel bootstrapping code - has been cleared out. If you've got a kernel that uses an /initrd,/ it will load its driver modules from there, and if it's a kernel built to boot without an /initrd/ it'll have the necessary drivers built-in for directly accessing the root filesystem - other drivers may then still be loaded as modules, as long as the kernel knows where to find them, and this would be the */lib/$(uname -r)/modules* directory on the known root filesystem. Now, the root filesystem was specified as a boot option in the bootloader and this information copied to where the kernel can access it once it has decompressed. The kernel will then check this root filesystem for errors, and if none are found, it will launch */sbin/init* - this is hardcoded into the kernel as a default, but can be overridden with a boot parameter, as is done to boot up into single-user maintenance mode. Once /init/ starts running - at this stage, userspace is already active - it starts forking off some processes which take care of the the mounting of the filesystems as specified in */etc/fstab* and the starting of the necessary daemons for the default runlevel. So to put a long story short: the kernel doesn't actually look for */etc* at boot, but it does look for the directories */lib* - if it needs to load modules directly off of the root filesystem - and */sbin,* both residing on the filesystem of which it was made clear by the bootloader that this is the root filesystem to use, and /init/ takes care of the rest. -- *Aragorn* (registered GNU/Linux user #223157) |
| |||
| Re: /etc/fstab query On Mon, 26 Oct 2009 21:33:23 -0000, "Phil B" <phil.remove.brady******** dot co dot united kingdom> wrote: >A silly question. > >I want to move a directory tree from one partition to another on my >mythbuntu system as I think it will make backup easier. It will also be a >good exercise for this novice. >Specifically, it currently has /etc/lib on a separate partition from /, and >I want to move all of it except /etc/lib/mythtv back to the partition >holding /. Something like: move /etc/lib/mythtv/* to temp location (maybe tarball?) umount /etc/lib mount </etc/lib partiton> to /mnt move /mnt/* to /etc/lib umount /mnt mkdir /etc/lib/mythtv mount <old /etc/lib partition> /etc/lib/mythtv move (temp /etc/lib/mythtv/* files) /etc/lib/mythtv edit /etc/fstab Done! (?) Grant. -- http://bugsplatter.id.au |
| |||
| Re: /etc/fstab query "Phil B" <phil.remove.brady******** dot co dot united kingdom> writes: >A silly question. >I want to move a directory tree from one partition to another on my >mythbuntu system as I think it will make backup easier. It will also be a >good exercise for this novice. >Specifically, it currently has /etc/lib on a separate partition from /, and >I want to move all of it except /etc/lib/mythtv back to the partition >holding /. mkdir /etc/libnew rsync -av --exclude=**/mythtv/ /etc/lib/ /etc/libnew umount /etc/lib ; rmdir /etc/lib; mv /etc/libnew /etc/lib and you are done. Note that you have now lost the /etc/lib/mythtv since it is not mounted anywhere. I am not sure what you wanted done with it. Now edit /etc/fstab and remove the /etc/lib mount line. You do not have to reboot or use a live partition, unless /etc/lib contains absolutely crucial libraries that bash, mv, rm or rmdir use. >I plan to mount the partitions under a live distro then mv the directories >to the right partitions, then edit /etc/fstab to reflect the changes. >I'll be doing it on a 'spare' drive so no real grief if I mess it up. >That raises a chicken and egg situation in my mind: >/etc/fstab defines which partitions are to be mounted and what's on them. >How then does the system at boot time (would it be the kernel?) find /etc? /etc HAS to be on the / partition. It finds it by the fact that / is automatically mounted and in grub or lilo the system is told which the / partition is. The / partition MUST contain /etc/ and /lib, and /bin. Those cannot be on a separate partition. I have no idea what you have in /etc/lib, but it must not be stuff crucial to the boot. |
| |||
| Re: /etc/fstab query "Phil B" <phil.remove.brady******** dot co dot united kingdom> wrote in message news:wpGdnernhos8iHvXnZ2dnUVZ8v2dnZ2d@bt.com... >A silly question. > > I want to move a directory tree from one partition to another on my > mythbuntu system as I think it will make backup easier. It will also be a > good exercise for this novice. > Specifically, it currently has /etc/lib on a separate partition from /, > and I want to move all of it except /etc/lib/mythtv back to the partition > holding /. > > I plan to mount the partitions under a live distro then mv the directories > to the right partitions, then edit /etc/fstab to reflect the changes. > I'll be doing it on a 'spare' drive so no real grief if I mess it up. > > That raises a chicken and egg situation in my mind: > /etc/fstab defines which partitions are to be mounted and what's on them. > How then does the system at boot time (would it be the kernel?) find > /etc? > > Phil > > Thanks for your helpful replies everyone. Actually, I misquoted the tree I want to manipulate - it is /var/lib, but that still holds stuff which needs to be open like the logs. Sorry, but it was a long day yesterday! Phil |
| |||
| Re: /etc/fstab query "Phil B" <phil.remove.brady******** dot co dot united kingdom> wrote in message news:wpGdnernhos8iHvXnZ2dnUVZ8v2dnZ2d@bt.com... >A silly question. > > I want to move a directory tree from one partition to another on my > mythbuntu system as I think it will make backup easier. It will also be a > good exercise for this novice. > Specifically, it currently has /etc/lib on a separate partition from /, > and I want to move all of it except /etc/lib/mythtv back to the partition > holding /. > > I plan to mount the partitions under a live distro then mv the directories > to the right partitions, then edit /etc/fstab to reflect the changes. > I'll be doing it on a 'spare' drive so no real grief if I mess it up. > > That raises a chicken and egg situation in my mind: > /etc/fstab defines which partitions are to be mounted and what's on them. > How then does the system at boot time (would it be the kernel?) find > /etc? > > Phil > Thanks for your helpful replies everyone. Actually, I misquoted the tree I want to move - it's /var/lib but your comments are still relevant. Sorry - it was a long day yesterday! Phil |
| |||
| Re: /etc/fstab query "Phil B" <phil.remove.brady******** dot co dot united kingdom> wrote in message news:wpGdnernhos8iHvXnZ2dnUVZ8v2dnZ2d@bt.com... >A silly question. > > I want to move a directory tree from one partition to another on my > mythbuntu system as I think it will make backup easier. It will also be a > good exercise for this novice. > Specifically, it currently has /etc/lib on a separate partition from /, > and I want to move all of it except /etc/lib/mythtv back to the partition > holding /. > > I plan to mount the partitions under a live distro then mv the directories > to the right partitions, then edit /etc/fstab to reflect the changes. > I'll be doing it on a 'spare' drive so no real grief if I mess it up. > > That raises a chicken and egg situation in my mind: > /etc/fstab defines which partitions are to be mounted and what's on them. > How then does the system at boot time (would it be the kernel?) find > /etc? > > Phil > > Thanks for your helpful replies everyone. Actually, I misquoted the tree I want to move - it's /var/lib but your comments are still relevant. Sorry - it was a long day yesterday! Phil |
| |||
| Re: /etc/fstab query "Phil B" <phil.remove.brady******** dot co dot united kingdom> writes: >"Phil B" <phil.remove.brady******** dot co dot united kingdom> wrote in >message news:wpGdnernhos8iHvXnZ2dnUVZ8v2dnZ2d@bt.com... >>A silly question. >> >> I want to move a directory tree from one partition to another on my >> mythbuntu system as I think it will make backup easier. It will also be a >> good exercise for this novice. >> Specifically, it currently has /etc/lib on a separate partition from /, >> and I want to move all of it except /etc/lib/mythtv back to the partition >> holding /. >> >> I plan to mount the partitions under a live distro then mv the directories >> to the right partitions, then edit /etc/fstab to reflect the changes. >> I'll be doing it on a 'spare' drive so no real grief if I mess it up. >> >> That raises a chicken and egg situation in my mind: >> /etc/fstab defines which partitions are to be mounted and what's on them. >> How then does the system at boot time (would it be the kernel?) find >> /etc? >> >> Phil >> >> >Thanks for your helpful replies everyone. >Actually, I misquoted the tree I want to manipulate - it is /var/lib, >but that still holds stuff which needs to be open like the logs. /var/lib does not have logs. That is /var/log. >Sorry, but it was a long day yesterday! >Phil |
| Bookmarks |
| Thread Tools | |
| |
| | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| SP2 query... | ross m. greenberg | Windows Vista | 3 | 06-15-2009 07:30 AM |
| fstab and ntfs-3g | heavytull | Linux | 5 | 03-27-2008 02:30 PM |
| RE: QUERY | JimmiBoi | Windows XP | 3 | 01-04-2007 04:27 AM |
| Re: QUERY | lurkswithin | Windows XP | 0 | 01-04-2007 04:23 AM |
| Query | Capt K Ripendran | Windows XP | 6 | 01-04-2007 04:20 AM |
| New To Technology Questions? | Do You Need Help with Your Computer or Device? | Do You Need Help with this site? |