LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-08-2009, 10:35 PM   #1
buccaneere
Member
 
Registered: Nov 2007
Posts: 213

Rep: Reputation: 16
Filled hard disk with wrong CP command...


I was tryin' to copy Vista bootloader (dual hard disk, triple boot) to CD.

Code:
sudo cp /dev/sdb1 /dev/scd0

cp: writing `/dev/scd0': No space left on device
I think the designation was wrong, because I have filled my hard disk, and didn't get a cd written.

I DO have this:

Code:
chuckbhp@chuckbhp-laptop:~$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2              83G   83G     0 100% /
varrun                982M  236K  982M   1% /var/run
varlock               982M     0  982M   0% /var/lock
udev                  982M   64K  982M   1% /dev
devshm                982M   40K  982M   1% /dev/shm
lrm                   982M   39M  943M   4% /lib/modules/2.6.24-21-generic/volatile
/dev/sdb2             8.2G  6.5G  1.8G  79% /media/HP_RECOVERY
/dev/sdb1             104G   32G   73G  31% /media/disk
overflow              1.0M   40K  984K   4% /tmp
chuckbhp@chuckbhp-laptop:~$
How can I tell if the copy task is still trying to execute?

How can I find and delete the 'filling' file?
 
Old 02-09-2009, 01:44 AM   #2
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Quote:
Originally Posted by buccaneere View Post
I was tryin' to copy Vista bootloader (dual hard disk, triple boot) to CD.

Code:
sudo cp /dev/sdb1 /dev/scd0
Ugh, never ever do that again.

First thing is that to be able to do this, you usually never deal with the device nodes themselves, and to copy something to a cd is not just that easy as to cp'ing it to the cd writer device node.

You usually use a program like cdrecord, k3b, brasero or whatever for that.

Besides that, I really wonder what exactly do you intend to do.

Code:
cp: writing `/dev/scd0': No space left on device
The /dev filesystem, with all the device nodes, resides in the root ( / ) filesystem. I guess that /dev/scd0 didn't exist, so a file with that name has been created, and the raw contents of the sdb1 partition has been dumped into it (hence, filling /).

Just to be sure, and before telling you to delete the scd0 file, please, post the output of this command, so I can be sure:

Code:
ls -l /dev/scd0


After that, let us know exactly and with as much detail as you can WHAT are you trying to do, so we can advice you on the best way to achieve it.
 
Old 02-09-2009, 08:56 AM   #3
buccaneere
Member
 
Registered: Nov 2007
Posts: 213

Original Poster
Rep: Reputation: 16
Hi 92...

Exactly what I was tryin' to do?

I was tryin' to create a modified backup install for Vista, INSTEAD of the factory re-install CD, which is loaded with bloatware.

I've done it before for other OS's by copying to other hard disks, but never by copying to CD. I presumed the burn program would load by default after the read-for-copy task (Brasero did load, but too late).
Code:
chuckbhp@chuckbhp-laptop:~$ ls -l /dev/scd0
brw-rw----+ 1 root cdrom 11, 0 2009-02-09 04:25 /dev/scd0
chuckbhp@chuckbhp-laptop:~$
What does this tell me?

I tried this task also by another command, I THINK, like so...
Code:
cp /dev/sdb1 /mnt/cdrom
So also I have:
Code:
chuckbhp@chuckbhp-laptop:~$ ls -l /mnt/cdrom
ls: cannot access /mnt/cdrom: No such file or directory
chuckbhp@chuckbhp-laptop:~$

I deleted a file that was about 67G, but the filled-disk problem persists. I'm guessing the copy task is still trying to execute?

STOP LAUGHING!
 
Old 02-09-2009, 09:12 AM   #4
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Quote:
Originally Posted by buccaneere View Post
Hi 92...

Exactly what I was tryin' to do?

I was tryin' to create a modified backup install for Vista, INSTEAD of the factory re-install CD, which is loaded with bloatware.
Ok.

Quote:
I've done it before for other OS's by copying to other hard disks, but never by copying to CD. I presumed the burn program would load by default after the read-for-copy task (Brasero did load, but too late).
Code:
chuckbhp@chuckbhp-laptop:~$ ls -l /dev/scd0
brw-rw----+ 1 root cdrom 11, 0 2009-02-09 04:25 /dev/scd0
chuckbhp@chuckbhp-laptop:~$
What does this tell me?
That node is ok so the problem is not there, contrary to what I thought on a first sight. To identify the big directories you can use the command "du". Start at / (cd /) and do this:

Code:
du -sh *
That will tell you the size for each file and directory under /. From there, you can cd into the bigger dirs and repeat the process, until you find what's stealing your space.

Quote:
I tried this task also by another command, I THINK, like so...
Code:
cp /dev/sdb1 /mnt/cdrom
So also I have:
Code:
chuckbhp@chuckbhp-laptop:~$ ls -l /mnt/cdrom
ls: cannot access /mnt/cdrom: No such file or directory
chuckbhp@chuckbhp-laptop:~$
If you truly want to make a raw image (kind of like ghost images in windows) use the command "dd". You need to create an intermediate file, and then you can burn it to a cdrom with whatever program you prefer. In general terms, you can't use "cp" to write to blank cdroms.

I assume that sdb1 is the partition which holds your Windows installation that you want to backup. To save an image of such partition into your home directory you'd do this:

Code:
dd if=/dev/sdb1 of=$HOME/win.img
After that, you can record win.img on a cdrom using k3b, brasero, xcdroast or whatever you prefer (whatever but cp, of course).

Quote:
I deleted a file that was about 67G, but the filled-disk problem persists. I'm guessing the copy task is still trying to execute?
It shouldn't be running, but I can't be sure of what you did so... If you are not sure, just reboot, after rebooting no previous task will remain alive.
 
Old 02-09-2009, 09:20 AM   #5
monsm
Member
 
Registered: Feb 2005
Location: London, UK
Distribution: Gentoo
Posts: 568

Rep: Reputation: 37
Quote:
Originally Posted by buccaneere View Post
Hi 92...

STOP LAUGHING!
Not quite yet I am afraid...

Anyway, try the "du" command to find out what uses how much. There are, as usual, lots of switches in the command for you to tune the output from it. You might want to read the man pages for it first.

As for the cp processes, try "ps aux |grep cp". If any are still running you can kill them: "kill -9 [pid]". The pid number is in the output from the ps command.

I also agree with the others, don't use copy to device nodes (other in very special circumstances). Copy to where the drive is mounted, or, for cd/dvd rewriteables, use a burning tool.

Mons

Last edited by monsm; 02-09-2009 at 09:21 AM.
 
Old 02-09-2009, 10:12 AM   #6
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Just a comment, 'cause I "been there, done that:" If you copy a Linux partition that contains /dev, then you'll be copying a few "infinite" devices (/dev/null, /dev/random, etc.) which will fill any drive.

To accomplish your stated goal, I think you should have used the dd command rather than the cp one. I've used dd to image a dual-boot XP/Fedora system on a 80 GB laptop drive to a file on a USB drive, and to restore it to a replacement 120GB in the same laptop. After I used gparted to "repair" the partition table, both systems survived the transplant.
 
Old 02-09-2009, 10:41 AM   #7
buccaneere
Member
 
Registered: Nov 2007
Posts: 213

Original Poster
Rep: Reputation: 16
Ok, so the copy task is not re-filling my disk as I empty it...

du looks ok...

Code:
chuckbhp@chuckbhp-laptop:~$ du -sh *
8.0K	crosshair.png
23M	Desktop
0	devices
38M	Documents
36K	DynoTune95.xls
0	Examples
1.6G	Music
2.7M	Photos
103M	Pictures
4.0K	Public
4.0K	Templates
4.0K	Videos
chuckbhp@chuckbhp-laptop:~$
... EXCEPT, system monitor is showing 2 users (duo-core CPU).
 
Old 02-09-2009, 02:20 PM   #8
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Many processes ("services", X-server, etc.) are started by "root" during the boot, so you'll always have "root" and "chuckbhp" as "active users" of the system. So "two users" is what you'd expect to see, and you should be surprised to see only one user unless you log in as "root" and log out "chuckbhp." Remember, Linux is designed as a multi-user system, and "root" is just another user with, of course, fairly extensive access privileges. (Interestingly, there are ways to "tweak' Linux so that even "root" is prevented from making some system changes. That's part of what the SELinux package does, and "root" users are sometimes startled when they get "access denied" massages on a Security Enhanced Linux systems.)
 
Old 02-09-2009, 02:49 PM   #9
buccaneere
Member
 
Registered: Nov 2007
Posts: 213

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by PTrenholme View Post
Many processes ("services", X-server, etc.) are started by "root" during the boot, so you'll always have "root" and "chuckbhp" as "active users" of the system. So "two users" is what you'd expect to see, and you should be surprised to see only one user unless you log in as "root" and log out "chuckbhp." Remember, Linux is designed as a multi-user system, and "root" is just another user with, of course, fairly extensive access privileges. (Interestingly, there are ways to "tweak' Linux so that even "root" is prevented from making some system changes. That's part of what the SELinux package does, and "root" users are sometimes startled when they get "access denied" massages on a Security Enhanced Linux systems.)
I'm sure you're right there Ptren...

BUT, in GUI administration/system monitor/resources, my CPU usage is graphing in dual mode, which is NOT normal, and is what lead me to believe that the copy process is continuing...
Attached Thumbnails
Click image for larger version

Name:	HPIM1018.JPG
Views:	25
Size:	211.7 KB
ID:	130  
 
Old 02-09-2009, 03:34 PM   #10
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Well, instead of looking at the graph look at the process list, sort them by cpu usage, and look what you can find.

There's no way that a cp can be resumed at all. Much less after a reboot.
 
Old 02-09-2009, 03:45 PM   #11
buccaneere
Member
 
Registered: Nov 2007
Posts: 213

Original Poster
Rep: Reputation: 16
trackerd is pulling 50% CPU.

How does this fill a disk?
 
Old 02-09-2009, 06:28 PM   #12
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
From the picture you posted it looks like you have a HP laptop with a built-in web camera. Most of those laptops (but not all), are shipped with dual-core AMD 64-bit Turion or dual-core Intel 64-bit processors. (Earlier dv series laptops were shipped with a 32-bit "Vista Premium" OS installed but processors and hardware were all 64-bit.)

Anyhow, most Linux kernels in "standard" distributions are compiled with SMP enabled, so they will automatically use both CPUs as needed. From the picture it looks like you have one "user" and one "system" process running and that they are switching between the two available CPUs as needed. (I suspect that one process is your X-server and the other your user session activity, but the specifics of which processor is running which process at any specific time is not, normally, of much interest to anyone except someone trying to debug some process, and, in that case, the debugging tools usually show you the correct processor's registers and memory stack.

Bottom line: What you're seeing seems to me to look entirely normal.

If you have it installed, the lshw command will show you a description of your hardware.
 
Old 02-09-2009, 08:37 PM   #13
buccaneere
Member
 
Registered: Nov 2007
Posts: 213

Original Poster
Rep: Reputation: 16
My GUI/system monitor/resources/CPU history has never shown dual function mode; always single mode. It started when I botched the CP command...

Everything else was accurate observation.

Is there a solution?
 
Old 02-09-2009, 09:45 PM   #14
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
It has nothing to do with the cp command, and as I said, seem quite normal to me. What you're seeing is not a "dual function mode," it's a "dual [b]processor[/u] activity history."

By the way the du command you ran only looked at your personal "home" directory. You forgot the "/" at the end. Here's an example of the output you should see (after a fairly long wait):
Code:
peter@DV9700us:~$ sudo du -shx /*
7.2M	/bin
1.1G	/Books
58M	/boot
0	/cdrom
92K	/dev
15M	/etc
18G	/Fedora
du: cannot access `/home/peter/.gvfs': Permission denied
1.6G	/home
0	/initrd.img
0	/initrd.img.old
360M	/lib
4.5M	/lib32
0	/lib64
16K	/lost+found
8.0K	/media
4.0K	/mnt
4.0K	/opt
du: cannot access `/proc/6250/task/6250/fd/4': No such file or directory
du: cannot access `/proc/6250/task/6250/fdinfo/4': No such file or directory
du: cannot access `/proc/6250/fd/4': No such file or directory
du: cannot access `/proc/6250/fdinfo/4': No such file or directory
0	/proc
30M	/root
11M	/sbin
4.0K	/selinux
200K	/srv
0	/sys
276K	/tmp
11G	/Ubuntu
5.1G	/usr
1.2G	/var
41G	/Vista
0	/vmlinuz
0	/vmlinuz.old
32K	/xorg.conf.new
F.Y.I.: This is from my Ubuntu "Jaunty Jackalope 9.04 Beta" installation, the 11G /Ubuntu is a Kubuntu 8.10 installation, the 18G /Fedora is a Fedora 10 installation, and the 41G /Vista is the "Vista Premium" installation that came with the laptop (a HP dv9700us) --I mount all the various installations on the root file system of which ever one I happen to be using.
 
Old 02-09-2009, 10:20 PM   #15
buccaneere
Member
 
Registered: Nov 2007
Posts: 213

Original Poster
Rep: Reputation: 16
I see you have the same box... Mine is 9428nr

Quote:
chuckbhp@chuckbhp-laptop:~$ sudo du -shx /*
[sudo] password for chuckbhp:
5.2M /bin
53M /boot
0 /cdrom
68K /dev
13M /etc
1.9G /home
4.0K /initrd
0 /initrd.img
0 /initrd.img.old
363M /lib
16K /lost+found
40K /media
4.0K /mnt
4.0K /opt
du: cannot access `/proc/6634/task/6634/fd/6': No such file or directory
du: cannot access `/proc/6634/task/6634/fdinfo/6': No such file or directory
du: cannot access `/proc/6634/fd/6': No such file or directory
du: cannot access `/proc/6634/fdinfo/6': No such file or directory
0 /proc
78G /root
6.7M /sbin
4.0K /srv
0 /sys
36K /tmp
2.1G /usr
357M /var
0 /vmlinuz
0 /vmlinuz.old
chuckbhp@chuckbhp-laptop:~$


What's with the 78G root entry? How do I tell what needs to get gone outta' there?

Last edited by buccaneere; 02-09-2009 at 10:44 PM.
 
  


Reply



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
fedora 10 install via hard disk got a wrong message!---Missing ISO 9660 image netyq Linux - Newbie 1 01-31-2009 09:28 AM
View hard disk size command mpmackenna Linux - Newbie 3 09-27-2007 04:56 PM
Hard drive space filled, X fails, says connection reset by peer solar_64131 Linux - Software 5 08-28-2006 04:37 PM
Hard disk not bootable after GRUB's wrong operations linuxgaga Linux - Hardware 4 04-16-2006 11:00 AM
What's wrong with my hard disk?: prad Linux - General 3 03-05-2003 10:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:52 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration