- Чем можно изменить размер физического тома с NTFS
- Re: Чем можно изменить размер физического тома с NTFS
- Re: Чем можно изменить размер физического тома с NTFS
- Re: Чем можно изменить размер физического тома с NTFS
- Re: Чем можно изменить размер физического тома с NTFS
- Re: Чем можно изменить размер физического тома с NTFS
- Расширение диска или раздела Linux
- Шаг 1. Расширение раздела
- Обычные тома
- Шаг 2. Изменение размера для файловой системы
- Увеличение разделов с Gparted
- NTFS-3G
- Contents
- Installation
- Manual mounting
- Formatting
- Configuring
- Default settings
- Linux compatible permissions
- Allowing group/user
- Basic NTFS-3G options
- Allowing user to mount
- Resizing NTFS partition
- Troubleshooting
- Compressed files
- Damaged NTFS filesystems
- Metadata kept in Windows cache, refused to mount
- Deleting Windows hibernate metadata
- Mount failure
- Windows mount failure
- Beta features and releases
Чем можно изменить размер физического тома с NTFS
Доброго времени суток
Сабж. Без потери данных, естественно.
Re: Чем можно изменить размер физического тома с NTFS
Fedore’овская anaconda может
Re: Чем можно изменить размер физического тома с NTFS
ntfsresize (пакет ntfsprogs)
если не хочется читать кучу документации и сделать все быстро и безопасно
Gparted (пакет ntfsprogs все равно нужен)
Бэкап все же лучше сделать, проверка диска ntfs после изменения раздела обязательна, у меня там была куча каких то однообразных ошибок, все данные на месте
Re: Чем можно изменить размер физического тома с NTFS
Всегда считал, что gparted — морда к parted и ничего больше 🙂 Пойду перечитаю документацию. Спасибо!
Re: Чем можно изменить размер физического тома с NTFS
gparted «морда» много к чему еще, в частности к ntfsresize )
Re: Чем можно изменить размер физического тома с NTFS
вот так оно поколдовало у меня в скукоживании раздела винды )
Libparted 1.7.1
Shrink /dev/hda2 from 32.46 GiB to 21.49 GiB 01:51 ( SUCCESS )
calibrate /dev/hda2 00:00 ( SUCCESS )
path: /dev/hda2
start: 3903795
end: 71971199
size: 68067405 (32.46 GiB)
calculate new size and position of /dev/hda2 00:00 ( SUCCESS )
requested start: 3903795
requested end: 48966119
requested size: 45062325 (21.49 GiB)
new start: 3903795
new end: 48966119
new size: 45062325 (21.49 GiB)
check filesystem on /dev/hda2 for errors and (if possible) fix them 00:09 ( SUCCESS )
ntfsresize -P -i -f -v /dev/hda2
ntfsresize v2.0.0 (libntfs 10:0:0)
Device name : /dev/hda2
NTFS volume version: 3.1
Cluster size : 512 bytes
Current volume size: 34850511360 bytes (34851 MB)
Current device size: 34850511360 bytes (34851 MB)
Checking for bad sectors .
Checking filesystem consistency .
Accounting clusters .
Space in use : 10063 MB (28.9%)
Collecting resizing constraints .
Estimating smallest shrunken size supported .
File feature Last used at By inode
$MFT : 23666 MB 0
Multi-Record : 25197 MB 30191
$MFTMirr : 17426 MB 1
Compressed : 25200 MB 42034
Ordinary : 25201 MB 10941
You might resize at 10062664192 bytes or 10063 MB (freeing 24788 MB).
Please make a test run using both the -n and -s options before real resizing!
shrink filesystem 01:14 ( SUCCESS )
run simulation 00:11 ( SUCCESS )
ntfsresize -P —force —force /dev/hda2 -s 23071910399 —no-action
ntfsresize v2.0.0 (libntfs 10:0:0)
Device name : /dev/hda2
NTFS volume version: 3.1
Cluster size : 512 bytes
Current volume size: 34850511360 bytes (34851 MB)
Current device size: 34850511360 bytes (34851 MB)
New volume size : 23071909888 bytes (23072 MB)
Checking filesystem consistency .
Accounting clusters .
Space in use : 10063 MB (28.9%)
Collecting resizing constraints .
Needed relocations : 627610 (322 MB)
Schedule chkdsk for NTFS consistency check at Windows boot time .
Resetting $LogFile . (this might take a while)
Relocating needed data .
Updating $BadClust file .
Updating $Bitmap file .
Updating Boot record .
The read-only test run ended successfully.
real resize 01:03 ( SUCCESS )
ntfsresize -P —force —force /dev/hda2 -s 23071910399
ntfsresize v2.0.0 (libntfs 10:0:0)
Device name : /dev/hda2
NTFS volume version: 3.1
Cluster size : 512 bytes
Current volume size: 34850511360 bytes (34851 MB)
Current device size: 34850511360 bytes (34851 MB)
New volume size : 23071909888 bytes (23072 MB)
Checking filesystem consistency .
Accounting clusters .
Space in use : 10063 MB (28.9%)
Collecting resizing constraints .
Needed relocations : 627610 (322 MB)
Schedule chkdsk for NTFS consistency check at Windows boot time .
Resetting $LogFile . (this might take a while)
Relocating needed data .
Updating $BadClust file .
Updating $Bitmap file .
Updating Boot record .
Syncing device .
Successfully resized NTFS on device ‘/dev/hda2’.
You can go on to shrink the device for example with Linux fdisk.
IMPORTANT: When recreating the partition, make sure that you
1) create it at the same disk sector (use sector as the unit!)
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 won’t be able to access NTFS or can’t boot from the disk!
If you make a mistake and don’t have a partition table backup then you
can recover the partition table by TestDisk or Parted’s rescue mode.
shrink partition from 32.46 GiB to 21.49 GiB 00:00 ( SUCCESS )
old start: 3903795
old end: 71971199
old size: 68067405 (32.46 GiB)
new start: 3903795
new end: 48966119
new size: 45062325 (21.49 GiB)
check filesystem on /dev/hda2 for errors and (if possible) fix them 00:09 ( SUCCESS )
ntfsresize -P -i -f -v /dev/hda2
ntfsresize v2.0.0 (libntfs 10:0:0)
Device name : /dev/hda2
NTFS volume version: 3.1
Cluster size : 512 bytes
Current volume size: 23071909888 bytes (23072 MB)
Current device size: 23071910400 bytes (23072 MB)
Checking for bad sectors .
Checking filesystem consistency .
Accounting clusters .
Space in use : 10060 MB (43.6%)
Collecting resizing constraints .
Estimating smallest shrunken size supported .
File feature Last used at By inode
$MFT : 19454 MB 0
Multi-Record : 11950 MB 13110
$MFTMirr : 17426 MB 1
Compressed : 11180 MB 37966
Ordinary : 22379 MB 43721
You might resize at 10059788288 bytes or 10060 MB (freeing 13012 MB).
Please make a test run using both the -n and -s options before real resizing!
grow filesystem to fill the partition 00:19 ( SUCCESS )
run simulation 00:10 ( SUCCESS )
ntfsresize -P —force —force /dev/hda2 —no-action
ntfsresize v2.0.0 (libntfs 10:0:0)
Device name : /dev/hda2
NTFS volume version: 3.1
Cluster size : 512 bytes
Current volume size: 23071909888 bytes (23072 MB)
Current device size: 23071910400 bytes (23072 MB)
New volume size : 23071910400 bytes (23072 MB)
Checking filesystem consistency .
Accounting clusters .
Space in use : 10060 MB (43.6%)
Collecting resizing constraints .
Schedule chkdsk for NTFS consistency check at Windows boot time .
Resetting $LogFile . (this might take a while)
Updating $BadClust file .
Updating $Bitmap file .
Updating Boot record .
The read-only test run ended successfully.
real resize 00:09 ( SUCCESS )
ntfsresize -P —force —force /dev/hda2
ntfsresize v2.0.0 (libntfs 10:0:0)
Device name : /dev/hda2
NTFS volume version: 3.1
Cluster size : 512 bytes
Current volume size: 23071909888 bytes (23072 MB)
Current device size: 23071910400 bytes (23072 MB)
New volume size : 23071910400 bytes (23072 MB)
Checking filesystem consistency .
Accounting clusters .
Space in use : 10060 MB (43.6%)
Collecting resizing constraints .
Schedule chkdsk for 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 .
Successfully resized NTFS on device ‘/dev/hda2’.
Источник
Расширение диска или раздела Linux
В инструкции рассмотрены сценарии расширения дискового пространства разделов в Linux без потери информации.
Принцип увеличения диска:
- Расширение раздела.
- Изменение размера файловой системы.
В зависимости от типа раздела и файловой системы, действия различаются.
Любая работа с диском несет риск потери информации. Перед началом работ убедитесь в наличие резервных копий ценных данных.
Шаг 1. Расширение раздела
Обычные тома
Допустим, есть диск /dev/sdb и раздел /dev/sdb2, который нужно увеличить.
Сначала необходимо отмонтировать раздел:
В случае работы с корневой директорией, отмонтировать ее не получиться. В таком случае необходимо загрузить компьютер с LiveCD.
Подключаемся утилитой fdisk к /dev/sdb:
Если мы работаем с разделом более чем 2Тб, используем утилиту parted.
Смотрим номера разделов:
Удаляем раздел (не переживайте — все данные сохраняются):
* в моем примере, раздел для удаления на второй позиции.
Создаем новый раздел:
Номер раздела — 2:
На запрос начального и конечного секторов просто нажимаем Enter.
Если раздел был загрузочный, добавляем соответствующий флаг:
Еще раз проверяем, что получилось:
LVM-тома расширяются на лету, даже для корневых разделов. В данном примере, работаем с /dev/sda.
Открываем диск утилитой fdisk:
* напомню, что при работе с диском 2Тб и более, следует использовать утилиту parted.
Создаем еще один раздел:
Номер раздела оставляем тот, который предлагает система (просто нажимаем Enter).
Первый и последний сектора также оставляем по умолчанию для использования всего дискового пространства (еще два раза Enter).
Задаем тип раздела:
Выбираем номер раздела (в моем примере создавался раздел 3):
Командой L можно посмотреть список всех типов, но нас интересует конкретный — LVM (8e):
Проинформируем систему, что в таблице разделов произошли изменения:
Создаем физический том из нового раздела:
Смотрим наши Volume Group и для нужного добавляем созданный том:
vgextend vg_centos /dev/sda3
* в моем примере группа томов LVM называется vg_centos
Смотрим LVM-разделы и расширяем пространства для нужного:
lvextend -l +100%FREE /dev/vg_centos/lv_root
* данная команда расширяем LVM-раздел /dev/vg_centos/lv_root, используя все свободное пространство (100%FREE).
Шаг 2. Изменение размера для файловой системы
После того, как на предыдущем шаге мы расширили раздел, система по-прежнему будет видеть старый по объему диск. Чтобы это исправить, необходимо выполнить команду по изменению размера файловой системы. В зависимости от последней, команды различаются.
Посмотреть файловую систему:
ext2/ext3/ext4:
XFS:
Reiserfs:
* обратите внимание, что в данных примерах используются различные устройства.
Если раздел был отмонтирован, монтируем его, например:
mount /dev/sda2 /mnt
Проверяем, что настройки применились:
Увеличение разделов с Gparted
Если работы выполняются на системе с графическим интерфейсом или есть возможность перезагрузить сервер и загрузиться с LiveCD, можно воспользоваться простым средством — утилитой Gparted, которая позволяем менять размер разделов мышкой.
Запускаем утилиту — выбираем диск, с которым будем работать — кликаем правой кнопкой по разделу, который хотим увеличить и выбираем Resize/Move:
В открывшемся окне с помощью мышки или форм меняем размер раздела:
Нажимаем кнопку Resize/Move.
Проверяем изменения в окне программы и сохраняем настройки кнопкой «Apply All Operations»:
Источник
NTFS-3G
NTFS-3G is an open source implementation of Microsoft NTFS that includes read and write support (the Linux kernel only supports reading NTFS). NTFS-3G developers use the FUSE file system to facilitate development and to help with portability.
Contents
Installation
Manual mounting
Two options exist when manually mounting NTFS partitions. The traditional:
The mount type ntfs-3g does not need to be explicitly specified in Arch. The mount command by default will use /usr/bin/mount.ntfs which is symlinked to /usr/bin/ntfs-3g after the ntfs-3g package is installed.
The second option is to call ntfs-3g directly:
See ntfs-3g(8) for the available options.
Formatting
Configuring
Your NTFS partition(s) can be setup to mount automatically, or pre-configured to be able to mount in a certain way when you would like them to be mounted. This configuration can be done in the static filesystem configuration (fstab) or by the use of udev rules.
Default settings
Using the default settings will mount the NTFS partition(s) at boot. With this method, if the parent folder that it is mounted upon has the proper user or group permissions (e.g. /run/media/ /), then that user or group will be able to read and write on that partition(s).
Linux compatible permissions
Permissions on a Linux system are normally set to 755 for folders and 644 for files. It is recommended to keep these permissions in use for the NTFS partition as well if you use the partition on a regular basis. The following example assigns the above permissions to a normal user:
Alternatively, if the Windows permissions do matter to you, you can use the ntfsusermap(8) command to map Windows users to Linux ones. ntfs-3g will handle the translation of these permissions.
Allowing group/user
In /etc/fstab you can also specify other options like those who are allowed to access (read) the partition. For example, for you to allow people in the groupid group to have access:
By default, the above line will enable write support for root only. To enable user writing, you have to specify the user who should be granted write permissions. Use the uid parameter together with your user id to enable user writing:
If you are running on a single user machine, you may like to own the file system yourself and grant all possible permissions:
Basic NTFS-3G options
For most, the above settings should suffice. Here are a few other options that are general common options for various Linux filesystems. For a complete list, see ntfs-3g(8) § OPTIONS .
umask umask is a built-in shell command which automatically sets file permissions on newly created files. For Arch Linux, the default umask for root and user is 0022. With 0022 new folders have the directory permissions of 755 and new files have permissions of 644. You can read more about umask permissions here. fmask and dmask Like umask but defining file and directory respectively individually. noauto If noauto is set, NTFS entries in /etc/fstab do not get mounted automatically at boot. uid The user id. This allows a specific user to have full access to the partition. Your uid can be found with the id command.
The following option is specific to ntfs-3g only:
windows_names prevents files, directories and extended attributes to be created with a name not allowed by windows.
Allowing user to mount
By default, ntfs-3g requires root rights to mount the filesystem if it is a block device, even with the user option in /etc/fstab . See ntfs-3g-faq for details. The user option in the fstab is still required.
For non-blockfiles like normal images, ntfs-3g on the command-line should work out-of-the-box with normal user privileges as the underlying FUSE calls are redirected to the setuid-root fusermount when direct kernel interaction is unavailable.
Resizing NTFS partition
Most systems that are purchased already have Windows installed on it, and some people would prefer not wipe it off completely when doing an Arch Linux installation. For this reason, among others, it is useful to resize the existing Windows partition to make room for a Linux partition or two. This is often accomplished with a Live CD or bootable USB thumb drive.
For Live CDs the typical procedure is to download an ISO file, burn it to a CD, and then boot from it. InfraRecorder is a free (as in GPL3) CD/DVD burning application for Windows which fits the bill nicely. If you would rather use a bootable USB media instead, see USB flash installation media for methods to create bootable USB stick.
There are a number of bootable CD/USB images avaliable. This list is not exhaustive, but is a good place to start:
- GParted — Small bootable GNU/Linux distribution for x86 based computers. It enables you to use all the features of the latest versions of the GParted application. Does not include additional packages System Rescue CD may incorporate, and disk encryption schemes may not be supported.
http://gparted.sourceforge.net/ || gparted
- Parted Magic — Very good complete hard disk management solution. With the Partition Editor you can re-size, copy, and move partitions. You can grow or shrink your C: drive. Create space for new operating systems. Attempt data rescue from lost partitions.
https://partedmagic.com/ ||
- SystemRescueCD — Good tool to have, and works seamlessly in most cases. Once booted, run GParted and the rest should be fairly obvious.
https://www.sysresccd.org/ || systemrescuecdAUR
Note that the important programs for resizing NTFS partitions include ntfs-3g and a utility like (G)parted or fdisk, provided by the util-linux package. Unless you are an «advanced» user it is advisable to use a tool like GParted to perform any resize operations to minimize the chance of data loss due to user error.
If you already have Arch Linux installed on your system and simply want to resize an existing NTFS partition, you can use the parted and ntfs-3g packages to do it. Optionally, you can use the GParted GUI after installing the GParted package. At the core of the resizing is the ntfsresize(8) command.
Troubleshooting
Compressed files
When mounting an NTFS filesystem for Windows 10, and reading files or directories, you may
- see broken symbolic links to ‘unsupported reparse point’, or
- see the error message cannot access some_file: Input/output error (in this case you see Could not load plugin /usr/lib64/ntfs-3g/ntfs-plugin-80000017.so: Success in the journal).
The reason for this are NTFS reparse points, and that NTFS-3G does not support some types of reparse points by default. NTFS-3G plugins may be used to provide compatibility with a part of the features defined by the following reparse points
- System compression
- Deduplicated files
- OneDrive files
See this page for further details.
System compression a.k.a. «Compact OS» compresses certain files. There are two possible workarounds for System compression.
You may install the NTFS-3G plugin ntfs-3g-system-compression AUR . Currently only reading is supported by this plugin, but not writing, i.e. creating or updating files is not supported.
Alternatively, disable the System compression feature in Windows 10
Damaged NTFS filesystems
If an NTFS filesystem has errors on it, NTFS-3G will mount it as read-only. To fix an NTFS filesystem, load Windows and run its disk checking program, chkdsk.
Note that ntfsfix can only repair some errors. If it fails, chkdsk will probably succeed.
To fix the NTFS file system, the device must already be unmounted. For example, to fix an NTFS partition residing in /dev/sda2 :
If all went well, the volume will now be writable.
Metadata kept in Windows cache, refused to mount
When dual booting with Windows 8 or 10, trying to mount a partition that is visible to Windows may yield the following error:
The problem is due to a feature introduced in Windows 8 called «fast startup». When fast startup is enabled, part of the metadata of all mounted partitions are restored to the state they were at the previous closing down. As a consequence, changes made on Linux may be lost. This can happen to any NTFS partition when selecting «Shut down» or «Hibernate» under Windows 8 or 10. Leaving Windows by selecting «Restart», however, is apparently safe.
To enable writing to the partitions on other operating systems, be sure fast startup is disabled. This can be achieved by issuing as an administrator the command:
You can check the current settings on Control Panel > Hardware and Sound > Power Options > System Setting > Choose what the power buttons do. The box Turn on fast startup should either be disabled or missing.
Deleting Windows hibernate metadata
As an alternative to above clean shutdown method, there is a way to completely destroy NTFS metadata that was saved after hibernating. This method is only feasible if you are not able or unwilling to boot into Windows and shut it down completely. This is by placing remove_hiberfile option when you are mounting your NTFS file system using ntfs-3g.
Mount failure
If you cannot mount your NTFS partition even when following this guide, try using the UUID instead of device name in /etc/fstab for all NTFS partitions. See fstab#File system UUIDs for an example.
Windows mount failure
Windows will not recognize a NTFS partition that does not have a corresponding partition type. A common pitfall when creating an NTFS partition to work with Windows is forgetting to set the partition type as NTFS. See fdisk or one of the partitioning tools.
Beta features and releases
There is a web page on «advanced features», maintained by Jean-Pierre André, one of the NTFS-3G authors. It provides:
- Documentation on handling of NTFS features in NTFS-3G, including:
- Symlinks, junctions, and other reparse points
- Extended attributes (xattrs) as an interface for ADS streams and special NTFS attributes
- Security and permission, including POSIX mapping and ACL mapping
- Plugins for parsing special reparse points.
Information provided in the documentation apply to the Tuxera version (2017.3.23) too. The system-compression and dedupe plugins work with the Tuxera version, but the onedrive plugin requires a tweak of the plugin-loading system only available in advanced releases.
Источник