linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 'ioctl:: Inappropriate ioctl for device' when trying to shrink partition
@ 2011-01-12 18:45 Mikael Andersson
  2011-01-12 19:48 ` Leonidas Spyropoulos
  0 siblings, 1 reply; 3+ messages in thread
From: Mikael Andersson @ 2011-01-12 18:45 UTC (permalink / raw)
  To: linux-btrfs

E.g. btrfsctl -r -4000m /dev/sda5

results in:
ioctl:: Inappropriate ioctl for device

Distribution: Ubuntu 10.10
Kernel: 2.6.35-22-generic

According to the Synaptic Package manager, the version of btrfs-tools is
0.19+20100601-3

Other information that can be of interest:
- I started Ubuntu on a live CD
- before invoking the btrfsctl command I invoked apt-get update.

I have googled but have not found anything that seems to help me.

I have searched for "resize" on the following pages but have not find
anything:
https://btrfs.wiki.kernel.org/index.php/Problem_FAQ
https://btrfs.wiki.kernel.org/index.php/Gotchas

Thanks,

Mikael


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: 'ioctl:: Inappropriate ioctl for device' when trying to shrink partition
  2011-01-12 18:45 'ioctl:: Inappropriate ioctl for device' when trying to shrink partition Mikael Andersson
@ 2011-01-12 19:48 ` Leonidas Spyropoulos
  2011-01-13 11:33   ` Brian Rogers
  0 siblings, 1 reply; 3+ messages in thread
From: Leonidas Spyropoulos @ 2011-01-12 19:48 UTC (permalink / raw)
  To: Mikael Andersson; +Cc: linux-btrfs

On 12 January 2011 18:45, Mikael Andersson <mikael@develog.se> wrote:
> E.g. btrfsctl -r -4000m /dev/sda5
>
Hey Mikael,

btrfsctl is deprecated, you should use btrfs
In the previous example:
btrfs filesystem resize -4000m /dev/sda5

Check the help of btrfs

And also good to download latest btrfs-progs from git and compile them
yourself the version of btrfs-progs on LiveCD is old.


Latest version I use for example is: v0.19-35-g1b444cd


> results in:
> ioctl:: Inappropriate ioctl for device
>
> Distribution: Ubuntu 10.10
> Kernel: 2.6.35-22-generic
>
> According to the Synaptic Package manager, the version of btrfs-tools=
 is
> 0.19+20100601-3
>
> Other information that can be of interest:
> - I started Ubuntu on a live CD
> - before invoking the btrfsctl command I invoked apt-get update.
>
> I have googled but have not found anything that seems to help me.
>
> I have searched for "resize" on the following pages but have not find
> anything:
> https://btrfs.wiki.kernel.org/index.php/Problem_FAQ
> https://btrfs.wiki.kernel.org/index.php/Gotchas
>
> Thanks,
>
> Mikael
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs=
" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at =A0http://vger.kernel.org/majordomo-info.html
>



--=20
Caution: breathing may be hazardous to your health.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" =
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: 'ioctl:: Inappropriate ioctl for device' when trying to shrink partition
  2011-01-12 19:48 ` Leonidas Spyropoulos
@ 2011-01-13 11:33   ` Brian Rogers
  0 siblings, 0 replies; 3+ messages in thread
From: Brian Rogers @ 2011-01-13 11:33 UTC (permalink / raw)
  To: Leonidas Spyropoulos; +Cc: Mikael Andersson, linux-btrfs

On 01/12/2011 11:48 AM, Leonidas Spyropoulos wrote:
> On 12 January 2011 18:45, Mikael Andersson<mikael@develog.se>  wrote:
>> E.g. btrfsctl -r -4000m /dev/sda5
>>
> Hey Mikael,
>
> btrfsctl is deprecated, you should use btrfs
> In the previous example:
> btrfs filesystem resize -4000m /dev/sda5

The command isn't asking for the name of the device. It wants the path 
to a mounted btrfs filesystem. So more like:
btrfs filesystem resize -4000m /mnt

Also, the manpage doesn't say this, but you can specify which device to 
resize. If you run 'btrfs filesystem show', it will show a device id for 
each device. Then you can specify the devid to resize like this 
(assuming you want to resize device 2):
btrfs filesystem resize 2:-4000m /mnt

To actually use this space for a new partition, you'll have to delete 
and re-create (without reformatting!) the btrfs partition with the 
smaller size. I don't know if there's a way to do this part on a live 
system without unmounting.

> Check the help of btrfs
>
> And also good to download latest btrfs-progs from git and compile them
> yourself the version of btrfs-progs on LiveCD is old.
>
>
> Latest version I use for example is: v0.19-35-g1b444cd
>
>
>> results in:
>> ioctl:: Inappropriate ioctl for device

I believe you'll also get this same error message if there's not enough 
space to do the shrinking, so be aware of that.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-01-13 11:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-12 18:45 'ioctl:: Inappropriate ioctl for device' when trying to shrink partition Mikael Andersson
2011-01-12 19:48 ` Leonidas Spyropoulos
2011-01-13 11:33   ` Brian Rogers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).