Sponsored Content
Operating Systems Linux Gentoo automating chroot and mount/unmount Post 302200682 by duderonomy on Thursday 29th of May 2008 08:53:13 PM
Old 05-29-2008
Thank you for the info!
Quote:
Why do you need to un-mount it ? Try < -f > flag, for force.
Hey! maybe there is a work-around?...

Perhaps I should describe the goal? That always seems to help. Smilie

The motivation for chroot'ing is that I am not familiar with another way
to run mkinitrd. Honestly, I am surprised there is not -root option such
as with the rpm command or tar's -C, etc. If I could specify my root
file system on the command line then I would not need to chroot to
run mkinitrd.

So, to answer your question, the reason I believe I need to unmount, is
because after chroot exits, I archive the entire file system with tar.
If I do not unmount, tar complains with errors that the file system is
mounted or some such message. I can set up the situation again and
fetch the exact error message.

Through experience, I know that if I unmount properly, I avoid the
tar error when creating the tar archive.

Cheers,
:-D
 

10 More Discussions You Might Find Interesting

1. Linux

chroot?

If i were to create a new user for my ftp would chroot be the proper command to set there root directory as the file i've put all my FTP stuff in? Also would that jail them, or would they beable to get out of the set directory? (0 Replies)
Discussion started by: byblyk
0 Replies

2. AIX

how do i unmount ?

hi all, I am new to AIX as well as UNIX also ,i have a question One of my program has created a new filesystem on the system..... df shows : /dev/fslv04 2031616 2030648 1% 3 1% /replicas/source when i tried to umount the above filesystem by umount... (3 Replies)
Discussion started by: vamshi_k
3 Replies

3. Red Hat

Unbale ot mount chroot /sys/image

Hi frds i need ur help on this..! I am using redhat 9.0 recently someone has messed with mine filesystem and anyhow managed to hide mine linux partition both hd0,0 and hd0,1 ..!This is sick..i got mine Xp partition also hidden by this. I tried booting with linux rescue disk..but fail to mount to... (2 Replies)
Discussion started by: nicknihal
2 Replies

4. HP-UX

Cannot unmount mount points??

When taking a snap, I have a script that stops any active snap. When running the script, I'm getting a message that u02 and u04 are already mounted. How can I find out what process(es) is/are latching on the these mount points? Thank you for your time. (1 Reply)
Discussion started by: genzbeat
1 Replies

5. HP-UX

/usr out of disk space need to unmount/ expand volume /mount

Greetings, I am running HP-UX 10.2 and /usr is out of disk space already. I installed IE 5.0 for UNIX on my machine under /usr and browsed the Internet for a while and presto no more disk space. I have plenty of hard disk space on my computer so would like to expand the size of the volume. The... (5 Replies)
Discussion started by: Dirk_
5 Replies

6. OS X (Apple)

Can't Mount Disk / Image after bad unmount

I have had a little issue with one of my disks, the usb cacble was pulled out and one of the external drives on it would no longer mount. I used First Aid and it verified and repaired both OK / nothing to do). After lots of messing around and not being able to mount I used Drive Genius 2 and that... (1 Reply)
Discussion started by: Cranie
1 Replies

7. Shell Programming and Scripting

if (disk is mounted) unmount if (disk is unmounted) mount

Hey there, sorry if this is a bit too much of a noob question, trying to get to grips with a simple bash script - but i have done ZERO bash scripting. basically having worked out how to mount and unmount disks using: disktool -m *device* & disktool -e *device* - and looking at the result of... (2 Replies)
Discussion started by: hollister
2 Replies

8. Shell Programming and Scripting

Cygwin bash script to unmount and mount an XP partition

As stated, I am looking into keeping my backup drive unmounted in normal windows use. Partly this is to address threats like cryptolocker. Since one of my backup drives is an internal drive, it will not likely afford any protection from such a threat. I am thinking of adding code to my rsync script... (5 Replies)
Discussion started by: LMHmedchem
5 Replies

9. Shell Programming and Scripting

Script to unmount and mount by UUID

Hi, Need a bit of help on this one as I am a scripting noob. I have a linux based NAS that mounts USB hard drives in an inconsistent location and to make matters worse, seems to lose the mount for an unknown reason and doesn't remount automatically unless the drive is removed and re-inserted.... (4 Replies)
Discussion started by: gtr33m
4 Replies

10. UNIX for Beginners Questions & Answers

AIX - SAN Mount and Unmount on LPAR

We have 2 LPAR. LPAR #1 have a Application, Database Server process (ctree Server) and SAN+Physical Table. LPAR#2 has only Application. Both Application process are connected to Database via C-tree Server Process (Running on LPAR #1.. We want to keep one Active C-tree Server and one Backup... (1 Reply)
Discussion started by: gabhanes
1 Replies
PIVOT_ROOT(8)						       Maintenance Commands						     PIVOT_ROOT(8)

NAME
pivot_root - change the root file system SYNOPSIS
pivot_root new_root put_old DESCRIPTION
pivot_root moves the root file system of the current process to the directory put_old and makes new_root the new root file system. Since pivot_root(8) simply calls pivot_root(2), we refer to the man page of the latter for further details. Note that, depending on the implementation of pivot_root, root and cwd of the caller may or may not change. The following is a sequence for invoking pivot_root that works in either case, assuming that pivot_root and chroot are in the current PATH: cd new_root pivot_root . put_old exec chroot . command Note that chroot must be available under the old root and under the new root, because pivot_root may or may not have implicitly changed the root directory of the shell. Note that exec chroot changes the running executable, which is necessary if the old root directory should be unmounted afterwards. Also note that standard input, output, and error may still point to a device on the old root file system, keeping it busy. They can easily be changed when invoking chroot (see below; note the absence of leading slashes to make it work whether pivot_root has changed the shell's root or not). EXAMPLES
Change the root file system to /dev/hda1 from an interactive shell: mount /dev/hda1 /new-root cd /new-root pivot_root . old-root exec chroot . sh <dev/console >dev/console 2>&1 umount /old-root Mount the new root file system over NFS from 10.0.0.1:/my_root and run init: ifconfig lo 127.0.0.1 up # for portmap # configure Ethernet or such portmap # for lockd (implicitly started by mount) mount -o ro 10.0.0.1:/my_root /mnt killall portmap # portmap keeps old root busy cd /mnt pivot_root . old_root exec chroot . sh -c 'umount /old_root; exec /sbin/init' <dev/console >dev/console 2>&1 SEE ALSO
chroot(1), mount(8), pivot_root(2), umount(8) Linux Feb 23, 2000 PIVOT_ROOT(8)
All times are GMT -4. The time now is 09:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy