LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices

Reply
 
Search this Thread
Old 03-14-2013, 10:36 AM   #1
McZ
Member
 
Registered: Aug 2012
Posts: 42

Rep: Reputation: Disabled
[7.3] umount says: "umount: /very/long/path (/dev/loop0) is unmounted" ?


So I have just finished updating my scripts to build 7.3. Now when I started to build my BLFS packages (also scripted) umount is bugging me with

Code:
umount: /very/long/path (/dev/loop0) is unmounted
even though my script is redirecting umount text:
Code:
umount /very/long/path > /dev/null 2>&1
umount is not bugging me with this text in LFS-7.2. Anyone have any idea why this text appears? or even better how I can remove it.
 
Old 03-14-2013, 10:46 AM   #2
#root
Member
 
Registered: Mar 2013
Location: in my house
Distribution: Ubuntu,Backtrack,Fedora
Posts: 38

Rep: Reputation: 5
Output redirection

The greater-thans (>) in commands like these redirect the program’s output somewhere. In this case, something is being redirected into /dev/null, and something is being redirected into &1.
Standard in, out, and error

There are three standard sources of input and output for a program. Standard input usually comes from the keyboard if it’s an interactive program, or from another program if it’s processing the other program’s output. The program usually prints to standard output, and sometimes prints to standard error. These three file descriptors (you can think of them as “data pipes”) are often called STDIN, STDOUT, and STDERR.

Sometimes they’re not named, they’re numbered! The built-in numberings for them are 0, 1, and 2, in that order. By default, if you don’t name or number one explicitly, you’re talking about STDOUT.

Given that context, you can see the command above is redirecting standard output into /dev/null, which is a place you can dump anything you don’t want (often called the bit-bucket), then redirecting standard error into standard output (you have to put an & in front of the destination when you do this).
 
Old 03-15-2013, 05:34 AM   #3
McZ
Member
 
Registered: Aug 2012
Posts: 42

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by #root View Post
Output redirection

The greater-thans (>) in commands like these redirect the program’s output somewhere. In this case, something is being redirected into /dev/null, and something is being redirected into &1.
Standard in, out, and error

There are three standard sources of input and output for a program. Standard input usually comes from the keyboard if it’s an interactive program, or from another program if it’s processing the other program’s output. The program usually prints to standard output, and sometimes prints to standard error. These three file descriptors (you can think of them as “data pipes”) are often called STDIN, STDOUT, and STDERR.

Sometimes they’re not named, they’re numbered! The built-in numberings for them are 0, 1, and 2, in that order. By default, if you don’t name or number one explicitly, you’re talking about STDOUT.

Given that context, you can see the command above is redirecting standard output into /dev/null, which is a place you can dump anything you don’t want (often called the bit-bucket), then redirecting standard error into standard output (you have to put an & in front of the destination when you do this).
From what you are saying
Code:
{command} > /dev/null
is redirecting STDOUT to /dev/null, all I see is errors if there are any and if they are printed to STDERR.

And adding 2>&1 will redirect STDERR to STDOUT
Code:
{command} > /dev/null 2>&1
So, then I should se nothing?

if so, why am I getting this output when I'm redirecting to /dev/null?
Code:
umount: /very/long/path (/dev/loop0) is unmounted

Last edited by McZ; 03-15-2013 at 05:34 AM. Reason: typo
 
Old 03-24-2013, 02:38 AM   #4
#root
Member
 
Registered: Mar 2013
Location: in my house
Distribution: Ubuntu,Backtrack,Fedora
Posts: 38

Rep: Reputation: 5
/dev/loop0 indicates the use of a loop back device

Quote:
A Loopback Device is a mechanism used to interpret files as real devices.
so i believe that your /very/long/path has a pointer to this loop back device and maybe the existence of pointer leads to the output

try to redirect the output somewhere else rather tha /dev/null and observe what happens

also you can try to umount the loop0 before you execute your command

visit following links
link1
link2
 
Old 03-24-2013, 01:29 PM   #5
Keith Hedger
Member
 
Registered: Jun 2010
Location: Devon,UK
Distribution: Linux From Scratch, Slackware64,
Posts: 836

Rep: Reputation: 167Reputation: 167
What is the exact command you are using? I can't reproduce this error, it may be a kernel error message for some reason some of which are not easy to redirect.
The form
Code:
SOMECOMMAND >/dev/null 2>&1
is correct although you can use a short cut in newer versions of bash like so
Code:
SOMECOMMAND &>/dev/null
Which redirect BOTH stdin and stderr
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to umount "/" file system bkarthick Linux - Newbie 17 06-04-2011 12:41 AM
Fedora 11 upgrade: "/dev/sda1 not cleanly unmounted" recurs after fsck judyhawkins Fedora - Installation 3 01-01-2010 11:00 PM
umount "device is busy" error whinyan Linux - General 16 08-13-2008 07:18 AM
Cant do "mount/umount" on USB flash drive as regular user Salgeras Slackware 5 11-01-2007 08:09 PM
Mandriva 2006 fails install with "set_loop failed on /dev/loop0" iguest Mandriva 5 05-07-2006 01:16 PM


All times are GMT -5. The time now is 07:55 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration