LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 12-29-2018, 09:47 AM   #1
cranon
LQ Newbie
 
Registered: Nov 2018
Posts: 6

Rep: Reputation: Disabled
I repartirioned a ntfs partition and now i cant mount the drive.


I used parted to rezise the partion from a live distro and now i cant mount the harddrive.

mount -a:
failed to read the last sector(5860530174): invalid argument
failed to mount "/dev/sdb1" doesnt seem to have a valid ntfs

Please help me!
 
Old 12-29-2018, 09:57 AM   #2
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth? I would say I hope so but I'm not so sure about that... I could just be a figment of your imagination too.
Distribution: Currently OpenMandriva. Previously openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,436

Rep: Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781
Quote:
Originally Posted by cranon View Post
I used parted to rezise the partion from a live distro and now i cant mount the harddrive.

mount -a:
failed to read the last sector(5860530174): invalid argument
failed to mount "/dev/sdb1" doesnt seem to have a valid ntfs

Please help me!
Not sure how you "repartitioned" the drive, but something has gone very wrong, and I'd say that the filesystem has corrupted in the process.

How exactly did you use parted to repartition that drive?
Do you have a backup of what was on that drive?
 
1 members found this post helpful.
Old 12-29-2018, 10:03 AM   #3
cranon
LQ Newbie
 
Registered: Nov 2018
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jsbjsb001 View Post
Not sure how you "repartitioned" the drive, but something has gone very wrong, and I'd say that the filesystem has corrupted in the process.

How exactly did you use parted to repartition that drive?
Do you have a backup of what was on that drive?
I ran parted then rezisepart. Then typed in 2500. I assumed it was gigabyte but it seems like its megabyte. I dont have backup. Is there anyway i can recover it? It is important to me but i cant backup as i dont have any harddrives for that purpose.

Last edited by cranon; 12-29-2018 at 10:04 AM.
 
Old 12-29-2018, 10:03 AM   #4
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 19.1 MATE
Posts: 8,018
Blog Entries: 5

Rep: Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872
This may be slightly off-topic and I apologise that it doesn't assist your current predicament, but from experience I recommend using a Linux tool to resize ext partitions and a Windows tool to resize ntfs partitions. For the latter I personally use a live media containing the free ISO of MiniTool Partition Wizard.
 
Old 12-29-2018, 10:05 AM   #5
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth? I would say I hope so but I'm not so sure about that... I could just be a figment of your imagination too.
Distribution: Currently OpenMandriva. Previously openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,436

Rep: Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781
Quote:
Originally Posted by cranon View Post
I ran parted then rezisepart. Then typed in 2500. I assumed it was gigabyte but it seems like its megabyte. I dont have backup. Is there anyway i can recover it?
From what I've highlighted in bold; it sounds like you actually shrunk the filesystem. You really should use Windows tools if it's NTFS.

EDIT: If there is a way, I'm not sure what it is. I suspect that's going to be a lot easier said than done.

Last edited by jsbjsb001; 12-29-2018 at 10:07 AM.
 
Old 12-29-2018, 10:13 AM   #6
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 19.1 MATE
Posts: 8,018
Blog Entries: 5

Rep: Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872
I personally don't think you'll be able to recover the situation. You should now be looking at data recovery techniques. You may want to throw the filesystem at a Windows-based filesystem checker to try and restore the data still remaining in any reduced filesystem but you may lose data in the process if you're not careful.

In future, you should always backup your data before attempting similar partition resizes.
 
1 members found this post helpful.
Old 12-29-2018, 10:36 AM   #7
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 4,360

Rep: Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001
If you resize the partition back to its original size (or larger), the filesystem should be fine. Your problem was that resizepart does not adjust the filesystem. You need to shrink the filesystem first, then shrink the partition. Tools like gparted can handle that properly for any filesystem it recognizes (except for XFS, of course, which cannot be shrunk).

Last edited by rknichols; 12-29-2018 at 10:37 AM.
 
3 members found this post helpful.
Old 12-29-2018, 10:51 AM   #8
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 19.1 MATE
Posts: 8,018
Blog Entries: 5

Rep: Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872
Quote:
Originally Posted by rknichols View Post
If you resize the partition back to its original size (or larger), the filesystem should be fine. Your problem was that resizepart does not adjust the filesystem. You need to shrink the filesystem first, then shrink the partition. Tools like gparted can handle that properly for any filesystem it recognizes (except for XFS, of course, which cannot be shrunk).
Thanks for posting this. I look forward to standing corrected on the situation being recoverable. I assumed that the filesystem itself had been reduced in size.
 
Old 12-29-2018, 10:54 AM   #9
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 4,360

Rep: Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001
Quote:
Originally Posted by hydrurga View Post
Thanks for posting this. I look forward to standing corrected on the situation being recoverable. I assumed that the filesystem itself had been reduced in size.
From the parted manual (emphasis mine):
2.4.10 resizepart

Command: resizepart number end

Moves the end position of partition number. Note that this does not modify any filesystem present in the partition. If you wish to do this, you will need to use external tools, such as resize2fs.

When growing a partition you will want to grow the filesystem afterwards, but when shrinking, you need to shrink the filesystem before the partition.
 
1 members found this post helpful.
Old 12-29-2018, 11:00 AM   #10
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth? I would say I hope so but I'm not so sure about that... I could just be a figment of your imagination too.
Distribution: Currently OpenMandriva. Previously openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,436

Rep: Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781
Quote:
Originally Posted by hydrurga View Post
...
I assumed that the filesystem itself had been reduced in size.
That's what I was thinking too. Trust rknichols to know the answer! I think he should change his username to "The disk and filesystem doctor".

 
Old 12-29-2018, 12:59 PM   #11
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,164

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
Quote:
Originally Posted by rknichols View Post
If you wish to do this, you will need to use external tools, such as resize2fs.
In this case: ntfsresize
Code:
resize an NTFS filesystem without data loss
(from the man page).
 
Old 12-29-2018, 06:21 PM   #12
colorpurple21859
Senior Member
 
Registered: Jan 2008
Location: florida panhandle
Distribution: slackware64-current, fedora, ubuntu, others
Posts: 3,924

Rep: Reputation: 660Reputation: 660Reputation: 660Reputation: 660Reputation: 660Reputation: 660
if this is a gpt drive you may be able to recover it with g-disk advance/recovery options.
 
Old 12-31-2018, 02:06 AM   #13
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 1,438
Blog Entries: 1

Rep: Reputation: Disabled
You did really bad. The first thing to do after witnessing errors was to try to rescue lost partition with exactly the same tool: parted. Once this would be done could again try to resize partition. Probably it still possible: I mean to rescue.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ran mkfs.vfat over top ntfs partition... any way to restore ntfs partition info? oryan_dunn Linux - Hardware 8 10-14-2010 07:08 PM
how mount mount ntfs partition of windows xp kashif2131971 Linux - Newbie 3 07-07-2009 07:34 PM
NTFS hard drive now fails to mount Captain Tram Linux - Hardware 1 08-21-2006 05:30 PM
NTFS (winxp) drive is accessible only by root, why NTFS (winxp) drive not accessible Samppa72 Linux - Software 1 07-26-2004 04:13 PM
Cant mount NTFS Hard drive monkeymartin Linux - General 5 08-10-2003 10:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration