Solved

How make an unattended partitioning of the NTFS partitions under Linux without destroying data.

Posted on 2010-09-02
20
515 Views
Last Modified: 2013-12-01
Hello,

I need to resize the NTFS partitions of my disk from Linux.
I've found two ways to do it :

1) ntfsresize
2) gparted

the first tool works under the shell,it is good,but I read that it is not secure because it does not resize really the partitions,it modifies only the partition table. I don't like too much this way. The second one is to use gparted. Here the problem is that I should make the unattended partitioning of the disk for third party,assuming that they aren't so experienced to do it by themselfes.
For unattended partitioning I mean that I have two choices to do it for someone :

1) use some kind of tool able to record the keys pressed and the mouse buttons clicked
2) use gparted without gui
3) find a tool that does not alters only the partition table,but that makes a real resize of the NTFS partitions,that works without a GUI.

Please suggest something to me. 10x
0
Comment
Question by:marietto2008
  • 10
  • 7
  • 2
20 Comments
 
LVL 3

Accepted Solution

by:
simoesp earned 500 total points
ID: 33588150
sry.. didn't noticed it was for using without a guy

u can allways use ntfsresize

http://www.linux-ntfs.org/doku.php?id=ntfsresize
0
 
LVL 2

Author Comment

by:marietto2008
ID: 33588264
Yes,I tried it. My question is : ntfsresize rebuilds only the partition table or it makes a real resize of the partitions ? I tried both,but it seems that only gparted makes a real resize of the partitions.
0
 
LVL 2

Author Comment

by:marietto2008
ID: 33588272
Can I use gparted without a gui ? Which parameters should I pass to the boot ?
0
 
LVL 3

Expert Comment

by:simoesp
ID: 33588488
Will work in various difficult situations:
No defragmentation needed prior to use
Supports both shrinking and expanding NTFS
Supports resizing volumes with known bad sectors in them

let me check the manual i don0t use this command for a long time
0
 
LVL 3

Expert Comment

by:simoesp
ID: 33588523
0
 
LVL 2

Author Comment

by:marietto2008
ID: 33588610
it seems that ntfsresize is included in gparted. But if it like this,please answer to this question : why if I resize the ntfs partitions using ntfsresize from the shell it takes a little time,but when I do it using gparted it takes so *much* time ?
0
 
LVL 3

Expert Comment

by:simoesp
ID: 33589124
what command options you use on ntfsresize and gparted
0
 
LVL 2

Author Comment

by:marietto2008
ID: 33591246
lsize_sda2=$(echo pq | fdisk /dev/sda2 | grep "Disk /dev"| cut -f 5 -d \ )
lsize_sda2=$(echo $lsize | cut -f1 -d'.')
let lnum_sda2=$lsize_sda2-1
echo $lnum_sda2
ntfsresize -n -s $lnum_sda2'G' /dev/sda2

with gparted I use no options,because I use always the gui
0
 
LVL 3

Expert Comment

by:simoesp
ID: 33591929
-n, –no-action
              Use this option to make a test run before doing the  real  resize  operation.   Volume  will  be  opened
              read-only  and  ntfsresize displays what it would do if it were to resize the filesystem.  Continue with
              the real resizing only if the test run passed.
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
LVL 3

Expert Comment

by:simoesp
ID: 33591937
that why it's making fast resize and doesn't resize

the -n it's for no action
0
 
LVL 2

Author Comment

by:marietto2008
ID: 33591972
:D I've not used it when I did tests. Now I forgot it when I've copied and pasted the text
0
 
LVL 3

Expert Comment

by:simoesp
ID: 33591991
i've made some resizing test on an old computer and it whent fine with ntfs resize :-\ but if u whant to make a backup first u can use ntfsclone
0
 
LVL 3

Expert Comment

by:simoesp
ID: 33592024
but don't forget to make an chkdsk /f later b/c sometimes it leaves some errors behind

Removed illegal CD.

rindi,
EE ZA Storage
0
 
LVL 3

Expert Comment

by:simoesp
ID: 33592059
and one thing ntfsresize will defrag your disk first to the allocated sectors before changing the partition table
0
 
LVL 2

Author Comment

by:marietto2008
ID: 33592244
I did the whole procedure right now. After having resized /dev/sda2 and /dev/sda1,I've rebooted and I've tried to boot Windows. It did not work, Before to be able to boot it I have to fire up the rescue console of Windows 7 because I can't do it from Windows 7. Every time I do the same procedure with gparted it does not ask to me to make chkdsk /f from Windows. Why ?

Removed question about illegal CD

rindi,
EE ZA Storage
0
 
LVL 2

Author Comment

by:marietto2008
ID: 33592284
partition magic is free ? Maybe I can use without a gui....
0
 
LVL 3

Expert Comment

by:simoesp
ID: 33592353
partition magic it isn't free. {Removed name of illegal CD. rindi, EE ZA Storage}



there's another prog i think it's called DiskDrake that comes with mandriva don't know if it works but u gan give it a try

u can also try ntfsfix to make an "chkdsk" but it doen't fix everything u can allwa use the windows 7 cd and enter in recovery console..

going to sleep cya tomorrow =)
0
 
LVL 1

Expert Comment

by:Vee_Mod
ID: 33870063
All -
I deleted a reference to a certain well-known CD
It contains pirated (stolen) applications and we do not allow any reference to it on our forum.

 
Vee_Mod
Experts Exchange Moderator
0
 
LVL 1

Expert Comment

by:Vee_Mod
ID: 33870074
@rindi - you're doing a great job of catching all of these instances of THAT CD and I appreciate it.
If you could replace that actual name with "[Admin Edit]", they will stop showing up in the search I do every month.

Keep up the great work!
Thanks,
VM
0

Featured Post

Network it in WD Red

There's an industry-leading WD Red drive for every compatible NAS system to help fulfill your data storage needs. With drives up to 8TB, WD Red offers a wide array of solutions for customers looking to build the biggest, best-performing NAS storage solution.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SAN storage advice? 8 77
Best practice on creating a second drive in VM environment 6 72
Set-Top-Box hardware and Open Source! 8 144
SSD pci  question 16 24
Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now