You are not logged in.

#1 2010-02-08 10:37:40

johan84
Member
Registered: 2010-02-08
Posts: 8

NTFS >< EXT; dm-crypt + LVM: shrink logical volume without destroying

Hi everyone,

I've just installed Arch on a seperate pc to "test" it, so far the guide was very usefull.
I've got a few questions though:

1) LVM: How to shrink volume (using EXT4) without destroying the volume? (error after rebooting: "block count exceeds size of device") The LVM is on top of dm-crypt (as described in the guide).

(You don't have to read all this, it is just to explain why I ask this question)
During the install I chose to use dm-crypt (following the guide), I made a cryptpool and 3 logical volumes: swap, root, home (root and home using EXT4)
I didn't use all the space available in the pool (it was easy to enlarge the volumes at a later time).
I didn't want to postpone it too lang (to avoid problems in the future) so I enlarged my home volume to the maximum, but forgot my root was only 5GB. I thought this wouldn't be a problem: just take 5GB back from the home and give it to the root, but then the problem started. I corrupted the superblock of my home volume (I think) and got the following error "block count exceeds size of device".
Rebooting Arch was a bad idea because it stopped after checking the filesystems. It said to me to fix it or press ctrl-D (wich reboots Arch). So I removed the /home from my fstab, then rebooted, removed the home volume (as I wasn't able to fix it) and then created a new one. I lost everything on the /home (not really a problem now, but in the future I want to avoid this, if possible).

So my question: is it possible to shrink a volume using EXT4 without "killing" it.
Any suggestion is good, as I will try it and report back if it succeeds or not ...

2) Should I reformat my drives from NTFS to EXT4 (or something else) (I don't think is possible to "convert")

So I think I'm ready to switch "completely" to a linux distro (Archlinux), should I reformat all my drives to EXT4 (or something else). At the moment I'm using NTFS on all my drives. I read on another forum that although with the ntfs-3g driver it is possible to read/write to such a partition, it is best to switch because it could fragment my drive and it isn't possible to defrag in linux ...
In the rare occasion that I'm going to use windows I can share my drives as samba/ftp (this works allready)
Is it worth the trouble to move all data to a temporary HD and reformat. (It's time consuming and most disks are 1TB, and I don't have a lot of free diskspace).

I couldn't really find an appropriate sub-forum so I posted here (feel free to move my post if it doesn't belong here).

Thanks in advance,

Johan

Offline

#2 2010-02-16 21:04:40

buergi
Member
Registered: 2008-09-30
Posts: 4

Re: NTFS >< EXT; dm-crypt + LVM: shrink logical volume without destroying

sure it's possible to resize a volume, but you have to resize the filesystem before resizing the LV.
There are many forum and blog posts about that out there, e.g. this one.

Don't know what you mean with "reformat all drives". If you use linux NTFS is of course a bad choice for a file system. For USB disks it might be useful when compatibility with windows computers is desired. But don't just "reformat" them, since this kills all your data of course.
So backup data, format partition and restore the data to the new formated (and thus empty) partition.

Offline

Board footer

Powered by FluxBB