Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

FDisk Help

46 views
Skip to first unread message

Steve Matzura

unread,
Jan 7, 2016, 2:10:04 AM1/7/16
to
I have three physical drives in my system--/dev/sda is presumably my
boot drive, which shows up as six devices in /dev:
/dev/sda1,2,5,6,7,8. Additionally, there's a CD-ROM drive, and a 250GB
standard rotating disk. My boot partition is located on a 120GB SSD,
which I presume is /dev/sda, is divided as follows according to df:

Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 8518920 879012 7184128 11% /
/dev/sda7 368615 2058 343005 1% /tmp
/dev/sda5 2817056 178752 2475488 7% /var
/dev/sda8 89493696 57076 84867532 1% /home

What, then, are /dev/sda2 and /dev/sda6? I tried looking at them with
FDisk and got the following:

For /dev/sda2: Failed to read extended partition table
(offset=5858805): Invalid argument

For /dev/sda6: device contains a valid 'swap' signature, it's strongly
recommended to wipe the device by command wipefs(8) if this setup is
unexpected to avoid possible collisions.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0xa9732d81.

Could this one be the 250GB drive? If so, how do I handle this
equivalently in Debian, equivalent to how, say, Windows handles it in
Disk Management, by laying down a partition, formatting it, and
creating a mountable volume that's there every time the system boots?

I actually tried answering my own questions by looking at an other
running system to see how this is done, but the system is a different
distro, not Debian's, and even though the device is mounted and ready
for use when the system boots, it's not in fstab, so I'm thinking the
disk itself is the problem, with either no partition or filesystem on
it. Am I on the right track?

Sven Hartge

unread,
Jan 7, 2016, 2:40:07 AM1/7/16
to
Steve Matzura <s...@noisynotes.com> wrote:

> I have three physical drives in my system--/dev/sda is presumably my
> boot drive, which shows up as six devices in /dev:
> /dev/sda1,2,5,6,7,8. Additionally, there's a CD-ROM drive, and a 250GB
> standard rotating disk. My boot partition is located on a 120GB SSD,
> which I presume is /dev/sda, is divided as follows according to df:

> Filesystem 1K-blocks Used Available Use% Mounted on
> /dev/sda1 8518920 879012 7184128 11% /
> /dev/sda7 368615 2058 343005 1% /tmp
> /dev/sda5 2817056 178752 2475488 7% /var
> /dev/sda8 89493696 57076 84867532 1% /home

> What, then, are /dev/sda2 and /dev/sda6? I tried looking at them with
> FDisk and got the following:

> For /dev/sda2: Failed to read extended partition table
> (offset=5858805): Invalid argument

> For /dev/sda6: device contains a valid 'swap' signature, it's strongly
> recommended to wipe the device by command wipefs(8) if this setup is
> unexpected to avoid possible collisions.

/dev/sda5 to /dev/sda8 are logical partitions inside an extended
partition. The extended partition is /dev/sda2.

Hint: try the tool "lsblk" to see where which filesystem resides.

Grüße

--
Sigmentation fault. Core dumped.

jdd

unread,
Jan 7, 2016, 3:40:05 AM1/7/16
to
Le 07/01/2016 08:08, Steve Matzura a écrit :

> I actually tried answering my own questions by looking at an other
> running system to see how this is done, but the system is a different


df is not the right tool to lokk at partitions, simply use "sudo fdisk -l"

jdd

to...@tuxteam.de

unread,
Jan 7, 2016, 4:20:07 AM1/7/16
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Exactly. That's the vagaries of the old "DOS" partition schema.

Originally the partition table only provided room for up to four
partitions. Once that became too tight, we cludged our way out
by allowing one of those four (the so-called "extended" partition
to be subdivided into further four so-called "logical" partitions.

The old, "real" partitions came to be known henceforth as "primary"
partitions.

That's why df doesn't "see" it: no file system on it.

As for /dev/sda6: df only "sees" mounted file systems, no swap.

Thus if you want to have a more complete view of what's going on
in your disk, then yes, fdisk -l is more appropriate, as jdd wrote.

You've to aim it at the "right" disk, though, and you usually have
to be root. For a first approximation df is fine, if you know how
to interpret the (incomplete) results.

regards
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlaOI3cACgkQBcgs9XrR2kaeAgCfZQ/NL3jDJ5Ml+IdP56xHZ6nS
NVcAn1tWrNyyZnNlH/iteVthRmC381Z5
=lzeq
-----END PGP SIGNATURE-----

Steve Matzura

unread,
Jan 7, 2016, 7:40:06 AM1/7/16
to
Sven:

On Thu, 7 Jan 2016 08:29:46 +0100, you wrote:

>/dev/sda5 to /dev/sda8 are logical partitions inside an extended
>partition. The extended partition is /dev/sda2.

How did you know that? sda6 isn't even a mounted filesystem--sda1, 5,
7 and 8 are the mounted filesystems for /, /tmp, /var, and /home
respectively. How did /dev/sda6 get in there? It shows as swap.

>Hint: try the tool "lsblk" to see where which filesystem resides.

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 111.8G 0 disk
tqsda1 8:1 0 8.4G 0 part /
tqsda2 8:2 0 1K 0 part
tqsda5 8:5 0 2.8G 0 part /var
tqsda6 8:6 0 13.4G 0 part [SWAP]
tqsda7 8:7 0 380M 0 part /tmp
mqsda8 8:8 0 86.9G 0 part /home
sdb 8:16 0 232.9G 0 disk
sr0 11:0 1 1024M 0 rom

OK, I see /dev/sdb is the 250G disk which probably needs partitioning
and formatting. Thanks for the hint. Always learning these
single-purpose tools is one of the ! joys of Linux.

Steve Matzura

unread,
Jan 7, 2016, 7:40:06 AM1/7/16
to
Thomas,

On Thu, 7 Jan 2016 09:36:07 +0100, you wrote:

>Thus if you want to have a more complete view of what's going on
>in your disk, then yes, fdisk -l is more appropriate, as jdd wrote.

Thanks. After I removed all partitions, created a new one, and
formatted it with the ext4 filesystem using mkfs.ext4, I now show:

/dev/sdb1 240177240 60564 227893312 1% /mnt/disk2

I'll now put it into /etc/fstab.

Sven Hartge

unread,
Jan 7, 2016, 10:20:06 AM1/7/16
to
Steve Matzura <s...@noisynotes.com> wrote:
> Sven: On Thu, 7 Jan 2016 08:29:46 +0100, you wrote:

>> /dev/sda5 to /dev/sda8 are logical partitions inside an extended
>> partition. The extended partition is /dev/sda2.

> How did you know that? sda6 isn't even a mounted filesystem--sda1, 5,
> 7 and 8 are the mounted filesystems for /, /tmp, /var, and /home
> respectively. How did /dev/sda6 get in there? It shows as swap.

You said in your first mail that /dev/sda6 was swap. And since Linux
always numbers the logical partitions beginning from 5 and /dev/sda1 was
/, /dev/sda2 can only be the extended partition, containing sda5-8.
Simple deduction (and experience with the matter of course).

(Side-note: this is also why I really like GPT instead of MSDOS as a
partition table. No primary, extended and logical partition nonsense,
kist 128 possible partitions without any special conventions.)

Grüße,
Sven.

David Christensen

unread,
Jan 7, 2016, 10:50:07 AM1/7/16
to
sda probably has an MS-DOS partition table. sda2 is probably an
extended partition. sda6 is probably a swap partition.


'lsblk' can tell you the relationship between kernel names (e.g. sda,
sda1, etc.) and mount points:

$ lsblk


'parted' can tell you how a disk is partitioned:

$ sudo apt-get install parted

$ sudo parted /dev/sda print


Here is information about MBR partition tables:

https://en.wikipedia.org/wiki/Master_boot_record


David

jdd

unread,
Jan 7, 2016, 11:00:08 AM1/7/16
to
Le 07/01/2016 16:43, David Christensen a écrit :

> 'lsblk' can tell you the relationship between kernel names (e.g. sda,
> sda1, etc.) and mount points:
>
> $ lsblk
>

not always. I just tested: lsblk only flag as swap the active swap partition

fdisk -l

gives all the necessary info

example:

Device Boot Start End Sectors Size Id Type
/dev/sdc1 * 2048 62910463 62908416 30G 83 Linux
/dev/sdc2 62910464 937701375 874790912 417,1G f W95 Ext'd (LBA)
/dev/sdc5 62912512 125820927 62908416 30G 83 Linux
/dev/sdc6 125822976 142591999 16769024 8G 82 Linux swap / Solaris
/dev/sdc7 142594048 937701375 795107328 379,1G 83 Linux



(but all I have at hand is an openSUSE, the debian version may be
different)

jdd

jdd

unread,
Jan 8, 2016, 9:00:08 AM1/8/16
to
Le 08/01/2016 14:54, Chris Bannister a écrit :
> On Thu, Jan 07, 2016 at 04:53:34PM +0100, jdd wrote:
>> fdisk -l
>>
>> gives all the necessary info
>>
>> example:
>>
>> Device Boot Start End Sectors Size Id Type
>> /dev/sdc1 * 2048 62910463 62908416 30G 83 Linux
>> /dev/sdc2 62910464 937701375 874790912 417,1G f W95 Ext'd (LBA)
>> /dev/sdc5 62912512 125820927 62908416 30G 83 Linux
>> /dev/sdc6 125822976 142591999 16769024 8G 82 Linux swap / Solaris
>> /dev/sdc7 142594048 937701375 795107328 379,1G 83 Linux
>>
>>
>>
>> (but all I have at hand is an openSUSE, the debian version may be different)
>
> LOL, you do realise this is a list for Debian users, right?
>
and? I also have Debian on some computers and there are several fdisk on
the air

jdd

Chris Bannister

unread,
Jan 8, 2016, 9:00:08 AM1/8/16
to
On Thu, Jan 07, 2016 at 04:53:34PM +0100, jdd wrote:
> fdisk -l
>
> gives all the necessary info
>
> example:
>
> Device Boot Start End Sectors Size Id Type
> /dev/sdc1 * 2048 62910463 62908416 30G 83 Linux
> /dev/sdc2 62910464 937701375 874790912 417,1G f W95 Ext'd (LBA)
> /dev/sdc5 62912512 125820927 62908416 30G 83 Linux
> /dev/sdc6 125822976 142591999 16769024 8G 82 Linux swap / Solaris
> /dev/sdc7 142594048 937701375 795107328 379,1G 83 Linux
>
>
>
> (but all I have at hand is an openSUSE, the debian version may be different)

LOL, you do realise this is a list for Debian users, right?

--
"If you're not careful, the newspapers will have you hating the people
who are being oppressed, and loving the people who are doing the
oppressing." --- Malcolm X

to...@tuxteam.de

unread,
Jan 8, 2016, 9:10:05 AM1/8/16
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sat, Jan 09, 2016 at 02:54:44AM +1300, Chris Bannister wrote:
> On Thu, Jan 07, 2016 at 04:53:34PM +0100, jdd wrote:

[...]

> > (but all I have at hand is an openSUSE, the debian version may be different)
>
> LOL, you do realise this is a list for Debian users, right?

But Debian users tend to be helpful and give others a hand (in my
experience, OpenSuSE users are very nice too. And don't get me
started on Arch: their wiki alone is a service to humankind so huge
that I've got no words for that :-)

- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlaPuk8ACgkQBcgs9XrR2kZ4ewCfVuzQKUF+fRI+ZIaeGCC8gxz5
SucAni76hcJi3j7dX6SVBDkP38Gv2xXM
=UXfg
-----END PGP SIGNATURE-----

Steve Matzura

unread,
Jan 9, 2016, 11:30:07 AM1/9/16
to
Sven:

On Thu, 7 Jan 2016 16:12:51 +0100, you wrote:

>You said in your first mail that /dev/sda6 was swap. And since Linux
>always numbers the logical partitions beginning from 5 and /dev/sda1 was
>/, /dev/sda2 can only be the extended partition, containing sda5-8.
>Simple deduction (and experience with the matter of course).
>
>(Side-note: this is also why I really like GPT instead of MSDOS as a
>partition table. No primary, extended and logical partition nonsense,
>kist 128 possible partitions without any special conventions.)

Thanks. More of that esoteric knowledge again, comes with experience I
know.
0 new messages