LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-13-2013, 03:56 PM   #1
svengolster
LQ Newbie
 
Registered: Dec 2013
Location: Oregon
Distribution: Mint13
Posts: 15

Rep: Reputation: Disabled
is the partition empty or not?


Howdy and ty in advance....
When I installed mint13 I chose the "something else" install method so that I could make a /boot, /swap, /, and /home partition and keep the size on disk fairly small in order to use the rest of the disk to experiment cloneing on. (So far dd, clonezilla and others have fallen short but that might be my fault.) after install I believe I used dd if=/dev/sda of=/dev/sda8 let it run all night and in the morning still had a flashing cursor so I think something went amok. I shut down the terminal, rebooted and all went ok. Then after seeing /sda8 was identical to /sda I wanted to try booting from /sda8 but problems came up. /etc/fstab has no entry for sda8 so I can't mount it. Matter of fact I can't find /sda8 in /dev or /media. I had in mind to add sda8 into /fstab but cannot get the uuid because the device is not mounted. Here's what's going on:
Code:
WILLYusesLINUX sven # fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000a4f89

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      253951      125952   83  Linux
/dev/sda2          255998   976771071   488257537    5  Extended
/dev/sda5          256000     4257791     2000896   82  Linux swap / Solaris
/dev/sda6         4259840    24260607    10000384   83  Linux
/dev/sda7        24262656    64264191    20000768   83  Linux
/dev/sda8        64266240   976771071   456252416    0  Empty
WILLYusesLINUX sven # fdisk /dev/sda8

Command (m for help): p

Disk /dev/sda8: 467.2 GB, 467202473984 bytes
255 heads, 63 sectors/track, 56800 cylinders, total 912504832 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000a4f89

     Device Boot      Start         End      Blocks   Id  System
/dev/sda8p1   *        2048      253951      125952   83  Linux
/dev/sda8p2          255998   976771071   488257537    5  Extended
/dev/sda8p5          256000     4257791     2000896   82  Linux swap / Solaris
/dev/sda8p6         4259840    24260607    10000384   83  Linux
/dev/sda8p7        24262656    64264191    20000768   83  Linux
/dev/sda8p8        64266240   976771071   456252416   83  Linux
I was going to attach a GParted .png but see no options for attachment. I just went back to the terminal to see what fdisk /dev/sda8 Command:v would show but now i get 'fdisk: unable to open /dev/sda8: No such file.....' Is this even fixable or do I need to start all over?
I rebooted and now have /dev/sda8 again but this message doesn't look good:
Code:
Command (m for help): v
Total allocated sectors 976760837 greater than the maximum 912504832

Last edited by svengolster; 12-13-2013 at 04:16 PM.
 
Old 12-13-2013, 04:26 PM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
1. You don't partition a partition... You make it an extended partition when then allows an extended partition table.

2. "empty" means it hasn't got a designated identification number. Those are listed from the fdisk command "l" to list the known partition types:
Code:
Command (m for help): l

 0  Empty           24  NEC DOS         81  Minix / old Lin bf  Solaris        
 1  FAT12           27  Hidden NTFS Win 82  Linux swap / So c1  DRDOS/sec (FAT-
 2  XENIX root      39  Plan 9          83  Linux           c4  DRDOS/sec (FAT-
 3  XENIX usr       3c  PartitionMagic  84  OS/2 hidden C:  c6  DRDOS/sec (FAT-
 4  FAT16 <32M      40  Venix 80286     85  Linux extended  c7  Syrinx         
 5  Extended        41  PPC PReP Boot   86  NTFS volume set da  Non-FS data    
 6  FAT16           42  SFS             87  NTFS volume set db  CP/M / CTOS / .
 7  HPFS/NTFS/exFAT 4d  QNX4.x          88  Linux plaintext de  Dell Utility   
 8  AIX             4e  QNX4.x 2nd part 8e  Linux LVM       df  BootIt         
 9  AIX bootable    4f  QNX4.x 3rd part 93  Amoeba          e1  DOS access     
 a  OS/2 Boot Manag 50  OnTrack DM      94  Amoeba BBT      e3  DOS R/O        
 b  W95 FAT32       51  OnTrack DM6 Aux 9f  BSD/OS          e4  SpeedStor      
 c  W95 FAT32 (LBA) 52  CP/M            a0  IBM Thinkpad hi eb  BeOS fs        
 e  W95 FAT16 (LBA) 53  OnTrack DM6 Aux a5  FreeBSD         ee  GPT            
 f  W95 Ext'd (LBA) 54  OnTrackDM6      a6  OpenBSD         ef  EFI (FAT-12/16/
10  OPUS            55  EZ-Drive        a7  NeXTSTEP        f0  Linux/PA-RISC b
11  Hidden FAT12    56  Golden Bow      a8  Darwin UFS      f1  SpeedStor      
12  Compaq diagnost 5c  Priam Edisk     a9  NetBSD          f4  SpeedStor      
14  Hidden FAT16 <3 61  SpeedStor       ab  Darwin boot     f2  DOS secondary  
16  Hidden FAT16    63  GNU HURD or Sys af  HFS / HFS+      fb  VMware VMFS    
17  Hidden HPFS/NTF 64  Novell Netware  b7  BSDI fs         fc  VMware VMKCORE 
18  AST SmartSleep  65  Novell Netware  b8  BSDI swap       fd  Linux raid auto
1b  Hidden W95 FAT3 70  DiskSecure Mult bb  Boot Wizard hid fe  LANstep        
1c  Hidden W95 FAT3 75  PC/IX           be  Solaris boot    ff  BBT
Normally you would selecte 83 (linux) for the partition type.

You only partition the base device (/dev/sda in your case).

You normally would create a filesystem on the partition, which would make it usable by the system via the mount command to connect it to the rest of the system.
 
Old 12-13-2013, 05:12 PM   #3
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,260

Rep: Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948
Quote:
Originally Posted by svengolster View Post
I believe I used dd if=/dev/sda of=/dev/sda8
You did what now???

Your sda8 partition is definitely dead now, you killed it royally with that command. You need to wipe sda8 and start over, and re-think what you're trying to do here. You can't fit an entire disk inside one of the partitions on the same disk, it makes no sense. That's like trying to put a house inside a box that's inside the house.

Last edited by suicidaleggroll; 12-13-2013 at 05:15 PM.
 
Old 12-13-2013, 06:34 PM   #4
svengolster
LQ Newbie
 
Registered: Dec 2013
Location: Oregon
Distribution: Mint13
Posts: 15

Original Poster
Rep: Reputation: Disabled
Solved

lol....WHAT did you do? lol after putting serious thought into this I came on here to say that there were a few things I don't understand...and you both straightened some of that out thank you. I think u r right also about the toast because of errors on sda7:
Code:
fdisk /dev/sda7
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x0aba1cfd.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
I think all partitions now show that...6 did also for sure.
OK. When I partitioned from the live install, my partitions were (approx) 100MB/booter 2000GB/Swapper(I have 4GB ram) 10GB /rooter and for /homer 10GB, then I selected all the unallocated bytes and made a primary empty dos partition. Thanks a lot I will go back to school, again. One more thing....I wanted to clone 2 partitions at one time so I did this: WILLYusesLINUX sven # dd if=/dev/sda1 && /dev/sda2 of=/dev/sda8 and when I hit enter I saw the screen fill up with code moving at a high rate of speed! I'm talking dollar signs, hearts, spades, that kind of code stuff. I thought it would never stop.....lol I couldn't get out of whatever was going on (the prompt eventually stopped but no matter what I did it would go in a tizzy again before saying no such command etc.) hit computer reboot button and all was well. You know what? Before I dd'd the drive to itself I did overlook the fact that the whole disk was being cloned and not just file system. Maybe I should have compressed it first....thnx again....

Last edited by svengolster; 12-13-2013 at 06:49 PM. Reason: fix stuff
 
Old 12-13-2013, 06:56 PM   #5
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Quote:
Originally Posted by suicidaleggroll View Post
You did what now???

Your sda8 partition is definitely dead now, you killed it royally with that command. You need to wipe sda8 and start over, and re-think what you're trying to do here. You can't fit an entire disk inside one of the partitions on the same disk, it makes no sense. That's like trying to put a house inside a box that's inside the house.
True... but there isn't anything basically wrong with the partition itself. It just has garbage as the data.

A simple fix is to put a filesystem on it (mkfs /dev/sda7).
 
Old 12-13-2013, 06:57 PM   #6
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,260

Rep: Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948
Yeah, this:
Code:
dd if=/dev/sda1 && /dev/sda2 of=/dev/sda8
Is nonsense.

What it did was just run "dd if=/dev/sda1", which will dump the contents of sda1 to stdout. What you were seeing is the raw binary information on /dev/sda1 being converted to ascii characters and printed on the screen. Had you let it finish, it would have then checked the exit code, done some more nonsense, and ultimately presented you with an error.

dd is not a file backup utility. cp, scp, rsync, etc. are the filesystem utilities that are used to copy files/directories.

What dd does is read the raw disk and dump the output where you tell it. I'm not talking files on the disk, I'm talking the 1s and 0s that are on the platter itself. This is beneath files, beneath the filesystem, it's reading the platter directly. So when you start dd off with "dd if=/dev/sda" you're telling it to read the entire disk, byte for byte. The boot sector, the partition table, the underlying filesystem, and every single byte present on the disk, whether or not anything has ever been written to it. You could go to the store, buy a brand new 1TB hard drive, plug it in, and do a dd dump of it, and you'll get 1TB of output, even though not a single file has ever been written to it.

This is why "dd if=/dev/sda of=/dev/sda8" makes no sense. /dev/sda contains /dev/sda8. You're trying to dump every single bit in the 500GB drive onto a 467GB partition on the same drive. It just can't happen. All it's going to do is corrupt whatever used to be on that partition and finish with an error that it couldn't copy everything because the destination was too small.

You can't clone two partitions into a single partition either, it makes no sense. What would happen? Interleave the bytes from each partition as it writes them to the destination? All that would do is corrupt the data and leave you with nothing. Dump one partition and then the next one into the destination? How could one partition (the destination) handle two independent filesystems in succession, each with its own journaling, metadata, etc.? You'd likely end up with just the first partition that was copied, and then a bunch of nonsense.

If you take a step back and ask us what you'd like to accomplish, we can suggest ways to go about it. From the sound of it, you really need two completely independent disks.

Last edited by suicidaleggroll; 12-13-2013 at 06:59 PM.
 
1 members found this post helpful.
Old 12-13-2013, 07:00 PM   #7
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Quote:
Originally Posted by svengolster View Post
When I partitioned from the live install, my partitions were (approx) 100MB/booter 2000GB/Swapper(I have 4GB ram) 10GB /rooter and for /homer 10GB, then I selected all the unallocated bytes and made a primary empty dos partition. Thanks a lot I will go back to school, again. One more thing....I wanted to clone 2 partitions at one time so I did this: WILLYusesLINUX sven # dd if=/dev/sda1 && /dev/sda2 of=/dev/sda8 and when I hit enter I saw the screen fill up with code moving at a high rate of speed! I'm talking dollar signs, hearts, spades, that kind of code stuff. I thought it would never stop.....lol I couldn't get out of whatever was going on (the prompt eventually stopped but no matter what I did it would go in a tizzy again before saying no such command etc.) hit computer reboot button and all was well. You know what? Before I dd'd the drive to itself I did overlook the fact that the whole disk was being cloned and not just file system. Maybe I should have compressed it first....thnx again....
Short explaination:

you did "dd if=/dev/sda1 && /dev/sda2 of=/dev/sda8" ok - that was invalid.

BUT what you actually did was try two commands: "dd if=/dev/sda1" (the && is a execute left side, and if successful execute right side, never mind that the right side isn't a command).

The "dd if=/dev/sda1" wrote to standard out - which is the terminal. It did nothing to /dev/sda8. What messed up that was the "fdisk /dev/sda8"
 
1 members found this post helpful.
Old 12-13-2013, 07:06 PM   #8
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,130
Blog Entries: 2

Rep: Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825
Partitions have no partition table, disks have. So it is normal that fdisk spits out that error message when you try to list the partition table of a partition.

The dd command does not know functions like &&. && is a function of your shell to tie commands together (the second command will only be executed when the first was successful). This means that the shell interprets your dd command as:
- Execute the command
Code:
dd if=/dev/sda
Since you specify no output file in that command dd will by default write to the standard output, usually your screen. This is why you saw all those characters.
- After the dd command finished successfully the shell had tried to execute the second command:
Code:
/dev/sda2 of=/dev/sda8
Here you would have get an error message, since /dev/sda2 is not an executable command.

About cloning with compression, this still wouldn't have worked. If you clone the complete disk to a partition on the same disk you will also try to clone the target disk to itself, which would have not worked, since its content is compressed and cannot be further compressed. This type of cloning also makes knots in your heads, since it is pretty hard to understand what will actually happen.

I recommend to read the manpage of dd and this thread about dd: http://www.linuxquestions.org/questi...ommand-362506/

EDIT: too slow
 
Old 12-14-2013, 08:28 AM   #9
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Actually, throwing compression into it has the same result as creating a tar file with the tar file in it - you run out of disk space. The reason you run out is that as soon as it gets to the compressed data it stops compressing... (it actually expands a little bit) so you run out of space before you get to the end of the disk.
 
  


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 do I convert an empty ext3 partition to a jfs partition? lothario Linux - Software 3 02-28-2006 11:40 AM
How can I tell if a partition is empty? PenguinMolester Linux - Newbie 5 10-27-2004 08:46 AM
I can't shrink my empty partition yeehi Linux - General 3 10-20-2004 03:23 PM
Empty Partition Systerektomy Linux - Newbie 1 04-28-2004 11:01 AM
strange partition table - boot partition empty etanter Linux - General 0 12-23-2003 10:46 AM


All times are GMT -5. The time now is 05:36 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration