Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi, I'm new in this forum and in Linux generally. I have installed Suse 9.1 on an old PC and now I want to install it on a normal one. I have Windows XP Home on a 37,25G partition and I want to resize it to 30G so that I can create a swap partition and a 7G (or something less) ReiserFS partition. I used ntfsresize in the old PC, but I damaged all partitions (cause I didn’t know how to use ntfsresize; I hadn’t found the guide below), so now I am asking you if everything I am going to do is right before I proceed (I want to do it manually and not with Partition Magic cause I don’t have it).
# ./ntfsresize --size 30000M /dev/hda1
ntfsresize v1.7.1
NTFS volume version: 3.1
Cluster size : 4096 bytes
Current volume size: 20390432768 bytes (20391 MB)
Current device size: 20390436864 bytes (20391 MB)
New volume size : 10999996416 bytes (11000 MB)
Checking filesystem consistency ...
100.00 percent completed
Accounting clusters ...
Space in use : 7851 MB (38.5%)
WARNING: Every sanity check passed and only the DANGEROUS operations left.
Please make sure all your important data had been backed up in case of an
unexpected failure!
Are you sure you want to proceed (y/[n])? y
Schedule chkdsk NTFS consistency check at Windows boot time ...
Resetting $LogFile ... (this might take a while)
Updating $BadClust file ...
Updating $Bitmap file ...
Updating Boot record ...
Syncing device ...
NTFS had been successfully resized on device '/dev/hda1'.
You can go on to resize the device e.g. with 'fdisk'.
IMPORTANT: When recreating the partition, make sure you
1) create it with the same starting disk cylinder
2) create it with the same partition type (usually 7, HPFS/NTFS)
3) do not make it smaller than the new NTFS filesystem size
4) set the bootable flag for the partition if it existed before
Otherwise you may lose your data or can't boot your computer from the disk!
# fdisk /dev/hda
Command (m for help): p
Disk /dev/hda: 255 heads, 63 sectors, 2480 cylinders
Units = cylinders of 16065 * 512 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 2479 19912536 7 HPFS/NTFS
Command (m for help): d
Partition number (1-4): 1
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-2480, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (1-2480, default 2480): +30100M
Command (m for help): t
Partition number (1-4): 1
Hex code (type L to list codes): 7
Changed system type of partition 1 to 7 (HPFS/NTFS)
Command (m for help): a
Partition number (1-4): 1
Command (m for help): p
Disk /dev/hda: 255 heads, 63 sectors, 2480 cylinders
Units = cylinders of 16065 * 512 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 1403 11269566 7 HPFS/NTFS
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
Is it correct?
What should I be careful at?
What about bugs in ntfsresize?
Anyway, this mini-guide can be used by others like me who don’t know how do resize a partition using Linux.
It looks OK. What is risky is ntfsresize. So I'd recommend to copy your most important files somewhere... ntfsresize works for most people. That's all I can say.
The second part, with fdisk, can be repeated or fixed when something goes wrong (and at this strage it shouldn't).
Note that 'normal' reisize of partition does not look that way. Linux partitions can be resized more easily (using parted or its frontends). The only problem is with NTFS.
Ntfsresize is very mature and safe but resizing an NTFS partititon requires resizing BOTH the filesystem and the partition.
Unfortunately the partitioning resizing part, depending on the partitioning tool, can be error-prone, moreover many softwares have or had minor or major bugs that resulted unbootable Windows or lost partitions independently of the filesystems in use (FAT32, NTFS, ext3, reiserfs, etc).
The partitioning problems are always recoverable if you saved your original partition table. Hence it's important that if you don't trust yourself then save your partition table. But do so otherwise as well ;-)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.