date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,656,237,848,000 |
We have a PHP based application running on a cPanel server which saves tons of API log files (millions), and we are looking to have the PHP scripts be able to write the API log text files into another partition (Amazon EFS mounted to server), so that we can more easily move those text files around. The df-h output is below:
tmpfs 7.3G 0 7.3G 0% /dev/shm
tmpfs 7.3G 115M 7.2G 2% /run
tmpfs 7.3G 0 7.3G 0% /sys/fs/cgroup
/dev/xvda1 1.5T 623G 828G 43% /
/dev/loop0 3.9G 8.3M 3.7G 1% /tmp
127.0.0.1:/ 8.0E 609G 8.0E 1% /smartefs01
tmpfs 1.5G 0 1.5G 0% /run/user/0
tmpfs 1.5G 0 1.5G 0% /run/user/1005
The drive that we want to save the files to is located in /smartefs01, the actual PHP application resides in /home/user/public_html . We are struggling to find the easiest way to have the PHP application store files in /smartefs01 instead of /home/user_public_html. Since we want to be able to detach the drive and move it around with all the files on it in cases of changing servers etc.
Let me know your thoughts!
Kind regards,
EC
|
You can't symlink a file that does not yet exist, so that's not an option, if your application generates millions of files.
You could symlink or bind-mount a directory, if that application logs into a specific directory. Anyone will tell you that non-dangerous PHP server software should never write logs somewhere in public_http, anyways, for it not only risks inadvertedly exposing information to the public, but also basically nullifies any attempt of file-system-based suppression (SELinux) of an attacker managing to make log files contain things like <?php… tags and then making PHP load the log file as something to parse.
So, all in all, your application should be the one to be configured or modified to write its logs somewhere else. That's all: the most logical, the securest and the easiest way to solve this.
| Saving files to another partition with PHP or Symbolic Link? |
1,656,237,848,000 |
I once tried to install arch linux in my USB stick a while ago, and accidentally wiped my windows [by converting it into lvm2 like that...] [BTW, i was happy though cause, there was nothing precious in that damn windows]
Now my question is can I have virtualbox hard disk be in those other partitions, like this is my hard disk partition
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 465.8G 0 disk
├─sda1 8:1 0 100G 0 part
├─sda2 8:2 0 315.8G 0 part
├─sda3 8:3 0 1K 0 part
├─sda5 8:5 0 46.2G 0 part /
└─sda6 8:6 0 3.8G 0 part [SWAP]
The sda1 is my windows drive and sda2 is also just crap cause there is nothing precious in it, my linux drive is sda5, [i use debian, btw],
Now my question is can I configure virtualbox in a way, that it just stores my all virtualbox hard disk in sda1, or sda2?
Down I provide more information...
sudo fdisk -l
Disk /dev/sda: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: TOSHIBA MQ01ABF0
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x31f26811
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 209727487 209725440 100G 83 Linux
/dev/sda2 209727488 871909375 662181888 315.8G 83 Linux
/dev/sda3 871909416 976769023 104859608 50G f W95 Ext'd (LBA)
/dev/sda5 871909418 968710185 96800768 46.2G 83 Linux
/dev/sda6 968714240 976769023 8054784 3.8G 82 Linux swap / Solaris
Partition 5 does not start on physical sector boundary.
This is my os information:
uname -a
Linux doraemon 5.10.0-10-amd64 #1 SMP Debian 5.10.84-1 (2021-12-08) x86_64 GNU/Linux
Any help would be highly appreciated!
[Sorry if I couldn't explain my problem clearly, but if you need more information, then I am ready to do that also]
|
You can move all vhd files manually and reattach them.
Now my question is can I configure virtualbox in a way, that it just stores my all virtualbox hard disk in sda1, or sda2?
No, unless your join these two partitions using LVM, and then you may mount this new partition to /home/user/VirtualBox VMs. You'll need to move it out of the way first.
If I misunderstood you and you need to use physical partitions as is in your VMs, this is possible but not recommended.
You can find a description in the manual under
Advanced topics / Advanced storage configuration / Using a raw host hard disk from a guest
| Can I have a virtualbox disk in another disk partition? |
1,656,237,848,000 |
I have 2 disks in my PC, an SSD with my linux system on it and a HDD with windows and some other stuff. Now I keep getting the following error, which appeared overnight without changing the system, when I'm trying to mount my HDD, after authentication.
[authentication screen of the HDD when trying to mount it]
An error occurred while accessing 'Basic data partition', the system responded: An unspecified error has occurred: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken
Output of /proc/partitions before trying to mount it:
259 0 976762584 nvme0n1
259 1 524288 nvme0n1p1
259 2 958271734 nvme0n1p2
259 3 17961962 nvme0n1p3
11 0 1048575 sr0
7 1 4 loop1
7 0 66776 loop0
7 2 93316 loop2
7 3 56828 loop3
7 4 93256 loop4
7 5 56820 loop5
7 7 33220 loop7
7 6 168712 loop6
7 8 44308 loop8
8 0 976762584 sda
8 1 102400 sda1
8 2 131072 sda2
8 3 975613223 sda3
8 4 912384 sda4
Output of cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a device; this may
# be used with UUID= as a more robust way to name devices that works even if
# disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
UUID=DB6E-0849 /boot/efi vfat umask=0077 0 2
UUID=7b598707-9f6b-42f3-846e-71fd01752e84 / ext4 defaults,noatime 0 1
UUID=315943cb-caa9-488a-a3e9-308e6218486f swap swap defaults,noatime 0 0
Output of sudo fdisk -l /dev/sda
fdisk: cannot open /dev/sda: Input/output error
Output of sudo fdisk -l:
Disk /dev/nvme0n1: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: WDS100T3X0C-00SJG0
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 29B5454C-DA51-8545-8062-20EC370C77CF
Device Start End Sectors Size Type
/dev/nvme0n1p1 4096 1052671 1048576 512M EFI System
/dev/nvme0n1p2 1052672 1917596140 1916543469 913.9G Linux filesystem
/dev/nvme0n1p3 1917596141 1953520064 35923924 17.1G Linux swap
Disk /dev/loop1: 4 KiB, 4096 bytes, 8 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop0: 65.21 MiB, 68378624 bytes, 133552 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop2: 91.13 MiB, 95555584 bytes, 186632 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop3: 55.5 MiB, 58191872 bytes, 113656 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop4: 91.07 MiB, 95494144 bytes, 186512 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop5: 55.49 MiB, 58183680 bytes, 113640 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop7: 32.44 MiB, 34017280 bytes, 66440 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop6: 164.76 MiB, 172761088 bytes, 337424 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop8: 43.27 MiB, 45371392 bytes, 88616 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/sda: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: ST31000524AS
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 899D4B03-4C45-4868-A3ED-04525A4A516C
Device Start End Sectors Size Type
/dev/sda1 2048 206847 204800 100M EFI System
/dev/sda2 206848 468991 262144 128M Microsoft reserved
/dev/sda3 468992 1951695437 1951226446 930.4G Microsoft basic data
/dev/sda4 1951696896 1953521663 1824768 891M Windows recovery environment
Output sudo smartctl -a /dev/sda
A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.
With -T permissive:
Short INQUIRY response, skip product id
=== START OF READ SMART DATA SECTION ===
SMART Health Status: OK
Current Drive Temperature: 0 C
Drive Trip Temperature: 0 C
Read defect list: asked for grown list but didn't get it
Error Counter logging not supported
Device does not support Self Test logging
Output of sudo dmesg -t --level=alert,crit,err,warn:
Expanded resource Reserved due to conflict with PCI Bus 0000:00
ata2: softreset failed (device not ready)
ata2: softreset failed (device not ready)
ata2: link is slow to respond, please be patient (ready=0)
ata2: softreset failed (device not ready)
ata2: limiting SATA link speed to 3.0 Gbps
ata2: softreset failed (device not ready)
ata2: reset failed, giving up
vboxdrv: loading out-of-tree module taints kernel.
VBoxNetAdp: Successfully started.
VBoxNetFlt: Successfully started.
acpi PNP0C14:02: duplicate WMI GUID 05901221-D566-11D1-B2F0-00A0C9062910 (first instance was on PNP0C14:01)
r8168 Copyright (C) 2021 Realtek NIC software team <[email protected]>
This program comes with ABSOLUTELY NO WARRANTY; for details, please see <http://www.gnu.org/licenses/>.
This is free software, and you are welcome to redistribute it under certain conditions; see <http://www.gnu.org/licenses/>.
[drm] dce110_link_encoder_construct: Failed to get encoder_cap_info from VBIOS with error code 4!
[drm] dce110_link_encoder_construct: Failed to get encoder_cap_info from VBIOS with error code 4!
hid-generic 0003:1532:0531.0008: No inputs registered, leaving
thermal thermal_zone0: failed to read out thermal zone (-61)
amdgpu: SRAT table not found
ACPI: \: failed to evaluate _DSM (0x1001)
ACPI: \: failed to evaluate _DSM (0x1001)
ACPI: \: failed to evaluate _DSM (0x1001)
ACPI: \: failed to evaluate _DSM (0x1001)
ACPI: \: failed to evaluate _DSM (0x1001)
ACPI: \: failed to evaluate _DSM (0x1001)
ACPI: \: failed to evaluate _DSM (0x1001)
ACPI: \: failed to evaluate _DSM (0x1001)
usb 1-5: Warning! Unlikely big volume range (=4096), cval->res is probably wrong.
usb 1-5: [11] FU [Sidetone Playback Volume] ch = 1, val = 0/4096/1
ata2: link is slow to respond, please be patient (ready=0)
kauditd_printk_skb: 51 callbacks suppressed
ata2: softreset failed (device not ready)
ata2: softreset failed (device not ready)
kauditd_printk_skb: 13 callbacks suppressed
ata2: softreset failed (device not ready)
ata2: softreset failed (device not ready)
ata2: link is slow to respond, please be patient (ready=0)
ata2: softreset failed (device not ready)
ata2: limiting SATA link speed to 3.0 Gbps
ata2: softreset failed (device not ready)
ata2: reset failed, giving up
ata2.00: disabled
program smartctl is using a deprecated SCSI ioctl, please convert it to SG_IO
program smartctl is using a deprecated SCSI ioctl, please convert it to SG_IO
program smartctl is using a deprecated SCSI ioctl, please convert it to SG_IO
program smartctl is using a deprecated SCSI ioctl, please convert it to SG_IO
program smartctl is using a deprecated SCSI ioctl, please convert it to SG_IO
program smartctl is using a deprecated SCSI ioctl, please convert it to SG_IO
program smartctl is using a deprecated SCSI ioctl, please convert it to SG_IO
program smartctl is using a deprecated SCSI ioctl, please convert it to SG_IO
program smartctl is using a deprecated SCSI ioctl, please convert it to SG_IO
program smartctl is using a deprecated SCSI ioctl, please convert it to SG_IO
program smartctl is using a deprecated SCSI ioctl, please convert it to SG_IO
ntfs3: Unknown parameter 'windows_names'
blk_update_request: I/O error, dev sda, sector 468992 op 0x0:(READ) flags 0x80700 phys_seg 4 prio class 0
blk_update_request: I/O error, dev sda, sector 468992 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
Buffer I/O error on dev sda3, logical block 0, async page read
blk_update_request: I/O error, dev sda, sector 468994 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
Buffer I/O error on dev sda3, logical block 1, async page read
blk_update_request: I/O error, dev sda, sector 468996 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
Buffer I/O error on dev sda3, logical block 2, async page read
blk_update_request: I/O error, dev sda, sector 468998 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
Buffer I/O error on dev sda3, logical block 3, async page read
blk_update_request: I/O error, dev sda, sector 0 op 0x1:(WRITE) flags 0x800 phys_seg 0 prio class 0
blk_update_request: I/O error, dev sda, sector 1951695232 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 0
blk_update_request: I/O error, dev sda, sector 1951695232 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
Buffer I/O error on dev sda3, logical block 975613120, async page read
blk_update_request: I/O error, dev sda, sector 1951695234 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
Buffer I/O error on dev sda3, logical block 975613121, async page read
blk_update_request: I/O error, dev sda, sector 1951695236 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
Buffer I/O error on dev sda3, logical block 975613122, async page read
Buffer I/O error on dev sda3, logical block 975613123, async page read
|
Your drive is most likely dead:
ata2: softreset failed (device not ready)
ata2: softreset failed (device not ready)
ata2: link is slow to respond, please be patient (ready=0)
ata2: softreset failed (device not ready)
ata2: limiting SATA link speed to 3.0 Gbps
ata2: softreset failed (device not ready)
ata2: reset failed, giving up
blk_update_request: I/O error, dev sda, sector 468992 op 0x0:(READ) flags 0x80700 phys_seg 4 prio class 0
blk_update_request: I/O error, dev sda, sector 468992 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
Buffer I/O error on dev sda3, logical block 0, async page read
and smartctl not being able to run.
| Unable to mount internal hdd - An error occurred while accessing 'Basic data partition' |
1,656,237,848,000 |
I have a LVM (/dev/data/files) with 170G which is currently on a Physical volume (/dev/sdb1)
Here is the structure, shown by lsblk command
lsblk
sdb 8:16 0 220G 0 disk
└─sdb1 8:17 0 170G 0 part
└─files 253:2 0 170G 0 lvm /mnt/data
What i did was:
I added 50G on Physical volume, as you can see above with 220G so now when i execute the command fdisk -l /dev/sdb it shows the new added size to it.
fdisk -l /dev/sdb
Disk /dev/sdb: 236.2 GB, 236223201280 bytes, 461373440 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 1048576 bytes
What i wanna do:
I want to add that 50G size to the LVM /mnt/data
Currently it has only 170G
lvdisplay -vm /dev/data/files
--- Logical volume ---
LV Path /dev/data/files
LV Name data
VG Name vgdata
LV UUID 5abc1M-yBeb-Vzxc-d6mK-yqwe-iyui-glkjL
LV Write Access read/write
LV Creation host, time myvm, 2020-04-09 12:27:06 -0300
LV Status available
LV Size <170.00 GiB
Current LE 43519
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:2
--- Segments ---
Logical extents 0 to 43518:
Type linear
Physical volume /dev/sdb1
Physical extents 0 to 43518
Also, the command fdisk on sdb1:
fdisk -l /dev/sdb1
Disk /dev/sdb1: 182.5 GB, 182535061504 bytes, 356513792 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 1048576 bytes
So... How do i extend the volume size to fit 220G instead of 170G?
Thats my main objective and i do not know how to do that.
Thanks in advance for everyone that helps me!
Edit:
I executed two commands, below the output:
Command 1
lvextend -l +100%FREE /dev/mapper/files
New size (43519 extents) matches existing size (43519 extents)
Command 2
resize2fs /dev/mapper/files
The filesystem is already 44563456 blocks long. Nothing to do!
Command 3 to check if it worked
lvs
files vgfiles -wi-ao---- <170.00g
Size still the same.
|
the command you're looking for is lvextend & then resize2fs
lvextend -L somesize /dev/mapper/LV_NAME
and then make the new space active/available for use
resize2fs /dev/mapper/LV_NAME
if you are sure you want to use 100% of sdb
lvextend -l +100%FREE /dev/mapper/LV_name
You can get LV_name from lvs command or use the UUID (adapt command parameters)
real condition example :
:~# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
LV_example example -wi-a----- <2,93g
lvar2 zaphod-vg -wi-ao---- <14,00g
opt zaphod-vg -wi-ao---- 8,00g
slash zaphod-vg -wi-ao---- 80,00g
srv zaphod-vg -wi-ao---- 4,00g
tmp zaphod-vg -wi-ao---- 4,00g
usr zaphod-vg -wi-ao---- 128,00g
:~# pvcreate /dev/sdh1
Physical volume "/dev/sdh1" successfully created.
:~# vgs
VG #PV #LV #SN Attr VSize VFree
example 1 1 0 wz--n- 3,73g 820,00m
zaphod-vg 1 6 0 wz--n- <238,00g 0
root@zaphod:~# vgextend vg /dev/sdh1
Volume group "vg" not found
Cannot process volume group vg
:~# vgextend example /dev/sdh1 ## the step you didn't do I think
Volume group "example" successfully extended
:~# vgs
VG #PV #LV #SN Attr VSize VFree
example 2 1 0 wz--n- 7,46g 4,53g
zaphod-vg 1 6 0 wz--n- <238,00g 0
now the USB sticks are ok to VG with new 4Go so then using lvextend -l 100%Free will get the new space
Without the VGextend step, its size remains the same as expanding LV with 100% of free VG size didn't have any effect, of course.
| Extend Disk Size of LVM |
1,656,237,848,000 |
I'm trying to figure out my partitioning
which leads to https://man.openbsd.org/disklabel#AUTOMATIC_DISK_ALLOCATION which says:
/var 13% of disk. 80M – 2x size of crash dump
But how do I know the size of crash dump?
I can't find it neither in OpenBSD's installation guide,
nor in https://man.openbsd.org/savecore.8
nor in the internet at large.
The only clue I've found is in
http://man.openbsd.org/man8/crash.8
the system dumps the contents of physical memory onto a mass storage
peripheral device
"physical memory". So do rules of estimating swap partition size apply here as well?
May I ask for some actual numbers/functions/tables? Perhaps similar to this answer on swap size?
I am an ordinary user who is not going to test OpenBSD for crashiness but to just run it the more stable the better but for the possibility of a crash be able to report it.
|
I also asked on the mailing list and got the answer from Otto Moerbeek:
a crash dump is roughly the size of your physcial mem. Actually the
max for /var is 4G plus 2x physical mem. So the table in the man
page is not completely right.
By "the table in the man page" he must have meant the one from which I took the:
/var 13% of disk. 80M – 2x size of crash dump
| OpenBSD core dump and /var size |
1,656,237,848,000 |
echo $HOME will just print /home/user. But in my system, /home is not mounted under / and is neither is its own partition.
# shared linux data partition, `/home` is here
UUID=a89334f7-59b7-4d04-b89b-a5a30c379644 /mnt/linux_data ext4 defaults 1 2
The home directory is mounted using a bind mount,
# bind mount /home to directory to a directory on /linux_data
/mnt/linux_data/01_centos /home none bind 0 0
Clicking on the home directory icon in Caja, the location bar indicates /home/user. But this directory should actually be /mnt/linux_data/01_centos/user which does exist in that location. I can navigate to /mnt/linux_data/01_centos/user by going through /root icon in Caja but I would like some means to print the full path to what the OS believes to be /home.
|
$HOME is set to what is in /etc/passwd for the user. To see for yourself, create a directory called /opt/username for a user, make them the owner, and then use vipw to change their home to /opt/username in /etc/passwd. Log in as the user and use pwd and you'll see that they are in /opt/username and that $HOME expands to /opt/username.
If you use the command grep username /etc/passwd or getent passwd username, then you'll see that the home is set to /home/username and not /mnt/linux_data/01_centos/user. As far as the OS is concerned, the home is indeed /home/username regardless of whether another filesystem is mounted there. Your system is functioning exactly as it should.
To clarify for LDAP, if there are users who authenticate via LDAP, then their home directories will be designated in the LDAP server which is usually Active Directory. You'll still be able to see it with getent passwd and if it's changed there, the $HOME variable will reflect this.
| Print full path to home directory |
1,656,237,848,000 |
I'm distro hopping from scientific Linux, but can't free any disk space.
root@archiso~# lsblk
NAME TYPE
sda disk
|-sda1 part
|-sda2 part
|-sl-swap lvm
|-sl-home lvm
|-sl-root lvm
I've tried to reformat sda (dd, gparted ect) to no avail. I've also tried to use lvm tools to remove the volumes, no luck, The volumes don't seem to exist!
root@archiso~# lvs -v
No volume groups found.
root@archiso~# vgscan -v
No volume groups found.
root@archiso~# lvmdiskscan
...
1 disk
5 partitions
0 lvm physical volume whole disks
0 lvm physical volumes
root@archiso~# lvscan -v
No volume groups found.
root@archiso~# pvscan
No matching physical volumes found
root@archiso~# ls /dev/mapper
control sl-home sl-root sl-swap
what on earth is going on?
|
Solved this with
cd /dev
rm -rf mapper/*
rm -rf dm-0 dm-1 dm-2
Then dd'd /dev/sda2 and /dev/sda for good measure
| Can't repartiton disk after scientific Linux (stubborn LVM) |
1,628,072,750,000 |
I have added a second disk to my LVM system. I created a physical volume there, added it to the volume group of ubuntu, 'vgubuntu', extended logical volume to fill the whole disk. How do I extend the LUKS system partition to fill the whole logical volume? Here's more info provided by pvdisplay, vgdisplay and lvdisplay:
--- Physical volume ---
PV Name /dev/mapper/nvme0n1p3_crypt
VG Name vgubuntu
PV Size <464.53 GiB / not usable 0
Allocatable NO
PE Size 4.00 MiB
Total PE 118919
Free PE 0
Allocated PE 118919
PV UUID DwO3R1-DeRo-c83D-qx5F-xjC5-icXG-x3j28i
--- Physical volume ---
PV Name /dev/nvme1n1p1
VG Name vgubuntu
PV Size <476.94 GiB / not usable 0
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 122096
Free PE 0
Allocated PE 122096
PV UUID 9UyJR4-m0G9-sYPG-BBkW-2WEg-TBdR-DAj0u3
root@omen15:~# vgdisplay
--- Volume group ---
VG Name vgubuntu
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 8
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 2
Act PV 2
VG Size 941.46 GiB
PE Size 4.00 MiB
Total PE 241015
Alloc PE / Size 241015 / 941.46 GiB
Free PE / Size 0 / 0
VG UUID ANNTFf-p9hU-O4R3-jwDQ-bZhP-v8tm-hVL8Fn
root@omen15:~# lvdisplay
--- Logical volume ---
LV Path /dev/vgubuntu/root
LV Name root
VG Name vgubuntu
LV UUID rxnIOU-yNg2-ythJ-Dz5V-N3Sr-X7DQ-WzbUUF
LV Write Access read/write
LV Creation host, time ubuntu, 2021-07-24 17:25:39 +0300
LV Status available
# open 1
LV Size <940.51 GiB
Current LE 240770
Segments 2
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1
--- Logical volume ---
LV Path /dev/vgubuntu/swap_1
LV Name swap_1
VG Name vgubuntu
LV UUID MOvhEP-64w3-wHHO-wmDh-YkSU-XARL-7hRQIf
LV Write Access read/write
LV Creation host, time ubuntu, 2021-07-24 17:25:39 +0300
LV Status available
# open 2
LV Size 980.00 MiB
Current LE 245
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:2
And here's what df -h prints:
root@omen15:~# df -h
Filesystem Size Used Avail Use% Mounted on
tmpfs 1.6G 2.1M 1.6G 1% /run
/dev/mapper/vgubuntu-root 925G 7.3G 871G 1% /
tmpfs 7.6G 12M 7.6G 1% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 4.0M 0 4.0M 0% /sys/fs/cgroup
/dev/nvme0n1p2 705M 251M 403M 39% /boot
/dev/nvme0n1p1 511M 5.3M 506M 2% /boot/efi
tmpfs 1.6G 2.0M 1.6G 1% /run/user/1000
|
You have LUKS configured on the PV level so "under" your LVM setup so unfortunately you need to start over -- your PV must be encrypted you can't "extend" the existing LUKS/dm-crypt device to the second disk. The structure should look like disk -> partition -> LUKS -> PV -> VG -> LV (it is possible to configure encryption on the LV level but your existing configuration is encrypted on the PV level).
So you need to shrink your root LV back, remove your newly created PV from vgubuntu and then create LUKS on nvme1n1p1 (cryptsetup luksFormat /dev/nvme1n1p1), unlock it (cryptsetup luksOpen /dev/nvme1n1p1 nvme1n1p1_crypt) and use /dev/mapper/nvme1n1p1_crypt as the second PV. You'll also need to add the new LUKS device to /etc/crypttab.
| How do I extend LUKS partition to fill the whole logical volume of 2 disks on LVM? |
1,628,072,750,000 |
gparted reports 74GB used and 9.02TiB available (seems reasonable).
df reports 40MB used, but only shows 8.6TiB available (suddenly 425 GiB missing)
Disk Info in the file manager reports similar to df, showing 0 bytes used but only 8.6TiB available
Am I actually losing over 5% of my disk to overhead?
|
I found the solution to this over on serverfault - the reserved blocks for root-owned processes by default take 5% of your drive. I lowered this to 0% using tune2fs -m 0 /dev/sdb1 and now I am showing all my free space, as espected.
| Created a new volume on a 10TB (9.1TiB) hard drive, getting conflicting information regarding free space! |
1,628,072,750,000 |
# parted /dev/sda print
Model: ATA WDC WD7500BPVT-2 (scsi)
Disk /dev/sda: 750GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1049kB 211MB 210MB primary ext4 boot
2 211MB 21.7GB 21.5GB primary ext4
3 21.7GB 34.6GB 12.9GB primary ext4
4 34.6GB 750GB 716GB primary ext4
# mount /dev/sda2 /mnt
# mount /dev/sda1 /mnt/boot
# mount /dev/sda3 /mnt/var
# mount /dev/sda4 /mnt/home
# df /dev/sda?
Filesystem ... Use% ...
/dev/sda1 36%
/dev/sda2 91%
/dev/sda3 94%
/dev/sda4 11%
BIOS-MBR. Laptop. NEC's LL750/E. It used to have Windows 7 before; erased when I installed new OS. Arch GNU/Linux user. Would like to do with Arch GNU/Linux live usb, because I've already prepared. Any more information to provide?
Reason why to do so
At first I decided to do this partition, seeing random articles.
Was a failure when I wanted to install more and more.
Then I got adviced that single partition would be enough for many people.
But should I separate /boot and / yet?
Is this procedure correct?
Erase partition number 3 and 4.
Grow partition 2.
So does filesystem for partition 2.
Remake fstab.
Others to ask, I think
Is what I do think appropriate for my object?
P.S.
Just got suggested to do these: 1. make a new user. 2. Move everything to /home.
Also adviced that GParted is safer.
But I found this; doing e2fsck -f /dev/sda4; resize2fs /dev/sda4 566G to make 100G of free space to make it new partition and copy content of / and /var into there, because I was adviced to do so. ... But could have I done -M, as man page says so.
OBTW the procedure is: 1. make /home as small as possible, 2. make 100G of new partition at last, 3. format it, 4. take a backup of /var and /home, 5. remove /var and /home, 6. expand /, 7. copy backups of /var and /home into /, 8. remove last partition, and 9. expand /.
Now doing resize2fs -M /dev/sda4. Oh, should have I pasted size of each partition, in sector-unit.
Done: The filesyste on /dev/sda4 is now 18722376 (4k) blocks long. But WTF that resizing its partition into exact size, I can't mount it yet?
And now (undocumented: unchanged):
# parted /dev/sda unit s print free
...
No. Start End Size ... File system
63s 2047s 1985s Free space
1 2048s 411647s 409600s ext4
2 411648s 42354687s 41943040s ext4
3 42354688s 67520511s 25165824s ext4
4 67520512s 86242887s 18722376s ext4
86242888s 1465149167s 1378906280s Free space
|
All of these instructions below are prefaced with:
Take your time and be careful & methodical. You don't want to accidentally wipe your current filesystems.
There's two ways of doing this, depending on whether or not you have, or can afford to buy a 2.5" drive and an external USB dock for it (don't get a self-contained portable drive), and if you're comfortable opening up your laptop and swapping the drive (or have a friend who can do the hardware stuff for you).
A 1TB SATA 2.5" SSD can be bought for as little as $125 AUD these days. In USD, that's less than $90. If your laptop supports NVME SSDs, they're about the same price and definitely worth getting (over 3 Gbps for NVME vs ~550 Mbps for SATA). Also, you won't need an external drive dock to do the transfer if you use an NVME drive.
A second drive is, IMO, mandatory because if you're not moving everything to a new drive, you're going to need to do a full backup anyway before you do anything else. Resizing and moving partitions comes with a considerable risk of losing everything on the drive due to human error, power/battery failure, cosmic rays, marauding drop-bears, or whatever. Don't even think about doing this without a backup.
If you're moving everything to a new drive, the old drive can be your backup.
I've done stuff like this literally dozens, if not hundreds, of times. The following is my general procedure. Each system can have its own oddities and quirks, so be ready to adapt slightly as required.
These are not steps to blindly follow without understanding them.
Read ALL of it repeatedly until you understand the purpose behind each step. Then write down your own version of the plan, as adapted for your system. Double and then Triple check your plan to make sure you haven't forgotten anything or made a mistake.
With a new drive:
power down and plug in the external drive. or install it if it's an NVME drive.
boot your live CD and get a root shell. or use gparted for GUI partitioning and formatting.
The new drive will probably be /dev/sdb or /dev/nvme0n1. or maybe something entirely different. run lsblk | grep disk to find out.
partition and format it as you like. Easiest would be to have a small partition (<= 4GB for swap) and one big partition (for / and everything under it).
If you plan to hibernate/suspend the machine, allocate twice your RAM size to the swap partition.
If you ever intend to put this drive in a machine with UEFI bios, it would be worthwhile having a small (512MB or so) EFI partition to mount as /boot/EFI.
The following will all need to be done from a root shell.
mount the old /, /boot, /var, and /home under /mnt as in your question.
mount the new / as /target
run rsync -av --progress --human --human /mnt /target/
run for i in proc dev sys ; do mount -o bind /$i /target/$i ; done (this is required so that grub has what it needs inside the chroot)
chroot /target
edit /etc/fstab so that / is mounted from your NEW / partition, and all
other filesystems are deleted or commented out. Also add or update the entry for your swap partition.
grub-install /dev/sdX (where sdX is the device node of your NEW drive)
update-grub
exit to get out of the chroot.
run sync because paranoia isn't a bad thing
You should be able to shutdown and swap the new drive into the system.
The new drive should be a lot faster, being an SSD. And having some swap space on SSD will also help if you sometimes run low on RAM.
Without an extra drive:
This method is going to use all that free space on /home (/dev/sda4).
boot your live CD and get a root shell.
mount the old /, /boot, /var, and /home under /mnt as in your question.
mkdir /mnt/home/home
mv /mnt/home/* /mnt/home/home/
run ls -ld /mnt/home/home and check that the perms are drwxr-xr-x. If they're not, run chmod 755 /mnt/home/home.
run mv /mnt/[^h]* /mnt/home
that will move every file and subdirectory in /mnt that doesn't begin with h (i.e. /mnt/home) to /mnt/home. If you have other dirs in /mnt that begin with h(unlikely) you'll have tomv` them too.
OK, everything that was on /, /var, and /boot should now be one the new / partition (/dev/sda4, used to be just /home), and /home will now be a subdirectory of / rather than a separate partition.
unmount everything under /mnt. run sync to flush all buffers to disk.
run gparted and delete sda1, sda2, and sda3.
Make a small swap partition as /dev/sda1. or a bigger one if you intend to suspend the laptop.
move /dev/sda4 to immediately after the swap partition. This may (or may not renumber it to /dev/sda2 (i can't remember, exactly. renaming may be optional)
resize /dev/sda4 to take up the remainder of the disk
gparted will probably do the move and resize as a single operation, once you've confirmed that it's what you want it to do.
mount /dev/sda4 /mnt (or /dev/sda2 if it got renumbered)
for i in proc dev sys ; do mount -o bind /$i /mnt/$i ; done
chroot /mnt
edit /etc/fstab so that / is mounted from what used to be your /home partition
grub-install /dev/sda
update-grub
exit to get out of the chroot
sync
and you should be good to reboot into the resized system.
| Is it possible to integrate existing partitions with filesystem? |
1,628,072,750,000 |
I use a primarily windows system dual booted with my ubuntu 18.04
Since about 1 year, I was not able to boot up into ubuntu (initramfs prompt opens, and no solution I could find worked).
This original issue occurred after a BIOS update from windows.
So unable to solve the issue from grub directly, I decided to use boot-repair from a live USB. That is exactly what is did, and noticed the following irreguralities-
Boot-repair doesn't show any "recommended repair" option.
So boot-repair should look like this -
But it looks like this for me -
I am not able to detect any hdd partition whatsoever from the live USB boot. Things I tried-
Gparted
sudo fdisk -l (and loads of other similar commands)
All of them show the pendrive itself as the only partition /dev/sda1
Now, detecting the partitions was important because I was doing what boot-repair does without boot-repair. But that requires mounting on the ubuntu partition etc, which is basically non existent according to the commands/programs
Also, this does not imply that my ssd has vanished somehow xD because I later booted into windows which was completely fine with all the files intact, and so was the ubuntu partition, alive and healthy.
|
So i solved it myself, I had to change my ssd mode to AHCI in the BIOS Menu.
Boot repair worked fine, no boot issues anymore.
| Partitions not detected by ubuntu 18.04 live usb |
1,628,072,750,000 |
(I am using a Raspberry Pi 3b+)
I have the config of the service "dnsmasq" on my /etc-partition. /etc is read-only-mounted, so I need to mount it everytime so the service actually runs (by typing sudo service dnsmasq start).
My /data-partition would be writable - can I somehow move the whole service to /data? Is it enough to move the config-file to /data?
|
If anyone's interested: I changed the partition to writable - made everything a lot easier.
| Move service to another partition [closed] |
1,628,072,750,000 |
As you can see my hard drive size is 298.09 GiB.
Look I have free space166.61 GiB. If I use Automatic method to install linux fedora will it automatically take the space of free space. There was Linux Mint also. Linux Mint is still right there. So, what I have to do to install Linux Fedora alongside Windows inside free space? Will it ok If I click on automatic. I thought custom should be better. When I clicked on custom I didn't understand anything. Cause, there was no function(no method). I didn't understand anything then.
|
Yes, autopart will use the 166 GiB of free space to install Fedora. I don't see a Linux Mint installation on your drive, only Windows and one possibly unused 975 MiB partition but that is too small for Mint.
Manual partitioning in the Anaconda installer works in a different way than most partitioning tools -- you start with mount point (e.g. /home) and continue with specifying other "properties" of it, including size, filesystem type, encryption etc. The Advanced Custom option provides "GParted-style" partitioning tool, but requires better knowledge of storage technologies.
The automatic partitioning option should work fine here, but if you really want to do manual partitioning, I recommend reading the Manual Partitioning section of Fedora Installation Guide first. Documentation is also available in the installer environment for both manual partitioning methods.
| help with installation of linux fedora |
1,628,072,750,000 |
I was trying to make a swap partition, but an error message came saying
Primary Partition Not Available
I checked the internet and found out there can't be more than 4 partitions because Linux only has room for 4 by default (for some reason). But I can see there's a sda5 in my partition table.
/dev/sda1 229474304 230518783 1044480 510M 27 Hidden NTFS WinRE
Free space 230518784 230520831 2048 1M
/dev/sda2 230520832 934482553 703961722 335.7G 7 HPFS/NTFS/exFAT
/dev/sda3 934483966 976771071 42287106 20.2G 5 Extended
└─/dev/sda5 934483968 976771071 42287104 20.2G 83 Linux
/dev/sda4 2048 20973567 20971520 10G 83 Linux
How is there more than 4 primary partitions? Is sda5 even a primary partition? Why is sda5 looking like a branch of sda3? Please point me towards the right direction.
(I just wanted to make a swap partition, since LFS is recommending, DO I even need a swap partition when I have 8GB RAM?)
|
/dev/sda5 is an extended partition (aka logical partition), hence it looks like a branch. Yes, that is true, Linux supports only four physical partitions. Your system already have four physical partitions. You can use cfdisk command to create a new logical partition (/dev/sda6) and use that for swap
| cfdisk showing more than 4 partitions |
1,628,072,750,000 |
I'm new to Linux environment and trying to get some clarification on the Disk partitioning.
I've installed new RHEL 8 vmware workstation initially with 20GB Disk and later expanded with additional 20GB. My goal is to create Volume groups & logical volume for later use. I did created a extended partition via fdisk as below,
[root@localhost ~]# fdisk -l
Disk /dev/nvme0n1: 40 GiB, 42949672960 bytes, 83886080 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0e287c88
Device Boot Start End Sectors Size Id Type
/dev/nvme0n1p1 * 2048 616447 614400 300M 83 Linux
/dev/nvme0n1p2 616448 4810751 4194304 2G 82 Linux swap / Solaris
/dev/nvme0n1p3 4810752 41943039 37132288 17.7G 83 Linux
/dev/nvme0n1p4 41943040 62914559 20971520 10G 5 Extended
However, when I do a lsblk it shows the Size as 1K!? Tried rebooting the VM but no luck. Looks like Im doing something wrong or my understood the setup wrongly.
[root@localhost ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 1024M 0 rom
nvme0n1 259:0 0 40G 0 disk
├─nvme0n1p1 259:1 0 300M 0 part /boot
├─nvme0n1p2 259:2 0 2G 0 part [SWAP]
├─nvme0n1p3 259:3 0 17.7G 0 part /
└─nvme0n1p4 259:4 0 1K 0 part
Can someone point to how to get the 10GB under nvme0n1p4? Also, why the disk is getting auto partitioned when I add any new disk in VM?
|
Extended partition can't be used directly it's just a "container" for logical partitions. It's actually a clever hack to overcome the 4 partition limit in MBR. Your nvme0n1p4 is a 10 GiB extended partition, but lsblk shows it as 1 KiB because that is its "real size" -- it doesn't take any space on the disk except the 1 KiB metadata and has "10 GiB of free space" for logical partitions. If you goal is to add a new LVM setup, simply add a new logical partition using fdisk /dev/nvme0n1 (you can also use parted), and use vgcreate /dev/nvme0n1p5 <vg_name> (the new logical partition will be nvme0n1p5) to create a new volume group on it.
| Question about Disk Partitioning |
1,628,072,750,000 |
I have successfully installed BLFS 8.4 and now I want to transfer it to another machine. Would it work if I tar up the whole BLFS system and then untar it on an empty partition on another machine? If this is true then what all things should I tar up. I want the whole BLFS along will all the packages in /sources directory.
I think I would also need 'Super Grub 2' as it scans through all the partitions and search for all the operating systems.
Please note that I don't have the host operating system. I started making LFS on Ubuntu using terminal but to give more space to the LFS, I deleted it using a disk partition tool. It means that now I have only one OS in my laptop i.e. BLFS 8.4 . I didn't use Virtual Box or any other similar software due to hardware limitations.
|
cd /
tar -cvpxf backup.tar.xz --exclude=/mnt --exclude=/dev --exclude=/proc --exclude=/backup.tar.xz /
This command will create a backup of the entire system in the root directory by the name backup.tar.xz. Be sure to exclude more directories that you would probably not need like /tmp.
| Tar up the whole BLFS system |
1,607,369,264,000 |
I have a Windows and Linux Dualboot and I made a partition of 200GB to store big files if needed. The problem is that from my Debian OS, I can't add folders or put new files in there. The partition is in /media/username/Partition. Anytime I want to open the partition in the folder program I have to put in my root password and even then I cannot add files to it. I have remounted it but doing that every time to get read/writing permission is a hassle. Also if I want to make a new folder, I get the error that the directory doesn't exist, although it does. On the Windows OS I can access it and use it no problem. Any help on how I can make it easy to use and access on Linux?
|
I did the following to make it work with an NTFS partition:
run the following to get the UUID of the partition:
sudo blkid
open the fstab file with:
sudo nano /etc/fstab
scroll down and make an entry like so:
UUID=D0C08198CC0839207 /media/user/HD ntfs-3g permissions 0 1
change the UUID and the mounting point to your use case. At the end it should have this structure:
UUID=[The UUID of the partition] [Mount point] ntfs-3g permissions 0 1
Save and reboot your computer. The partition should automatically be mounted with the permissions set in fstab.
| Dual boot: Getting access to a partition made on both Linux and Window systems |
1,607,369,264,000 |
Good Morning,
I'm trying to Normalize my "D:" Partitation's state after replacing Windows 10 with Ubuntu 20.10... it shows as Microsoft basic data and I can't touch any Folder or File in that Partition (/dev/sda5: Permission denied)
For example:
When i try sudo rmdir "DumpStack.log.tmp"
rmdir: failed to remove 'DumpStack.log.tmp': Read-only file system
I tried the following Method (Which didn't work):
https://askubuntu.com/a/1148959/1067284
https://askubuntu.com/a/809251/1067284
The result of sudo ntfsfix /dev/sda5 Command:
Mounting volume... The disk contains an unclean file system (0, 0).
Metadata kept in Windows cache, refused to mount.
FAILED
Attempting to correct errors...
Processing $MFT and $MFTMirr...
Reading $MFT... OK
Reading $MFTMirr... OK
Comparing $MFTMirr to $MFT... OK
Processing of $MFT and $MFTMirr completed successfully.
Setting required flags on partition... OK
Going to empty the journal ($LogFile)... OK
Checking the alternate boot sector... OK
NTFS volume version is 3.1.
NTFS partition /dev/sda5 was processed successfully.
The result of sudo fdisk -l Command:
Disk /dev/loop0: 97.74 MiB, 102486016 bytes, 200168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop1: 55.36 MiB, 58052608 bytes, 113384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop2: 62.09 MiB, 65105920 bytes, 127160 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop3: 50.67 MiB, 53133312 bytes, 103776 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop4: 55.32 MiB, 58007552 bytes, 113296 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop5: 60.98 MiB, 63942656 bytes, 124888 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop6: 217.89 MiB, 228478976 bytes, 446248 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop7: 30.94 MiB, 32440320 bytes, 63360 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/sda: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: ST500LT012-9WS14
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: FB9C0653-A6A2-4171-92BC-68CD5820A715
Device Start End Sectors Size Type
/dev/sda1 2048 206847 204800 100M EFI System
/dev/sda2 206848 239615 32768 16M Microsoft reserved
/dev/sda3 239616 408274943 408035328 194.6G Linux filesystem
/dev/sda4 408274944 409597951 1323008 646M Windows recovery environment
/dev/sda5 409600000 976773119 567173120 270.4G Microsoft basic data
Disk /dev/loop8: 178.98 MiB, 187674624 bytes, 366552 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop9: 169.3 MiB, 177528832 bytes, 346736 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop10: 290.44 MiB, 304545792 bytes, 594816 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop11: 125.85 MiB, 131960832 bytes, 257736 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop12: 25.53 MiB, 26771456 bytes, 52288 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Please note that I didn't remove those Partitions(Windows recovery environment and Microsoft reserved) while Ubuntu Install-Process because I was thought that Ubuntu is going to replace it...
The result of fdisk /dev/sda5 Command:
Welcome to fdisk (util-linux 2.36).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
fdisk: cannot open /dev/sda5: Permission denied
The result of sudo fdisk /dev/sda5 Command:
Welcome to fdisk (util-linux 2.36).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
The device contains 'ntfs' signature and it will be removed by a write command. See fdisk(8) man page and --wipe option for more details.
Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0xdbf257c4.
Command (m for help): m
Help:
DOS (MBR)
a toggle a bootable flag
b edit nested BSD disklabel
c toggle the dos compatibility flag
Generic
d delete a partition
F list free unpartitioned space
l list known partition types
n add a new partition
p print the partition table
t change a partition type
v verify the partition table
i print information about a partition
Misc
m print this menu
u change display/entry units
x extra functionality (experts only)
Script
I load disk layout from sfdisk script file
O dump disk layout to sfdisk script file
Save & Exit
w write table to disk and exit
q quit without saving changes
Create a new label
g create a new empty GPT partition table
G create a new empty SGI (IRIX) partition table
o create a new empty DOS partition table
s create a new empty Sun partition table
Command (m for help): t
No partition is defined yet!
The result of mount | grep sda Command:
/dev/sda3 on / type ext4 (rw,relatime,errors=remount-ro)
/dev/sda1 on /boot/efi type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/sda5 on /media/johnm/301265D312659E9A type fuseblk (ro,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
Please guys the only thing I want is to change it back to a normal partition with Read/Write permissions. Really I needed the data on this partition!
|
Thanks, everyone
A friend of mine just dropped me this awesome method which worked like charm :D
umount /dev/sda5
mkdir /sda5
mount /dev/sda5 /sda5
ls /sda5
and add the following line to /etc/fstab (To mount the partition after every system reboot in the /sda5 folder)
UUID={YOUR_UUID} /sda5 ntfs-3g defaults 0 0
please note that {YOUR_UUID} must be replaced with your Partition's UUID which you have got from sudo blkid command.
and then the Partition must be located at /sda5 with Read/Write permissions
| Trying to Normalize my "D:" Partitation's state after replacing Windows 10 with Ubuntu 20.10 |
1,607,369,264,000 |
I installed Elementary OS alongside Windows 10 on the one logical partition / and elf partition. But when I reboot pc, I see grub rescue shell. I tried to type this commands:
set root=(hd0,msdos7)
set prefix=(hd0,msdos7)/boot/grub
insmod normal
on the last command i see error: file /boot/grub/i386-pc/normal.mod not found. I found normal.mod in folder /boot/grub/x86_64-efi/ and type:
insmod $prefix/x86_64-efi/normal.mod
and get error invalid arch-dependent elf magic After this I tried to re-install grub from live cd (while installation I saw that install x86_64 type instead of i386)
Arch is not important for me. I just want to return ability to use my pc. Please help.
fdsik -l :
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x935f4825
Device Boot Start End Sectors Size Id Type
/dev/sda1 2048 1126399 1124352 549M 7 HPFS/NTFS/exFAT
/dev/sda2 1126400 251660287 250533888 119.5G 7 HPFS/NTFS/exFAT
/dev/sda4 251662334 976771071 725108738 345.8G f W95 Ext'd (LBA)
/dev/sda5 446973952 976771071 529797120 252.6G 7 HPFS/NTFS/exFAT
/dev/sda6 * 251662336 253614079 1951744 953M ef EFI (FAT-12/16/32)
/dev/sda7 253616128 446959615 193343488 92.2G 83 Linux
Partition 4 does not start on physical sector boundary.
Partition table entries are not in disk order.
|
Nothing difficult. No need to complicate anything!
sudo mount /dev/sda7 /mnt
sudo grub-install --root-directory=/mnt /dev/sda
And then:
sudo update-grub --output /mnt/boot/grub/grub.cfg
But after this I have on Windows excess Disk E with EFI folder. Well, to hell with him
| Grub errors after installation Elementary OS alongside windows |
1,607,369,264,000 |
I want to take 20G from my /home and put it in my /. I logged into live installation drive and launched gparted.
The partitions look like this:
sda4 is root, sda5 is boot and sda6 my home partition.
If I click on sda6 and resize it from left to right I will get a warning that moving partition might cause your operating system to fail to boot and after that partitions look like this:
Now there is sda5(my boot partition) in the way and the only way is to move it to the right of my unallocated space like this:
Now I can merge unallocated space with root:
If I click apply will lgparted be able to generate new fstab or do I have to do it manually?
|
There's no need for gparted to generate a new /etc/fstab (it never does this anyway). You are not creating any new partitions or changing UUIDs, so you should be good to go.
That being said, that warning is posted for a reason: PLEASE have a system backup in case gparted crashes.
| increasing the size of root partition and reducing the size of home |
1,607,369,264,000 |
I made an empty binary image file with fallocate -l 500M sd.img command and then partitioned it using gdisk and now I can see my partitions using gdisk:
Command (? for help): i
Partition number (1-2): 1
Partition GUID code: EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 (Microsoft basic data)
Partition unique GUID: 8B28D50C-C5B5-470D-908D-FF212433AC50
First sector: 2048 (at 1024.0 KiB)
Last sector: 43007 (at 21.0 MiB)
Partition size: 40960 sectors (20.0 MiB)
Attribute flags: 0000000000000000
Partition name: 'Microsoft basic data'
Command (? for help): i
Partition number (1-2): 2
Partition GUID code: 69DAD710-2CE4-4E3C-B16C-21A1D49ABED3 (Linux ARM32 root (/))
Partition unique GUID: 8A6F3384-7AC2-448C-BD76-73A772E9E586
First sector: 43008 (at 21.0 MiB)
Last sector: 247807 (at 121.0 MiB)
Partition size: 204800 sectors (100.0 MiB)
Attribute flags: 0000000000000000
Partition name: 'Linux ARM32 root (/)'
as you can see, I want to format the first partition to FAT32 and the second one to EXT4 for linux root file system.
How can I do this? I know how to format a physical drive with mkfs.fat and mkfs.ext4 but how can I do it for a disk image with 2 separate partitions?
OS: Ubuntu 20 LTS
|
To format the partitions contained in the disk image, you can first create block device files for the partitions. With the device files in place you can use mkfs as you normally would. When you're finished, then you can remove the device files.
Create and list the block device files: kpartx -av sd.img
Format each partition. Ex. mkfs.fat /dev/mapper/loop0p1
Remove the block device files: kpartx -d sd.img
| how to format a partition of a diskimage? |
1,607,369,264,000 |
I am going for installing Gentoo for the second time. I read that multiple swap partitions can be created and their entries in /etc/fstab can be prioritised with pri mount option. Just wanted to ask whether that can be done with /home too. Like
/dev/sda1 /home ext4 defaults,pri=1 0 2 and /dev/sda2 /home ext4 defaults,pri=2 0 2. Thanks!
|
No not that way.
But there are other ways. Here are a few methods, they all do slightly different things.
Union file systems: create a layered file-system. A read-only as the base, then another overlay that is writable, and stored only the changes.
LVM, ZFS (and some other file systems): allow file-systems to span multiple partitions / disks.
Raid: allow file-systems to span multiple partitions / disks. (but for other reasons)
Symbolic linking: Allow you to make a file/sub-directory be in a different place.
Mount points in /home: Allow you to make a file/sub-directory be in a different place.
| Span /home on multiple partitions |
1,607,369,264,000 |
I have a VM with Debian installed on it. I want to extend the primary partition without losing data.
Here is output of sudo fdisk -l:
Disk /dev/sda: 34.2 GiB, 36700160000 bytes, 71680000 sectors
Disk model: VBOX HARDDISK
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0eacd5f2
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 46139391 46137344 22G 83 Linux
/dev/sda2 46141438 52426751 6285314 3G 5 Extended
/dev/sda5 46141440 52426751 6285312 3G 82 Linux swap / Solaris
|
You can boot your VM system off a LiveCD ISO that includes gparted (or install gparted on a live distro after it is booted), and then you can manipulate your partitions to your hearts desire via a friendly GUI.
If your drive isn't big enough, you can extend it using your VM system's tools first.
Unrelated helpful comment: you should delete your swap partition - these are counterproductive on VMs
| Debian Extending Primary (root) partition without data loss [closed] |
1,607,369,264,000 |
I'm trying to install Arch Linux on a disk which was previously partitioned. The Disklabel type is automatically set to gpt. I need to change it to dos. How can I do it?
|
I've never actually used cfdisk, but I can tell you how to do it with fdisk.
Run fdisk -l
You should get all of your storage devices.
Find the one you want to partition.
It should be something like /dev/nvme0n1 or /dev/sda but your knowledge may vary.
Once you find it run fdisk <name of drive>. E.x. /fdsik /dev/sda
You should now see something like this
Welcome to fdisk (util-linux 2.35.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help):
Typing m reveals:
o create a new empty DOS partition table
Notes:
Know that changing the labels will delete everything.
Don't forget to run w before exiting to write table to disk.
Check the Arch Wiki for more information.
| Changing label type in Arch Linux cfdisk |
1,607,369,264,000 |
I have a 256 GB SSD and a 1TB HDD in my laptop. I want to dual-boot Kubuntu 20.04 with Windows 10. Please explain what exactly do /var and /tmp do, because I need to do some web developing and want to know whether I should make separate partitions for them. Also, to save space on the SSD, can I mount /home, /var etc. on the HDD, without a significant increase in boot time? I heard that root partition will have to wait for mounting from HDD, which will increase boot time. Besides, should I make separate /opt and /usr, too. My current planning is: 11GB swap in SSD, 45GB root partition in SSD, 1GB /boot in SSD, and 50GB /home in HDD. I have also heard that separate /boot partition is not needed in SSD. So please guide me.
Thank you!!
|
It's better to have a boot partition for Linux on your SSD and 512MB will be enough.
It's OK to have /home on your HDD (that won't slow down boot significantly).
If you don't expect to have many gigabytes worth of MySQL (or any other DB) data there's no need to have a separate partition for /var. Likewise for /opt. It's not clear what you'll be running.
Backup your EFI System partition before installing Linux just in case.
| Help with partitioning scheme for new Kubuntu dual boot |
1,607,369,264,000 |
I want to replace the linux distro(current ubuntu 18.04 lts) with elementry os 5.1
I saw many tutorials but here is where my question differs. I have two drives on my PC. One SSD and another HDD. SSD has windows 10 installed and first 837 GB is used as D drive on windows ans the next 93 GB is used as UBUNTU. Now there is another 512 MB partition sitting between these two.
I know a lot about computers and file systems and whatnot (so i don't mid approaches which involve CMD or bash), but I am not sure of that 512 MB partition. Whether it is important for UBUNTU or for windows, and I REALLY REALLY don't want to mess with windows OS.
Another thing I can do is, format the HDD while keeping the D drive files backed up on an external HDD, and then freshly install elementary OS on it, but that would be too tiresome, and also not a very challenging approach.
Also I would like to have GRUB whether it be the one from UBUNTU or a fresh install
I asked this on ask ubuntu community but they removed it as it wasn't related to ubuntu and more related to unix and linux community and I agree.
|
Well I figured it out.
You start with normal installation, i.e., a live USB boot.
If you are changing the distro then the first option would be to replace Ubuntu(my case) choose that and then just continue.
Whereas if you are going to reinstall a distro then choose something else. There you have to format you disk partition which contained the OS which you want to replace or reinstall.To do this right click that partition and choose delete. Then again right click that partition and then choose it. Select ext4 as the file system and select '/' as the mounting and the continue.
The next steps are pretty easy.
| I want to replace the linux distro(current ubuntu 18.04 lts) with elementry os 5.1 |
1,607,369,264,000 |
My configuration:
/dev/sdb2/ -> Windows 10 Partition
/dev/sdb4/ -> Ubuntu 18.04 Partition
I would like to decrease the Windows 10 partition and give that unallocated space to the Ubuntu 18 partition, but there is an EFI (boot, esp) partition between them. What is the best way to achieve this ?
|
Boot a Linux Live CD from USB and run gparted again. You can't resize your root partition while it is being mounted (the lock symbol).
Steps to do:
Resize the Windows partition "to the left", the freed space should be on the right side.
Move the ESP partition "to the left", so that the free space "is moved" from the left to the right side.
Resize the root partition.
| Is it safe to move this EFI partition? |
1,607,369,264,000 |
I am running the following command to expand my partition following the tips from this article article
Partition 7 (75Gb, starting at sector 1794791424) is my main one and 8 (100Gb, starting at sector 1580881920) is the extra space (there is clearly a gap between the two sectors which could cause the problem?).
I firstly run fdisk: d and delete partitions 7 and 8, then fdisk: n to create a new one.
As you can see from the terminal output below, it allows me to pick an spot in the sector range I just freed, but when I do, it does not allow me to use all the free space:
Partition number (7-128, default 7):
First sector (1580881920-1953525134, default 1580881920):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (1580881920-1790597119, default 1790597119):
The partition table:
/dev/nvme0n1p1 2048 1085439 1083392 529M Windows recovery environment
/dev/nvme0n1p2 1085440 1290239 204800 100M EFI System
/dev/nvme0n1p3 1290240 1323007 32768 16M Microsoft reserved
/dev/nvme0n1p4 1323008 1580881919 1579558912 753.2G Microsoft basic data
/dev/nvme0n1p5 1790597120 1792694270 2097151 1024M EFI System
/dev/nvme0n1p7 1794791424 1953523710 158732287 75.7G Linux filesystem
|
You can't use the space of partition 8 for partition 7, because partition 8 was between
partition 4 and 5:
/dev/nvme0n1p1 2048 1085439 1083392 529M Windows recovery environment
/dev/nvme0n1p2 1085440 1290239 204800 100M EFI System
/dev/nvme0n1p3 1290240 1323007 32768 16M Microsoft reserved
/dev/nvme0n1p4 1323008 1580881919 1579558912 753.2G Microsoft basic data
1580881920 1790597119 ### free space of partition 8 ###
/dev/nvme0n1p5 1790597120 1792694270 2097151 1024M EFI System
/dev/nvme0n1p7 1794791424 1953523710 158732287 75.7G Linux filesystem
You would have to move partition 5 "to the top" first so that this partition starts at 1580881920.
After that you can resize partition 7 to take the remaining space.
Maybe it's easier to boot from a Linux Live CD and use gparted for these two operations.
It's also not clear why you have two EFI System Partitions. One would suffice for Windows and Linux.
| Resizing main partition on existing installation, fdisk detects the free space but does not allow me to expand |
1,585,535,107,000 |
After hours of searching on the internet for answers, I still cannot unlock my root partition in GParted. I want to add 100gb unallocated space to my current /dev/nvme0n1p7 "fedora_localhost-live" 33gb partition. I am running dual boot fedora 31 on my Windows 10 device. Does anyone know what I am missing here?
I have done the following:
Created LiveUSB GParted
Created 100gb of unallocated space
Checked if the root partition is mounted.
umount /dev/nvme0n1p7
umount: /dev/nvme0n1p7: not mounted.
Below is my vgdisplay:
VG Name fedora_localhost-live
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size <33.18 GiB
PE Size 4.00 MiB
Total PE 8493
Alloc PE / Size 8493 / <33.18 GiB
Free PE / Size 0 / 0
I noticed that I have got no PE size left for my partition, but is does say resizable.
I cannot "deactivate" the partition in Gparted while booted from the LiveUSB, thus I cannot extend the partition. The ext4 partition get's unlocked when I boot from LiveUSB.
I can move the unallocated space two rows down, but the lvm2 partition is unable to extend with the 100gb. Everywhere I read that LiveUSB should deactivate the partition, but it seems that he's still running or there is another problem which I don't see.
|
You do not need to move this 100GB space. Just create there partition. Then create this partition PV
pvcreate /dev/partition_name
then add the PV to the VG
vgextend fedora_localhost-live /dev/partition_name
And you have 100GB more in your VG
| How to unlock root partition using LiveUSB Gparted |
1,585,535,107,000 |
I have a partition of size 50GB and made image via some disk tool (through GUI). But it had size of entire partition (50GB).
Then I resized that image to 8.7GB:
e2fsck -f -y xxx.img
resize2fs -M xxx.img
Then I mounted it on partition with size 15GB:
dd if=myIMG.img of=/dev/sda13
But problem is that when I open system monitor it keeps showing me that system max size is 8.3GB instead of 14GB.
And in "lsblk" i can see that partition have 14GB
I don't know how to fix it. Probably I did any stupid mistake but I don't know how to fix it.
|
No mistakes so far, you've just missing the last step!
You've now written an image of a filesystem sized 8.7GB to a partition sized 15G. The last step would be to extend the filesystem size again to take up the entire partition:
resize2fs /dev/sda13
With modern versions of ext2/3/4 filesystems, you can do this even if the filesystem is already mounted.
| Partition have size of img after using "dd" to install |
1,585,535,107,000 |
So this happends when I want to setup dual-boot ParrotOS and Windows. When I want to install Parrot, I accidentally select 'use all disk and setup LVM' (not encripted) and I noticed that and click cancel but the LVM already been setup. Can I revert the LVM setup?
I checked my windows partition on ParrotOS live using TestDisk, the files are intact and I'm copying the files to removable flashdrive as a backup. Is there anything I can do to make my partition bootable inside LVM? or how can I extract the partition to direct partition not inside LVM?
Thanks!
|
The best, easy and fast you can do is to copy recovered files to external media and start installations (first Windows, then Linux) from scratch.
And this time when install linux use free diskspace, not entire disk
| My Windows partition got overlapped with Linux LVM |
1,585,535,107,000 |
Is it possible that my Linux partition creates files in another partition with me not noticing it?
If yes, how to prevent it?
Background:
Manjaro partition encrypted, bootloader on Manjaro, swap unit masked.
The aim is to keep safe data encrypted in Linux and prevent any leak. As far as I know the only weak link in the chain is a evil maid attack.
|
Your Linux installation can only create files on partitions that are mounted.
So unless you mount unencrypted partitions into your system (or remote NFS-shares etc...), no, it won't create files "outside".
Be aware: Windows-partitions on your device can be mounted with a single mouse-click, depending on your exact setup.
| Can a Linux partition unnoticeably create files in another partition and, if, how can I prevent it? |
1,585,535,107,000 |
I just bought an SSD drive and installed Linux Mint in it. My question is: how do I remove the OS in the old drive safely without deleting my home directory from the old drive?
My first thought were:
Remove the partition from Grub (Grub file is in new drive)
Remove all partitions but my /home directory
Are they enough and safely? Any other thoughts?
|
I concur with your assessment,
removing the partition from grub and removing all BUT your /home from that partition should be enough to get rid of your old OS.
You should however, make sure that no symlinks in your home directory point to files that would be deleted. The find-solution here should list all your symlinks in order for you to review them.
Aside from that, I would recommend @nasir-riley's approach of just copying your home to a different place e.g. your new system partition. That way you could prevent the old partition from being mounted and could therefore test your "new" home without the danger of loosing data.
| How do I remove an OS from a partition? |
1,585,535,107,000 |
I've been struggling with this couple of hours now.
Deleted all existing partitions and created a new one on (virtually unmounted) removable USB media using:
$ sudo fdisk /dev/sdb1
Command (m for help): n
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-30296063, default 2048): 2048
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-30296063, default 30296063): 30296063
Created a new partition 1 of type 'Linux' and of size 14,5 GiB.
and then changed partition type using:
Command (m for help): t
Hex code (type L to list all codes): c
Changed type of partition 'Linux' to 'W95 FAT32 (LBA)'.
applied changes:
Command (m for help): w
The partition table has been altered.
Syncing disks.
informing kernel for changes:
$ sudo partprobe
So far so good. After that, i've created FAT32 filesystem on the new partition:
$ sudo mkfs -t vfat /dev/sdb1
mkfs.fat 4.1 (2017-01-24)
mounting the device to virtual directory:
$ sudo mount /dev/sdb1 /media/xxx
Everything seems to be okay but when i want to check partitions on the device again using fdisk utility:
$ sudo fdisk /dev/sdb1
Disk /dev/sdb1: 14,5 GiB, 15511584768 bytes, 30296064 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000
ends up with strange disk identifier and no partition table at all (why?). But when i run this command:
$ sudo fdisk -l
Disk /dev/sdb: 14,5 GiB, 15518924800 bytes, 30310400 sectors
Disk model: TransMemory
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x03eba3c3
Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 30298111 30296064 14,5G b W95 FAT32
yep, partition table is here but partition type is W95 FAT32 instead of W95 FAT32 (LBA). so what am i doing wrong? is this behaviour normal?
|
fdisk operates on the disk as a whole, and not the individual partitions. I.e., use fdisk -l /dev/sdb.
| Cannot see partitions in fdisk utility |
1,585,535,107,000 |
i'd been trying to install lubuntu in my old laptop
Laptop is Webbook NBX8010D with specs
Processors : Intel Atom® Processor N270 1.6 Ghz
Ram : 1x1gb DDR2
HDD : Samsung HM160HI
I'm creating the bootable using rufus with setting
Partition scheme : MBR & UEFI Legacy
File system : FAT32
Cluster size : 16kb
ISO Mode
The laptop come with Windows XP Home 32 bit. Installation wenth smooth until partition part where i can't partition in it. I want to format the HDD first but i don't know how. Pressing alt + f2 & alt + f3 (busybox v1.27.2 (ubuntu 1:1.27.2-2ubuntu3) built -in shell (ash) to find terminal or gparted or things like that but didn't find one.
Partition error is like "we have been unable to inform the kernel of the change, probably because it/they are in use. As a result, the old partition(s) will remain in use. You should reboot now before making further changes.
ERROR!!!
thank
|
I complete my installation by formating the HDD and everything works fine. Still a bit laggy too but better then windows XP
| How to install Lubuntu-18.04 32 bit |
1,559,968,809,000 |
I have a 250 GB Samsung Pro SSD in my Lenovo desktop. Initially Debian 9 was using the whole disk. Recently I decided to shrink my Debian partition and create two more partitions, one a shared data partition for my Nextcloud, and on the last partition I installed Xubuntu 19.04 with the Xfce 4.14 pre-release PPA installed. In order to do so, I booted a live USB, loaded GParted, and shrunk my Debian partition down to 46 GB (21 GB used, 13 GB available). The entire OS is in one partition. I use fstab to mount my Nextcloud partition in my home directory.
Since shrinking my Debian partition, I have noticed that applications load more slowly. This is very slight, but it is still enough to bother me. Before in Debian and in Xubuntu 19.04 currently, for example, launching Xfce4 Terminal after reboot is basically instant. However, now in Debian there is about a 400-600 millisecond delay. It is the same for other applications in Debian. I created a new user, logged in there, and had the same result. So, it is not an issue with my home profile. I have tried reinstalling applications but no luck. The disk is healthy after running a disk health test. Xubuntu 19.04 is super fast as Debian was before the partition resize. It must have something to do with shrinking the Debian partition / root file system. Any ideas on how this could be solved?
|
In Xfce in Appearance I changed the Style and Icons. Then in Window Manager I changed the Style. Now applications load just as fast as before. I am not sure why.
| Applications loading slightly more slowly after shrinking Debian 9 root partition |
1,559,968,809,000 |
In my sdb drive I have 76 Gb of unallocated space. I would like to extend the partition sdb3. However gparted hangs if a try to extend this partition. Anyone knows why?
|
I copied the content of this partition to anther hard drive. Then I deleted the sd3 partition and finally I create a new partition with the full size of the disk.
| Unable to extend a partition in gparted |
1,559,968,809,000 |
I want to know the maximum number of partitions in a hard drive.
But I'm not sure whether that is affected by factors such as hard drive types or partition scheme or not. So, I'll just write down all possible cases that I can think of.
Questions
Does the number of maximum partitions per hard drive affected by
partition scheme (GPT vs MBR)
The type of hard drive (SCSI/SATA vs IDE - because SATA and SCSI are both treated as SCSI)
What is the maximum number partitions for a hard drive for each case? I think the possible cases include
GPT:
max num of partition per SCSI/SATA hard drive?
max num of partition per IDE hard drive?
MBR: for MBR, there's the concept of primary, logical and extended partition. logical partitions only exist if an extended partition exists (and there can only be at most ONE extended partition per hard drive). So the questions are:
Does the number of primary partitions affect the number of possible logical partition? (i.e. Does it make any differences to the maximum number of logical partitions if I have 0 or 1 or 2 or 3 primary partitions?)
max num of logical partition per SCSI/SATA hard drive?
max num of logical partition per IDE hard drive?
|
Because on some devices partitions are sometimes not used at all, here are some numbers for partitions and their modern replacements;
4 MBR primary partitions
or 255 Linux GPT partitions
or 16,777,216 LVM1 volumes vg*lv, LVM2 said unlimited but checking the source would likely reveal a limit.
or 9,223,372,036,854,775,807 zpools (ZFS) or subvolumes (btrfs)
| What is the maximum number of partitions in a hard drive [duplicate] |
1,559,968,809,000 |
I'm new to Linux and I've thought I'll give it a try and so I installed Zorin OS. I' wondering if I installed it correctly in the disk.
Sample screenshot using cfdisk:
Is it fine that the Linux file system took all my drive space?
|
If you told the installer to use the whole disk for Linux, that's exactly what it did. No operating system installer is going to leave unpartitioned free space on the system disk unless you specifically request it to.
If the installer did not ask you whether or not to use the whole disk and did not tell you that any other operating systems on the disk will be overwritten if you use the defaults, in that case I might be inclined to say Zorin's installer sucks, but the actual result looks like a perfectly valid installation of Linux as the only OS on the system.
The partition type IDs tell me that the installation is probably using LVM by default, so although the /dev/sda5 partition is occupying the whole disk, it does not necessarily mean all the disk space is actually used.
You should use the sudo lvs command to view the number and size of any LVM logical volumes within /dev/sda5, and sudo pvs to see if you have any unallocated space left. You could then use this unallocated space to either extend any existing logical volumes, or to create new logical volumes if you wish. Unlike traditional partitions, LVM logical volumes don't need to be physically contiguous: parts of a single LV may even occupy several different disks, and so a LV can be bigger than any single physical disk if required.
I don't see anything that would cause a performance problem. In the comments, you said:
From my understanding, the reason of separating System OS to the other files is to prevent the system slowing down from loading all those other files when booting up.
This is not correct. The main reason for separating system and user files to separate filesystems (whether those are located on partitions or LVs) is to make it easier to completely reinstall the OS without affecting user files. In some cases, it might also be needed for other reasons, like if the system is part of a cluster and the administrator wants to place the user files on a iSCSI or other SAN storage that can be accessed from all the cluster nodes simultaneously: such a set-up requires a special cluster filesystem, and usually cannot be mounted until the OS and the cluster infrastructure services have started up.
The system will not blindly load all the files on the system disk on boot, because a) that would be futile, as a disk may easily have at least an order of magnitude more capacity than the system has RAM, and b) in an overwhelming majority of cases, it would be just a stupid waste of time with no significant benefit.
From the sudo lvs output in the comments I see that your /dev/sda5 is used to create a LVM volume group named zorin-vg and it is currently split into two logical volumes: a swap_1 LV of 976M size, and all the rest seems to be used by the root LV. This is a perfectly valid simple configuration, although personally I would have perhaps preferred splitting /home into a separate LV. But even that is just my personal preference: I would not consider it too important.
Since Zorin OS is apparently developed from Ubuntu 16.04, I guess the filesystem type used on the root LV is most likely ext4. Although it's not the absolute best in performance, it is probably still the most robust and well-tested filesystem type in the Linux ecosystem.
Although 465G is a perfectly respectable size for a single-SSD system, you should keep in mind that Linux is developed to handle server systems which may include filesystems with tens of terabytes in size: for any modern filesystem capable of handling that, 465G is small and easy. Many of the old recommended practices from 10-15 years ago are starting to look increasingly like needless micro-managing. The more you split your disk into separate filesystems, the more often you'll encounter the nuisance of having your free space not be where you need it. That's a complication you don't need when you're in the process of learning a new operating system.
Since you said you're new to Linux, I'd urge you to keep this configuration for now, at least until you're more familiar with Linux and its concepts.
Assuming that the filesystem type on your root LV is ext4, it would be possible to shrink it and use the freed space to create another LV, copy the contents of your /home to the new filesystem and mount it in place of your current /home directory. But since that requires shrinking your current root filesystem (which cannot be unmounted while the OS is running), and the filesystem will probably need to be unmounted for major shrinking, you'd need to do it by booting the system from an external media, probably some Linux Live CD or USB. Once the filesystem has been successfully shrunk, the rest of the steps can be done from within the Zorin OS, and no further reboots should be necessary:
shrinking the root LV (which acts as the container for your root filesystem) unless you already did that together with shrinking the filesystem (depends on the tools available on the external boot media)
creating a new LV with lvcreate -L <desired size> -n <desired name> zorin-vg
initializing (Windows might say "formatting") the new LV with a filesystem, with e.g. mkfs.ext4 /dev/zorin-vg/<desired name>
mounting the new LV in a temporary location: mount /dev/zorin-vg/<desired name> /mnt
copying the contents of /home to the new filesystem: cp -a /home/* /mnt/
unmounting the temporary location: umount /mnt
creating an /etc/fstab entry for your new filesystem:
/dev/zorin-vg/ /home ext4 defaults 0 2
moving the existing /home directory aside and creating a new empty directory as a mount point: mv /home /home.old; mkdir /home
letting the system mount the new filesystem for you: mount -a
and finally, testing that everything still works and deleting the /home.old directory tree.
But as you can see, there are quite a few steps in that process, and if you're new to Linux, I'd recommend you to leave it until you have a stronger understanding of what you'll be doing.
| Linux installation and partition |
1,559,968,809,000 |
I have changed to Fedora Linux and shrunk my windows partition. I have unallocated space which I want Fedora to take up. I have looked other answers to questions like this and cannot find instructions for my use case. I have a picture of my drive right now. I also have a live USB ready.
From what I have read so far, I shouldn't touch the boot partition. Can someone give me instructions on how to get around the /boot? I will need to move it later as well to give more space to Fedora.
In short, how do I move the Fedora partition to before the boot ext4 partition and resize it?
|
how do I move the Fedora partition to before the boot ext4 partition and resize it?
The answer may be surprising: You don't have to do that.
Since you are using LVM and are not aiming to extend a non-LVM partition (i.e. /boot), you don't have to extend the existing PV. Instead, you can make a new partition out of the unallocated space, use pvcreate to make it a second LVM PV, then vgextend to add it into your existing volume group.
With LVM, your volume group may consist of one PV, or many PVs, on one or more disks; LVM does not care about that. All the PVs in a single VG will act together as a single pool of disk space. You can then extend or create new LVs freely, without needing to care where one PV ends and another begins. It will all be handled transparently by LVM.
First, use gparted or any tool you like to make that unallocated space into an usable partition. You should set its type ("flags" in gparted) as lvm2 pv, but strictly speaking you don't have to. I'll assume that it will be named /dev/nvme0n1p7.
Verify that the new partition is visible in /proc/partitions, indicating that the kernel has accepted the new partition table. If that did not happen, you may need to run partprobe /dev/nvme0n1 and check again. If the partition is still not recognized by the kernel, you may need to reboot at this point.
Once the partition is visible, you can proceed. Use pvs to see if gparted already initialized the partition as a LVM PV; if not, run pvcreate /dev/nvme0n1p7 to initialize it.
Then, assuming that your LVM volume group uses the default name fedora, run vgextend fedora /dev/nvme0n1p7.
Now the previously-unallocated space has been added to the volume group, and you can use it to extend existing LVs and/or create new ones as you wish.
| How can I resize my fedora lvm partition to be larger with the root partition in the way? |
1,559,968,809,000 |
Below is the info I get using (g)parted or fdisk command.
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 196265983 196263936 93.6G 83 Linux
/dev/sda2 196268030 229468159 33200130 15.9G 5 Extended
/dev/sda5 196268032 229468159 33200128 15.9G 82 Linux swap / Solaris
Is there a system call or filesystem(/sys/block, etc) based info available to know if a partition is extended/primary and the hierarchy sda5 under sda2, etc?
If yes, is there a way to know if what logical partitions lie under the selected extended partition?
I want to avoid parsing output of command(s). I have tried to read the code of fdisk but it is too complex for me to understand it.
Edit 1:
After reading the comments and answers I came to know that I was not aware of MBR/GPT, etc. So, I decided to read about MBR and EBR internals https://thestarman.pcministry.com/asm/mbr/PartTables2.htm#ebr and wrote a code to get the partition details of a disk.
|
This question is not well defined.
If the disk is formatted using GPT, then there are no extended partitions, and so there is no heirarchy.
If the disk is formatted using MBR in such a way that a Microsoft OS can access it, then there is at most 1 extended partition, and a total of up to 4 primary and extended partitions. These will have names of the form /dev/sdf[0-3]. If there are any logical partitions, they will have partition numbers greater than 4. In order to have logical partitions you must have an extended partition to hold them.
However there is nothing requiring a linux system to have at most one extended partition, and there is nothing to say that there can be no overlaps of non-extended partitions, just as long as you don't use them.
So in particular you could have partition 1 being a smallish boot partition, partition 2 covering everything that wasn't in partition 1, partition 3 covering the first half of partition 2 and being of type "extended", partition 4 being the second half of partition 2. Inside partition 3 you could have partitions 5 and 6, each taking half of partition 3. This will all work OK provided that you don't actually try and use partition 2. However partitions 5 and 6 are both in both partitions 2 and 3, so the "hierarchy" is not a DAG (Directed Acyclic Graph), and so the "client need" can't be satisfied.
My advice for clients like this is to double your fees.
The "type" of the partition for the primary/extended is recorded in the MBR, so you can use code like dd bs=1 skip=446 count=64 if=/dev/sdf | hexdump -C to get something like this
00000000 00 20 21 00 83 df 13 0c 00 08 00 00 00 20 03 00 |. !.......... ..|
00000010 00 df 14 0c 05 19 0d cc 00 28 03 00 00 e0 2e 00 |.........(......|
00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000030 00 19 0e cc 83 15 50 05 00 08 32 00 00 f8 0d 00 |......P...2.....|
and you can pick out the 5th byte (83, 05, 00, 83) to get the 4 values. The usual "type" of an extended partition is 05, but 0f and 85 are also used. See https://www.win.tue.nl/~aeb/partitions/partition_types-1.html for more information.
So with this you see if there is an extended partition (the second one in this case), and you then know that partitions with numbers greater than 4 are in it.
| How to check if partition is Extended/Primary in Linux |
1,559,968,809,000 |
I have pved, /dev/sda and /dev/sdb, and I vgextended the /dev/sdb to the default VolGroup, and lvextended the /.
now the lsblk shows this:
[root@store01 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 238.5G 0 disk
├─sda1 8:1 0 500M 0 part /boot
└─sda2 8:2 0 238G 0 part
├─VolGroup-lv_root (dm-0) 253:0 0 1010G 0 lvm /
├─VolGroup-lv_swap (dm-1) 253:1 0 23.9G 0 lvm [SWAP]
└─VolGroup-lv_home (dm-2) 253:2 0 100G 0 lvm /home
sdb 8:16 0 931.5G 0 disk
└─VolGroup-lv_root (dm-0) 253:0 0 1010G 0 lvm /
but when I put data into the /, the / get full:
there shows:
[root@store01 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
50G 49G 0 100% /
tmpfs 32G 0 32G 0% /dev/shm
/dev/sda1 477M 55M 397M 13% /boot
/dev/mapper/VolGroup-lv_home
162G 60M 154G 1% /home
now the vgs is this:
[root@store01 ~]# vgs
VG #PV #LV #SN Attr VSize VFree
VolGroup 2 3 0 wz--n- 1.14t 35.65g
EDIT
at first the / only have 50G, after the bellow commands:
pvcreate /dev/sdb
vgextend VolGroup /dev/sdb
lvextend -L +950G /dev/VolGroup/lv_root
lsblk shows the upper print.1010G
|
you need to extend lv_root as a LV
lvextend --size +500G lv_root
then extend / as a filesystem, this depends on filesystem type
resize2fs /dev/mapper/VolGroup-lv_root ## ext3/ext4
xfs_growfs / ## xfs
note that I would advise you to put data on a separate file system, 50 G is more that enough for system, you should create a new FS ( /data /MY_APP whatever )
| I lvextend-ed the /, but there is still only 50Gbytes |
1,559,968,809,000 |
But then I remembered home is !mounted! in /home and / is root
Here's what I want to do..
I have an hdd with 4 partitions.
boot
swap
root
home
I delete the first one, then the second, then hesitated to delete the third.. what if.. home gets deleted too? I mean I know it's just a partition, and when the system is on, it's mounted in /home
But I'm not sure and I don't want to make a horrific 400GB mistake.
|
I learned that a partition is JUST a block in storage, if it's mounted then you can edit the stuff in it..
When I installed arch linux, I had to mount the root partition into the usb live arch's /mnt folder, so root was (/mnt), then I mounted the home partition into a "mkdir'd" folder in /mnt/home <-- so home was mounted in a root folder..
just because you mounted a partition in a folder doesn't mean that partition has MOVED to the folder and is now living there, so.. with the partitions "umount'd" it's safe to delete any partition because they're just blocks in storage and their locations are separate.
Didn't matter in the end, made a mistake, deleted all them gigabytes, am sad now, got super depressed, sometimes winging it isn't the best idea, always have a plan kids. and adults.
| Does deleting the root partition affect the home partition? |
1,559,968,809,000 |
I'm experiencing a bug in Manjaro Gnome that I hope to solve.
PC System and Drive Configuration:
Legacy BIOS system. ASUS Maximus IV Extreme-Z.
This Motherboard supports UEFI BIOS boot in theory but activating EFI compatible ROM in options makes the system not able to boot to BIOS leaving only a black screen. This is not related with the present bug.
Sapphire RX 580 Nitro+. This card has a hybrid BIOS capable of booting with legacy and UEFI BIOSes. Its default mode is legacy. (Many users reported problems in forums with legacy BIOSes in the Sapphire 480 models).
sda SSD
sda1 MS Windows Reserved
sda2 Windows 10
sda3 extended Manjaro
sda5 /boot
sda6 /
sda7 /var
sdb SATA HDD
sdb1 Windows data partition (sometimes appears boot in gparted options)
sdb2 Manjaro Swap partition
sdc SATA HDD
sdc1 extended Manjaro
sdc5 /home
sdc3 Windows data partition
Bug explanation:
Upon installing a new graphics card GRUB booted just fine. I entered Manjaro "Hardware Manager" and pressed "Automatically install open source drivers".
This installs "video-linux" drivers which include AMD open source drivers in the Manjaro distro.
Right after that I rebooted Manjaro and this somehow corrupted the boot and even messed the video resolution at BIOS producing this image when I entered BIOS config:
Installing a spare video card seemed to fix the problem and the image display at BIOS went back to normal with both the spare card and after re-plugging the RX 580.
After that I uninstalled the "video-linux" drivers during one of the few times Manjaro managed to boot but it didn't solve the problem.
The corrupted boot consist of several problems:
The SSD sda is detected by the BIOS only sometimes. Many other times
it randomly doesn't get detected. I checked the SSD health with "sudo smartctl -a /dev/sda" and it reports a healthy state with 96 the lowest score on a scale of 0/100.
Trying to restore the GRUB as per this guide only worked a
couple of times. The SSD seems to degrade with each boot. The first
boot after applying the fix worked fine but at next boot this error
returned and the boot corrupted again until eventually it can't boot anymore. Checked the sda5 /boot partition with fsck and it reports everything is OK as with the rest of sda partitions.
grub-install --recheck reported no errors on /dev/sda and sdc. On
sdb reported a FlexNet at sector 32. I applied the fix per this
guide
I backed up and deleted the first 63 sectors of sda and sdb with
sudo dd and did a grub-install and grub-update on sda. Also did a
grub-install --recheck on sdb and sdc just in case.
The instructions in these guides didn't work and the boot is
corrupted in several ways:
a.- As mentioned SSD gets detected randomly by the BIOS.
b.- If I set the SSD as the default boot drive it enters the GRUB rescue mode.
c.- If I boot the SSD with the boot override option of the BIOS it enters Manjaro GRUB just fine.
d.- Selecting either Manjaro or Windows 10 boot reports a boot error that the system is trying to read/write outside the physical drive with this log reported only booting Manjaro:
Logs and info related to this situation:
I think it may be related with the hybrid BIOS option of this card. Before this bug I couldn't boot my Manjaro liveUSB in UEFI mode (seems an EFI compatibility problem related to my ASUS Mobo)
But after this error the liveUSB defaulted to a successful UEFI boot after BIOS post.
Also at boot the liveUSB reported a lot of read/write errors of the SSD and took a very long time to boot Manjaro XFCE.
After that boot the next ones reported much less errors and booted in much less time. Here's a pastebin link to journalctl -b log of the liveUSB. (This is the only log I can include since I can't boot to my base Manjaro system)
This error in the pastebin log:
nov 25 19:40:37 manjaro kernel: ACPI Error: [DSSP] Namespace lookup failure, AE_NOT_FOUND (20170728/psargs-364)
nov 25 19:40:37 manjaro kernel: ACPI Error: Method parse/execution failed \_SB.PCI0.SAT0.SPT1._GTF, AE_NOT_FOUND (20170728/psparse-550)
Appeared since I installed Manjaro (so not related with the present bug) and is easily solvable by adding:
sudo nano /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="libata.noacpi=1"
sudo update-grub
|
As Michael Prokopec suggested plugging the SSD in another system and cleaning contacts solved the problem.
At boot the other system did an e2fsck on the SSD reporting it healthy as well. Afterwards I tried to reproduce the error and seems it's working for now.
It may be a defective mobo (I suspect a socket pins problem) or the SATA contacts as Michael mentions. This is because booting a Manjaro liveUSB in the affected system semi-successfully tried to do an e2fsck at boot. Only booting in another motherboard with a Manjaro system fixed it.
NOTE: the corrupted BIOS screen was caused by a dual monitor/TV setup. As soon as I turned on the PC without the TV plugged in the HDMI port the BIOS screen went back to normal.
| Corrupted Manjaro GRUB boot at new RX 580 graphics card video-linux driver install |
1,559,968,809,000 |
This USB driver has two partitions, one is ext3 and another NTFS. Now I want to convert the ext3 partition to ext2, is it possible?
The partition has around 200G data and I have no spare disk or space to temporarily store that.
|
Simply remove journaling:
# tune2fs -O ^has_journal /dev/sdbX
# fsck.ext2 /dev/sdbX
Then you can simply remove .journal file.
| How to convert USB driver from ext3 to ext2 without losing data? |
1,559,968,809,000 |
I am trying to expand the size of my root directory as I am running low on space. I have tried resizing it from a Live USB and it won't let me.
The text in red is the mounting point (according the partition manager) when booting from the drive. /dev/sdc5 mounts to /boot/efi and /dev/sdc6 mounts to /
fdisk -l /dev/sdc yields:
Disk /dev/sdc: 29.3 GiB, 31406948352 bytes, 61341696 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x4e13a3a7
Device Boot Start End Sectors Size Id Type
/dev/sdc1 2048 15628287 15626240 7.5G c W95 FAT32 (LBA)
/dev/sdc2 37490686 61339647 23848962 11.4G 5 Extended
/dev/sdc5 * 37490688 38539263 1048576 512M ef EFI (FAT-12/16/32)
/dev/sdc6 38541312 61339647 22798336 10.9G 83 Linux
|
You don't have any unallocated space after the extended partition into which you can resize it. You can either reinstall or if you want to take the arguably more fun approach, perform the following gymnastics:
Create two primary partitions using the unallocated space: one will be your new ESP, which you can make 256MB (or even 128MB) and the other will be new your rootfs. Create them in that order.
At this point you'll have two ESP's, so remove the original ESP to avoid any conflicts. Note that deleting the partition will not wipe out the data; The partition can be revived with the information I had you add to your post.
Format the new partitions accordingly and copy your files over.
Check the /etc/fstab in the new rootfs, and update it if needed.
Boot from the USB drive to ensure everything is working.
Delete the extended partition. You'll now have unallocated space after your rootfs partition.
Resize the rootfs partition into the unallocated space. You'll need to boot from another system to do this.
Resize the rootfs to grow into the now larger partition, using resize2fs.
| Resize extended partition containing /boot/EFI and root |
1,559,968,809,000 |
Through some series of commands, I managed to end up with a disk that is supposed to contain one ext4 partition, but fdisk, parted, and blkid all insist it contains an Apple RAID slice, which it used to do. I can still mount the ext4 partition using an offset, but I can't get Linux to create a block device for it. How do I redefine the partitions in the GPT?
|
Welcome to unix.se!
You know where your ext4 partition starts. Lets say, it is $offset in bytes. Divide by 512 (assuming standard 512 byte sectors). Now you have the partition start as sector. Let's call this $start.
I further assume that your single ext4 partition does not extend into the very last 34 sectors of the disk (this is where the secondary GPT is located).
As long as these assumptions are correct, you can safely overwrite the GPT with proper data.
You can use gdisk and input
o to create a new empty GUID partition table,
n to add a new partition,
1 the first (and only) partition,
$start the previously calculated start (in sectors, 2048 is the default by the way),
⏎ (an empty line) for setting the end of the partition to the end of the disk (adjust as needed),
⏎ to accept file-system type 0x8300 "Linux",
w to write and exit.
Good luck.
| GPT has incorrect entries |
1,559,968,809,000 |
Say you have a "main" GRUB on /dev/sda, with several linux kernels, and you also have a secondary linux distribution on /dev/sdb2.
The computer boots into /dev/sda GRUB. From there, how to boot the kernels in /dev/sdb2 ?
When you update-grub in the distribution in /dev/sda, the OS-prober will detect those in /dev/sdb2 and populate the GRUB menu accordingly in (/dev/sda)/boot/grub/grub.cfg.
But this is inconvenient, as when you install a new kernel or change boot options in the /dev/sdb2 distribution, this will update (/dev/sdb2)/boot/grub/grub.cfg but not the main grub.cfg.
How to get the main GRUB to read and incorporate the entries from the secondary GRUB ?
|
There is a GRUB command, not documented in the manual, that precisely parses a config file, extracting the entries and ignoring the remainder of the configuration : extract_entries_source. With this, any change to the secondary distribution's GRUB menu entries will be automatically taken into account in the main GRUB's menu.
In the main ("host") distribution
Add a custom entry in /etc/grub.d/40_custom :
# A dummy entry to mark the separation
menuentry "Extracted from /dev/sdb2" {
true
}
# the following if for MBR disk, change to part_gpt if necessary
insmod part_msdos
# adapt with appropriate file system module
insmod ext2
# replace aaaa-bbbb-cccc with actual partition UUID
search --fs-uuid aaaa-bbbb-cccc --set slavegrub --no-floppy
extract_entries_source ($slavegrub)/boot/grub/grub.cfg
The partition's (file system's) UUID can be obtained with blkid.
You will also want to prevent GRUB to automatically populate the menu with OS-prober. This is configured in /etc/default/grub and can be disabled globally with GRUB_DISABLE_OS_PROBER or selectively for some partitions with GRUB_OS_PROBER_SKIP_LIST (see GRUB manual).
Then you can update-grub.
In the secondary distribution
There is nothing to do as the /boot/grub/grub.cfg file will only be read for its entries and will never be actually executed. You will probably want to disable the OS-prober completely there, as those entries would be redundant when integrated within the main GRUB's menu.
| How to aggregate grub entries from another partition? |
1,522,202,772,000 |
I have a project which requires a lot of contact with ext file system. But the majority of tools is based on Windows. Thus is there any software or plugin for explorer which allow the access to ext on Windows?
|
Yes one method could be via third party software installed on your Windows computer such as outlined in this post.
However, I cannot vet for the authenticity of any Windows programs or whether they will compromise the integrity of your ext file system.
Another method, if your Windows System and Linux System are installed on separate systems as either Virtual Machines or on different hardware, would be to make a file share server using something like Samba or NFS to share access to the ext file system via the network.
| Is there a practical way to view ext file system on Windows? |
1,522,202,772,000 |
I have a refurbished computer that originally has 1 TB of hard disk dirve and it originally came with windows installed. After some time, the Windows updated and the computer stopped working. Someone helped me and managed to make a partition in the hard disk drive and installed Ubuntu in the computer as OS. I now enjoy much better working with Ubuntu and would like to get rid of the partition that contains Windows and recover the whole 1 TB hard disk drive for the ubuntu system. Is this possible to do? Can anyone explain me how to do this or refer me to online websites where I can learn how to do this? Thanks so much!
EDIT: Following suggestions in the comments, I am using gparted and am getting the following window:
From reading online posts, I believe the partition with the Ubuntu system is the one with the slash / in the Mount Point column. Now, what I don't really know is which one is the windows partition or which partitions I can safely delete and reassign the space. Any suggestions? Thanks!
|
Windows OS residing in /dev/sda5 in the figure you've shown. In your system it's the only ntfs partition large enough to hold windows installation.
You can easily mount and see which partition containing what and decide to remove them. Like in Windows installation partition you'll find folders relevant to windows. To mount ntfs file system in Linux you need ntfs-3g driver, which usually comes inbuilt with Ubuntu. Otherwise install it using apt install ntfs-3g.
In your system /dev/sda1 is mounted as /boot/efi. So, it's containing grub boot loader. So, don't delete it even by mistake. You can delete /dev/sda2-/dev/sda5 and sda6, sda7.
If your main purpose is freeing up disk space I'll suggest you to delete /dev/sda5 only. Other partitions mentioned above has windows recovery, Windows bootloader etc. They may be helpful in case of a factory restore etc.
Now merging the entire 1 Tb disk is a tricky job. For that you've to first delete all drives except sda1, sda8 and sda9. Then merge all the space and copy all contents of sda8 i.e. Linux root partition into the newly created partition using rsync. Then you've to change /etc/fstab entry properly and boot the system with new file system as root. Also change the root parameter in grub to the new partition.
Once the system is booted with new file-system as / you can delete the existing root file-system i.e. /dev/sda8 and merge it with the new created root file system.
NOTE Changing root drive is a hazardous job. If not performed correctly your current installation may stop working. Another easy solution is delete all partitions and reinstall Ubuntu freshly. Always have a backup of all necessary files before deleting anything.
| Deleting hard disk partition from Linux |
1,522,202,772,000 |
I was trying to dual boot with Windows 10 and Fedora and could not reclaim the disk that I had shrunk on windows. After a lot of trial and error, I just deleted everything and installed just Fedora. But let it automatically choose partition. After installation. This is what I see upon running fdisk.
I am going to use this computer for java and other such application development, to install eclipse, tomcat , intellij etc. would this be a good disk partitioning configuration for such things?
I have always been a windows user so please let me know if there are important tools and applications I should install that will make my life easy on this platform. Any tips and suggestions are welcome.
/dev/sda1 2048 411647 409600 200M EFI System
/dev/sda2 411648 2508799 2097152 1G Linux filesystem
/dev/sda3 2508800 18874367 16365568 7.8G Linux swap
/dev/sda4 18874368 123731967 104857600 50G Linux filesystem
/dev/sda5 123731968 1953523711 1829791744 872.5G Linux filesystem
|
I always put the swap partition at the end of the disk so its always easy to resize the partition preceding it since you must move partitions proceeding. It should be the same size as your RAM. On modern systems there isn't much need to have any more than that and in most applications except suspend to disk you don't even need that much. So you're setting it to the same size as your RAM primarily to support suspend to disk.
I always make ESP (called EFI system on yours) 512MiBs to future proof it but 200MBs is a good size.
All of your partitions are also 4K aligned which is good.
You appear to have separate /boot and /home partitions. This isn't strictly necessary unless you use Btrfs or RAIDs. But leaving it is fine and Fedora defaults to creating them likely to future proof.
I recommend you partition your system like this:
Device Mount Size FS Type Label
/dev/sda1 /boot/efi 512MiB FAT32 EFI System
/dev/sda2 /boot 1GiB Ext4 Boot
/dev/sda3 / 50GiB Ext4 OS
/dev/sda4 /home 893141MiB Ext4 Home
/dev/sda5 - 7991 MiB swap -
| are these partition sizes good? [closed] |
1,522,202,772,000 |
I need to make another parition (/dev/vda2) on an existing disk (/dev/vda, 20G).
umount /mnt/
resize2fs /dev/vda1 10G
df -h
...
/dev/vda1 9.8G 7.8G 1.5G 85% /mnt
So it's ok on this side, but not for fdisk:
fdisk -l /dev/vda
Disk /dev/vda: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: XXX
Device Start End Sectors Size Type
/dev/vda1 4096 41943006 41938911 20G Linux filesystem
/dev/vda15 2048 4095 2048 1M BIOS boot
/dev/vda1 is still seen as 20G.
However, tune2fs is correct:
tune2fs -l /dev/vda1
tune2fs 1.43.4 (31-Jan-2017)
Filesystem volume name: DOROOT
Last mounted on: /mnt
Filesystem UUID: XXX
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
Filesystem flags: signed_directory_hash
Default mount options: user_xattr acl
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 652800
Block count: 2621440
Reserved block count: 129948
Free blocks: 510232
Free inodes: 438179
First block: 0
Block size: 4096
Fragment size: 4096
Reserved GDT blocks: 1023
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 8160
Inode blocks per group: 510
Flex block group size: 16
Filesystem created: Fri Oct 21 16:17:46 2016
Last mount time: Thu Nov 23 17:35:09 2017
Last write time: Thu Nov 23 17:42:31 2017
Mount count: 1
Maximum mount count: -1
Last checked: Thu Nov 23 17:31:54 2017
Check interval: 0 (<none>)
Lifetime writes: 456 GB
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 256
Required extra isize: 28
Desired extra isize: 28
Journal inode: 8
Default directory hash: half_md4
Directory Hash Seed: XXX
Journal backup: inode blocks
block count * block size is 10G so what happens to fdisk?
How could I partition the remaining 10G?
|
You have to delete the partition and create a new one.
Show partition information:
Command (m for help): p
Disk /dev/vda: 407.6 GiB, 437629485056 bytes, 854745088 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x5c873cba
Partition 2 does not start on physical sector boundary.
Device Boot Start End Blocks Id System
/dev/vda1 * 2048 1026047 512000 83 Linux
/dev/vda2 1026048 1640447 307200 8e Linux LVM
delete the partition:
Command (m for help): d
Partition number (1,2, default 2): 2
Partition 2 has been deleted.
create a new partition:
Command (m for help): n
Partition type:
p primary (1 primary, 0 extended, 3 free)
e extended
Select (default p): *Enter*
Using default response p.
Partition number (2-4, default 2): *Enter*
First sector (1026048-854745087, default 1026048): *Enter*
Last sector, +sectors or +size{K,M,G,T,P} (1026048-854745087, default 854745087): +500M
Created a new partition 2 of type 'Linux' and of size 500 MiB.
Show partition information:
Command (m for help): p
Disk /dev/vda: 407.6 GiB, 437629485056 bytes, 854745088 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0xf6e2b6cb
Device Boot Start End Blocks Id System
/dev/vda1 * 2048 1026047 512000 83 Linux
/dev/vda2 1026048 2050047 512000 8e Linux LVM
Write the changes with the w option when you are sure they are correct.
Check the filesystem:
e2fsck /dev/vdb1
e2fsck 1.41.12 (17-May-2010)
Pass 1:Checking inodes, blocks, and sizes
Pass 2:Checking directory structure
Pass 3:Checking directory connectivity
Pass 4:Checking reference counts
Pass 5:Checking group summary information
ext4-1:11/131072 files (0.0% non-contiguous),27050/524128 blocks
| fdisk not seing resize2fs shrinking unmounted partition |
1,522,202,772,000 |
Here is a picture of my . I know I need to leave the efi alone, but I do not know what to do with the rest? Windows will be used to get free space and used to install ubuntu I do not plan on dual booting.
|
The partition labeled recovery will be your actual windows installer since windows doesn't ship with CDs anymore. The parition TI10686800A is your C:\ (you're clearly using a toshiba laptop). If you ever plan to put windows back on this device I highly recommend you image your disk first as once the OEM recovery/installer is gone your options become limited.
If you do not plan to keep windows around you can completely wipe the disk, there is no need to keep around anything as Ubuntu supports EFI boot and will install the EFI loader for you.
| Is it ok to leave partitions as is when installing from Windows? |
1,522,202,772,000 |
I have installed CentOS on Windows VirtualBox host. I had initially allocated 50GB but I ran out of space so I extended the vdi to 100 GB and then used a GParted live CD to extend the lmv2 pv partition from 50 GB to 100 GB. When rebooting to CentOS it remained 50 GB. So I reshrinked the partition. Anyway it looks like this after reverting the change.
Since after the initial extension of the partition the vdi on the VirtualBox settings was still looking like 50 GB as depicted here
I really don't know whether this is a Linux or VirtualBox question. Any insights?
|
To add the additional space, you need to resize 5 things:
The disk (VDI)
The partition
The physical volume
The logical volume
The filesystem
What you can to is...
Resize the VDI and partition, like you did before.
Resize the physical volume with the command: pvresize /dev/sda2
Resize the logical volume and filesystem in one go with the command: lvresize -L +50G /dev/YOUR_VOLUME_GROUP_NAME/vg_centos6
| Resizing an lvm2 pv CentOS partition |
1,522,202,772,000 |
Given one disk (e.g. /dev/sda) which is known to already contains some partitions (e.g. /dev/sda1, /dev/sda2, /dev/sda3).
Is it possible to run preseed on such disk (meaning: partition the rest of disk, set dual boot with grub)?
If so how to achieve this?
|
Yes, it is possible to install a second (or third, or fourth) operating system. However, there are some requirements and caveats that need to be considered.
Depending on what OS(es) are already installed, you may have to use LVM2 (Logical Volume Manager) or similar if you want the new Debian based OS to use more than one partition. In particular you will need to be aware of the restrictions for booting a Linux kernel from certain partition formats (last I knew the GRUB and Kernel files had to reside on a non-LVM partition).
To achieve an automated (preseed, kickstart, etc.) install of a dual-boot configuration you should be very familiar with the bootloader(s) the system will use and how they interact for different OSes. The automated installation could simply fail and do nothing, or it may fail to configure the dual-boot nature while preserving data, or it could fail spectacularly and overwrite/destroy data on the preexisting partitions. Be cautious if you are new to automating an install.
I suggest getting familiar with the official Debian Preseed documentation and the many fine examples they share at that page.
| Preseed existing partitions |
1,522,202,772,000 |
I have 1 hard drive with 2 partitions: C: and E:. Windows XP is installed on C, while E is used to store music, images, etc. I want to install Linux Mint 18 Cinnamon 64-bit alongside Windows. I want to shrink the C partition to make room for Linux.
Do I have to create a /home partition, seeing that I already have E? If so, how big should it be?
Alternatively, could I set E (which is formatted in NTFS, by the way) to be /home without losing the data, i.e. without formatting it?
Also, what size would you recommend I make root, and where should I install the boot loader?
The following information should help:
size used free File system
C 292GB 169GB 123GB NTFS
E 638GB 414GB 223GB NTFS
Those partitions take the whole disk.
Thank you.
|
What I usually do in my dual-boot installations is to keep separate paritions for Windows and Linux, keeping also the /home folder inside the Linux partition as well. Then, I just symlink the folders in my personal folder to the ones located in the data (E:) partition. For Windows, I do the same: I keep my User folder inside the Windows partition and then I symlink the folders to point the data partition. This layout lets me quickly isolate data from the SOs in case any of them gets corrupted, infected, broken, unbootable, etc. If that happens, I only lose the application files and none of my personal ones.
| Should I create a /home partition while installing Mint alongside Windows XP? |
1,522,202,772,000 |
I am working on a desktop running on Ubuntu 16.04. I want to isolate the directories /var, /etc, /opt in separate partitions. Creating new partitions is fine.
At this moment, the fstab only mounts copies (say, /media/var, /media/etc, /media/opt) on the newly created partitions, so as to interfere with the ordinary course of things minimally.
I am aware of this other post Recommended fstab settings and of the Ubuntu fstab summary which only provides general information.
At the point of editing the /ect/fstab file, I became aware of the importance of setting an appropriate mount option field (the fourth field, indicated as <options>).
The naive evidence is:
Choosing defaults as a mount option makes the rebooting of Ubuntu stall. After logging in, the greeter does not move on to the password request for the encrypted file system.
On the contrary, if I copycat the option nodev, nosuid from the option already set for /home (indeed residing on an own partition), I do manage to access my desktop manager as usual.
However, I don't want to presume that this will be the best option when the new partitions have the real /var, /etc, /opt directories mounted on. For the example, the mount options for the current / directory are errors=remount-ro. This option may well also be suitable also for any subdirectory moved out to an independent partition. I wish to avoid guesswork though.
The question is: what are the mount options for standalone /var, /etc and /opt such that the system performs like when they are subdirectories of /?
|
You can use the same mount options for standalone parts of the system such as /var, /opt, etc. Using defaults is not the cause of your problem.
Your description is not precise enough to identify what went wrong in one attempt and why the other attempt succeeded. However, there's one thing you mention that's doomed to failure: /etc belongs on the root partition. It contains /etc/fstab as well as the scripts that would trigger the mounting of the other partitions. You must leave /etc on the root filesystem.
Splitting off /var, /usr and /opt is generally not useful, but not harmful either. Splitting off some specific parts of /var can make sense, for example split off /var/mail on a mail server, split off /var/log on a server that has a lot of important logs, etc.
You can use nodev everywhere except /dev. A system partition should generally not have nosuid, but it can make sense for some parts of /var.
| fstab mount options for /etc /opt /var partitions |
1,522,202,772,000 |
I recently decided to try out Arch Linux, but I am having problems installing the base and base-devel packages. First, here are my partitions:
sda2 home 350GB (ext4)
sda4 root 30GB (ext4)
sda3 boot 7GB (fat32)
I figured I didn't need a swap partition yet, cause I have 6GB of RAM, which I assume is enough to install Arch. The boot partition is larger than normal because I have ~35GB free space, and based on my research, some were saying that the boot partition was too small.
Then, after setting the server mirror and mounting the partitions, I synchronized the package databases just to be sure:
pacman -Syy
And here is where I encountered the first problem. When executing pacstrap -i /mnt base base-devel and selecting all packages, I got these warnings:
warning: skipping target: file
warning: skipping target: fileutils
warning: skipping target: gawk
warning: skipping target: gettext
warning: skipping target: grep
warning: skipping target: gzip
warning: skipping target: pacman
warning: skipping target: sed
warning: skipping target: texinfo
warning: skipping target: util-linux
warning: skipping target: which
I thought it was odd, but I decided to proceed with the installation. Then, I got these errors. The first error actually prints about 50 times, but I snipped it to prevent spam:
error: could not open file /mnt/var/cache/pacman/pkg/vi-1:070224-2-x86_64.pkg.tar.xz.part: Invalid argument
warning: failed to retrieve some files
error: failed to commit transaction (failed to retrieve some files)
Errors occurred, no packages were upgraded.
==> ERROR: Failed to install packages to new root
So naturally, I searched on the internet for the error, and a bunch of old forum posts came up. A couple said to make the boot partition larger, which is why it is 7GB instead of 500MB like it was before. Another one said to try changing the server mirror, remove the file /mnt/var/cache/pacman/pkg/vi-1:070224-2-x86_64.pkg.tar.xz.part, and try again. Still, no success.
None of the solutions I have found work, and I am not sure how to continue. I have done the process a few times, but the problem seems to happen each time. Any help would be greatly appreciated. If you have any questions, feel free to comment!
Edit: Yup, I do have internet connection.
|
Alright. Thanks to @immilesahead, it is finally working. Here's what I did:
(1) Restart the computer
(2) Format and erase partitions
(3) Recreate partitions root, home, and boot
(4) Execute:
mkfs.ext4 /dev/sdaX # root partition
mkfs.ext4 /dev/sdaX # home partition
mkfs.fat -F 32 /dev/sdaX # boot partition, UEFI only!
(5) Install the packages again without running pacman -Syy
(6) ???
(7) Profit
| Problem installing base and base-devel on Arch |
1,522,202,772,000 |
I want to dual-boot Centos7 and Win10.
So what is the best OS installation order/process and HD partition configurations to support this smoothly, given my HW config?
I've got an ASUS ROG G751JY-DH72X laptop (Intel i7 64-bit)
It's got 2 harddrives:
1 TB HGST 7200rpm (SATA ATA Port 3)
512 GB SSD (on PCIE SATA Port 0).
Another important question is how to correctly/best set up the UEFI config?
Here is my current BIOS info.
=== BIOS INFO ===
Aptio BIOS copyright 2012 American Megatrends
ver 205
VBIOS version 84.04.1F.00.46.N81G750
Advanced:
Intel AES-NI
VT-d (enable VT-d function on MCH??)
PCIE SSD Information
PCIE SSD SATA PORT 0
Device Type: Hard Dirsk
Model Name: SAMSUNG MZHPU512HCGL-00
SATA ATA Port 2
Device TYpe: ATAPI CDROM
Model Name: MATSHITABD-MLT
SATA ATA Port 3
Device Type: Hard Disk
Model Name: HGST HTS721010A9E630
Boot Options
Launch CSM
Launch PXE OpROM policy
Boot Option Priorities
P3: HGST HTS721010A9E630
P2: MATSHITABD-MLT UJ272 S
Secure Boot - Disabled
=== END: BIOS INFO ===
I am willing/planning to reformat the HDs and reinstall everything from scratch. Just want to know the recommended config to minimize headaches!
Please let me know if more info/specs details are needed.
Thanks!
|
Windows 10 will need to be installed first because it will overwrite any existing bootloaders on the drive. I have a dual-boot of Windows 7 and Gentoo, and I've found the best partition scheme that doesn't result in Windows corrupting the bootloader is as follows:
/dev/sda
1 /boot ext2 148M
2 Windows 7 ntfs 500GB
3 Extended Partition
4 / ext4 450GB
5 swap swap 16GB
Your partition sizes will vary obviously but I've been running this scheme with Grub2 in the MBR for a few years now and not had the problems I had before with Windows corrupting the MBR after a while.
/boot does not have to be a separate partition, but it is recommended for security reasons that it be so. In my case on other machines where I have more than one Linux distribution installed it makes it convenient to manage configurations for the bootloader across all installs. Here are some other reasons
You need to install Linux first so that you can use the included tools to create the partition scheme you want. Windows Setup will not allow you to do this. Once you've created the partition scheme, installed Linux and the bootloader, you can run Windows Setup and install on the NTFS partition you already created.
I have used extended partitions in this setup instead of primary partitions because my machine does not support more than 3 primary partitions. This may not be necessary in your case.
| Restarting from scratch: recommended dual-boot config for centos 7 and win10 |
1,460,556,349,000 |
I have both Windows and Ubuntu 14.04 on my computer, and I'm having some trouble. The Windows partition doesn't actually work at all, and the Ubuntu partition is getting buggy. I'm f.ex. having trouble downloading packages etc., and I can't seem to find out why.
Since I haven't used the Windows partition for almost 3 years now, I'm thinking that it's completely unnecessary. I also have a laptop at my job which has Windows. I would like to only have Ubuntu, and also perhaps an upgraded version, not necessarirly 14.04.
Is this something I could do myself? I haven't enabled the dual-booting myself. I don't need to load files from a backup, as the files I have there are all small enough to just backup to my cloud storing service. I'm hoping that this is something that isn't too risky to attempt by myself, but of course it's important that the computer survives an eventual attempt.
|
If you aren't worried about losing any / all the files from either partition, you can set up an Ubuntu-only environment extremely easily: simply download the Ubuntu ISO (here), and select "Erase Everything and Install" when prompted.
If you want to keep everything on your Ubuntu partition, that's not too difficult IF your Ubuntu partition is set up with LVM. If so, you can do this from the Ubuntu Live Disk (select "Try Ubuntu" when booting from the Ubuntu Installation CD) and launching GParted. You can then delete your Windows partition and then resize your Ubuntu partition to consume it's space.
As for the issues you mentioned with packages not updating properly, all that I can really recommend is to Google whatever error it gave you.
| How to change from dual-boot to only ubuntu |
1,460,556,349,000 |
When I installed Arch linux I created a 24G swap partition. Now I want to delete it and merge it with home partition. How to do it?
Device Start End Sectors Size Type
/dev/sda1 2048 821247 819200 400M Windows recovery environment
/dev/sda2 821248 1353727 532480 260M EFI System
/dev/sda3 1353728 1615871 262144 128M Microsoft reserved
/dev/sda4 1615872 1694668799 1693052928 807.3G Microsoft basic data
/dev/sda5 1694668800 1744998399 50329600 24G Microsoft basic data SWAP
/dev/sda6 1745000448 1786943487 41943040 20G Microsoft basic data
/dev/sda7 1786943488 1899671551 112728064 53.8G Microsoft basic data HOME
/dev/sda8 1899673600 1900595199 921600 450M Windows recovery environment
/dev/sda9 1900595200 1953513471 52918272 25.2G Microsoft basic data
|
Well the only way I can think of might take a long time to process:
First delete your swap partition using Gparted or sth alike.
The space that was allocated to it is now free, but you can't just attach it to your HOME partition because they're separated by your root partition sda6.
In order to allocate your /home more space, you have to free the adjacent space (you can't simply overwrite another partition), so the thing here is to move the next partition (sda6) to fill the space you just freed from sda5.
If you use Gparted, you have to use the Resize/Move dialog:
Type 0 in the Free space preceding box and the Free space following box will increase by itself.
3. Finally extend your home partition to fill the aformentioned free space:
In the Resize/Move dialog just increase the New Size box to the maximum.
Click the check button on the main interface and operations will be performed.
Go make yourself a coffe, a tea, take a nap or something because it might take a while :)
In terminal, run sudo update-grub to make Grub aware of the changes, else your computer might not boot at all, which is not cool at all.
If you don't use Gparted, I guess what you use's interface would look a bit like Gparted's so you would just have to find the equivalent stuff. :)
| Delete swap partition and merge it with home partition |
1,460,556,349,000 |
I am havind almost 50 gb free space in hard disk. But while partitioning its shows that "could not allocate requested partitions : no partition slots in sda". I made free space by shrinking my current 'e' drive.
|
MBR only supports four primary partitions and you probably already have partitions C,D and E plus a boot partition. So you would need to delete one partition and/or reformat it. For details see https://en.wikipedia.org/wiki/Master_boot_record.
| Error while Installing centos 6.7 alongside windows 7 |
1,460,556,349,000 |
How to partitioning hard disk for two different linux system on the GPT/UEFI.
Size of disk 500gb.
I ask because of the fact the disk is limited to 4 primary partition.
I want to have 2 partitions on each system and one common.
1 section will be EFI
|
GPT can have as many partitions as you want*. Therefore, you can have them all. Most of the time when I partition my disc, I set up /home on separate partition for my data(music, images, etc). This has a benefit of being able to reinstall my system without losing data.
So we already have 3 partitions: swap(double the ram), /(I give it 1/2 of disc space I have), and /home (another 1/2). You can also make separate /var for programs, or /boot, but they aren't really needed - you'll do just fine with these 3.
As for filesystems, here's what I go with:
swap: swap
/, /home : ext4
/boot : ext2
I basically take these 3(+ I have /boot), set up swap and boot, then divide rest in half, approximately. Should work for you too.
* Given you don't want insanely many partitions.
| How to partition my hard disk [closed] |
1,460,556,349,000 |
Let's say in my disk I have two partition, Partition A 100Gb and Partition B 800Gb, I want to install fedora on partition A only. I don't want to touch partition B. Is it possible?
|
Did you check the docs? They're actually pretty detailed here — see particularly 5.4.10. Manual Partitioning. You may also find the whole of Appendix B: An Introduction to Disk Partitions to be helpful.
In this particular case, though I think the best way to go is to use automatic partitioning with the Reclaim Space option, as described here. Start with Automatic Partitioning, and then it will tell you there isn't space available. Choose Reclaim, and then remove the Partition A.
Automatic partitioning will then create a new partitioning scheme using that space, and will leave your current Partition B alone.
Depending on what you're doing with Partition B, you may also want to read the Multiboot Guide.
Of course, do make sure you have backups available before trying anything like this. There's always the possibility of bugs (or human error). And, of course, a good backup is important anyway!
| Fedora installation on particular partition |
1,460,556,349,000 |
I wanted to increase the disk size of 2 VMs from 20GB to 100GB.
I followed the normal procedure, increased vmdk size, fdisk to create a new partition with the free space (sda3), vgextend, then lvextend to increase my root lv to 100% of the free space, and finally resize2fs for lv_root.
Now, I have 2 exactly same machines, but at the end I get different results concerning the lv_root size. Please see the screenshot below.
Can anyone please explain to me what's happening?
edit: Sorry for the screenshot, but because there is too much text output I found it more clear to have it like this.
My vgs output on the second machine
[root@ddsl-e012 ~]# vgs
VG #PV #LV #SN Attr VSize VFree
vg_ddsle012 2 2 0 wz--n- 99.47g 18.50g
On the first it shows no free space. I followed both times the same procedure. Why in the second time when I did a vgextend (vgextend vg_ddsle012 /dev/sda3) didn't allocate the whole space and how can I fix it now?
|
Ok, it seems that during my lvextend on the second machine I had forgotten the "+" sign. So, instead of
lvextend -l +100%FREE /dev/mapper/vg_ddsle012-lv_root
I've written
lvextend -l 100%FREE /dev/mapper/vg_ddsle012-lv_root
so the space wasn't added to the actual size of the logical volume.
| Innacurate lv_root size after extend |
1,460,556,349,000 |
I have a Linux Mint 17.1 Partition at /dev/sda1 and another Mint 17.1 Partition at /dev/sda5. How do I set the MBR to boot into /dev/sda1 instead of the GRUB menu? I know how to use GParted to delete the /dev/sda5 partition but not how to set the MBR.
|
Grub is a piece of software that is installed in the MBR.
Delete sda5 and run grub-update or change grub config manually to boot from sda1, Maybe this howto can help you.
http://www.techsupportforum.com/357-how-to-configure-grub-bootloader-in-mint-linuxubuntu/
If grub is installed on sda u can change the grub config to boot from sda1.
If not try to install grub on sda.
$sudo grub-install /dev/sda
$sudo update-grub
If grub-install gives problems, you can install manually from the Grub shell with:
grub
root (hd0,0)
setup (hd0)
quit
| How to set MBR to Linux Partition instead of GRUB |
1,460,556,349,000 |
I have windows 7 as my primary is .
Now I would like to install kubuntu here is what I get in the disk setup
What should I do to use dual boot??
Manual option doesn't do anything!!
|
You should be able to move forward after choosing the Manual option by hitting Next, which should open a UI to do your own disk formatting.
Once there you should be able to create new partitions in the 'free space'.
If you can get that far, you have to decide how you want to partition the disk. Personally I use the following scheme which contains 4 separate partitions (ESP, /, swap, /home), but it really depends on how flexible you want to be. Note that this is for EFI machines, hence the ESP partition. If you have a BIOS machine, you can use a normal /boot partition which you can find tons of info about on the web:
Partition 1 - ESP: This is the EFI System Partition which holds the boot loader as well as any other bootup related files. It should be in a FAT format (I use FAT32). Look up what the recommended size should be for Kubuntu as I am not familiar.
Partition 2 - /: This is the root partition and should be mounted at the / directory. It is common to use the ext4 as the file system for this partition. This partition is the root of all other directories and will contain all of the OS files that are initially installed on your system as well as additional packages and applications you add later on. The size of this is up to you, but it is easy to find recommended sizes for your given OS. For example, my XFCE Debian system recommends 10GB.
Partition 3 - swap: This is the swap partition and is used when the system is out of use-able RAM. Initially it was common to make this partition 2x the amount of RAM you have, so if you have 2GB of RAM, make this partition 4GB. As RAM size goes up though, it becomes overkill to double it. On my system with 8GB of RAM, I use an 8GB swap space which should be plenty. You can find tons of info on recommended swap size on the web.
Partition 4 - /home: This is the home partition and should be mounted at /home. It can be used to hold all of the additional files you want to store (Photos, Docs, etc). It is common to use the ext4 as the file system for this partition. The size is really up to you. You can always shrink/grow any of these in the future, so dont go crazy deciding on sizes.
Note that the above partition scheme I mentioned is totally optional. Is is possible to have a single / partition and put everything there. Personally I do not like to, because if you ever want to reinstall or share your /home directory with another OS.. having it on its own partition makes it really simple.
You can also go the other direction and make even more partitions for /usr, /var, etc. I wont go into why you should or shouldnt do that here.
If you go with the Guided option, it appears as though it will attempt to format and use the entire disk, which is not what you want if you intend to preserve the Windows installation.
| trying to dual boot kubuntu with windows 7 |
1,460,556,349,000 |
I have installed Ubunto 14.04 on sda1. but after the installation finished, all the partitions are gone . I have important data on sda5 , and when I run the following command : sudo fdisk -l in the terminal the following appears :
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x000cf11e
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 499711 248832 83 Linux
/dev/sda2 501758 976771071 488134657 5 Extended
Partition 2 does not start on physical sector boundary.
/dev/sda5 501760 976771071 488134656 8e Linux LVM
Disk /dev/mapper/ubuntu--vg-root: 495.6 GB, 495594766336 bytes 255
heads, 63 sectors/track, 60252 cylinders, total 967958528 sectors
Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical):
512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096
bytes Disk identifier: 0x00000000
Disk /dev/mapper/ubuntu--vg-root doesn't contain a valid partition
table
Disk /dev/mapper/ubuntu--vg-swap_1: 4202 MB, 4202692608 bytes 255
heads, 63 sectors/track, 510 cylinders, total 8208384 sectors Units =
sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512
bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/ubuntu--vg-swap_1 doesn't contain a valid partition
table
The total size of the hard drive is 5oo GB
|
I have used "TestDisk" program to retrieve the lost partition, and it worked like magic
| hard drive formatted while Linux setup, lost partitions |
1,460,556,349,000 |
I'd like to be able to have multiple distributions, say Fedora and Debian, both sharing an Apache DocumentRoot. For example, I could have the same partition mounted to /var/www in both distributions. I can't find any examples of others doing this, so perhaps its unwise.
What are some negative consequences of doing this? Is there a different way to achieve the same goal?
|
As long as this is for the static files to save space you will be fine.
If you have programs under /var/www (e.g. using WSGIScriptAlias) I suggest you separate these out to physical locations outside of /var/www on a machine by machine basis. The distributions often differ in subtle ways that need to be reflected in your programs.
You will most likekly have to do such separation if the programs save data in some (sub-director) of the program location.
| Sharing Apache-httpd documents across multiple Linux distributions? |
1,398,533,984,000 |
I intend to re-install Fedora 20 on a new computer as I am having a lot of trouble with the installation done by the vendor of the computer. It is a dual boot machine with a small Windows XP3 partition for things I cannot do in Linux (mainly proprietary software for electronic devices)
It may be my fault fumbling things that has caused the problems, but anyway I want to re-install it from the official DVD. My question is: can I just accept the automatic partitioning, will it preserve the existing partitions, and will the dual boot Grub still work?
I have no data stored on the new machine: all that was backed up on separate hard drives from the old one, and I have done no permanent work on the new one.
|
After a lot of frustration I decide to try a well-established version of Fedora instead of the newly released 20 installed by my computer supplier. I have now installed version 17, and, so far, all the problems seem to have been solved. I can now use yum with no trouble. I also was apparently missing a lot of the software, like gnuplot and ghostscript. I suspect that the installer of Fedora 20 had not included the software developer's repositories.
In this installation process I had the option to replace the existing Linux, and that took care of the partitioning doubts.
So, now my question is answered, and I have, fingers crossed, upgraded from Fedora 12 to a decent working Fedora again.
| Re-installing Fedora 20: are automatic partitions safe to use? |
1,398,533,984,000 |
man resize2fs says
The resize2fs program will resize ext2, ext3, or ext4 file systems. It can be used to enlarge or
shrink an unmounted file system located on device. ...
The size parameter specifies the requested new size of the filesystem
How do you choose a size parameter to specify to resize2fs? More specifically:
How is the size of a filesystem defined?
Does it count external fragmentation and/or internal fragmentation?
If it doesn't count external fragmentation but counts internal fragmentation, the size of a filesystem should be the same, as long as resize2fs doesn't modify or remove the existing files.
Does it count the space for storing inodes and the space for root usage, such as defragmentation?
Do df's and gparted's "used" columns show the size of each file system? Can the "used" numbers be used for choosing a size parameter for resize2fs? Note that df's and gparted's "used" columns show different used numbers for the same partition, and not sure why.
Thanks.
|
The size of a file system, as used for resize2fs (and mke2fs and other similar tools) is the external size of the file system, i.e. the amount of space it occupies as viewed from the outside. The internal data structures of the file system don’t matter here. Everything in the file system — metadata, data, and unused space within the file system — fits within the file system’s size. This also includes any boot loader hosted in the same partition as the file system, where such a configuration is possible (it is with Ext2/3/4, not with XFS, for example).
The best way to determine the current size of a file system is to read it from the file system; for example, for ext2/3/4 file systems, you’d multiply the block count by the block size:
dumpe2fs -h /path/to/file/system | grep -E 'Block (count|size):'
By default, the size of a file system is usually the size of its container, e.g. its containing partition or logical volume. This is the value that resize2fs will use if you don’t specify a size explicitly. Specifying size is useful when you want to shrink a file system and its container: you’d start by running resize2fs with the target size, and then shrink the container (partition, logical volume, etc.) to match.
To determine the minimum size to which you can shrink a file system, the best approach is to use resize2fs itself:
resize2fs -M -P /path/to/file/system
will tell you how many blocks a minimal file system would occupy (preserving all the current contents); to determine the block size used, run
dumpe2fs -h /path/to/file/system | grep Block\ size
You can get the details of the calculation by adding -d 32:
resize2fs -d 32 -M -P /path/to/file/system
The maximum size of a file system is usually the size of its container (partition or logical volume). A file system which is in a partition or logical volume can never be bigger than the partition or logical volume; there can be additional constraints which limit the extent to which a file system can grow. (File systems stored in image files behave differently, resize2fs changes the file size to match the file system size, whether growing or shrinking.)
| How is the size of a filesystem defined? |
1,398,533,984,000 |
I need to partition an external HD, with FAT32.
Once upon a time, fdisk listed its possible partition types in a different, clearer way.
The nearest entries now seem to be
10 Microsoft reserved E3C9E316-0B5C-4DB8-817D-F92DF00215AE
11 Microsoft basic data EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
12 Microsoft LDM metadata 5808C8AA-7E8F-42E0-85D2-E1E90434CFB3
13 Microsoft LDM data AF9B60A0-1431-4F62-BC68-3311714A69AD
but I'm not clear about the difference.
|
Since you’re partitioning a disk with a GUID partition table, fdisk shows you partition type GUIDs which are appropriate in that context, rather than the MBR partition types you’re used to.
In this particular case, you should choose type 11, “Microsoft basic data”.
| Partitioning with MS-DOS type |
1,398,533,984,000 |
I would like to create virtual volume (partition) on my disk. I use VPS and I cannot shrink root partition and create new one.
So I decided to create a virtual volume on disk, let's say that I want to create virtual volume with size of 12 GB, how can I do it?
Next, is possible to automatically mount it after every reboot? How?
I wonder is there is any performance drop between real partition and virtual volume (like latency, etc..).
I use Debian 9 with ext4 file system.
Update:
I cannot shrink parition, because I cannot mount livecd (rescue disk), because my hosting provider has no option for it. So then i cannot boot into livecd to unmount filesystem to make changes to partitions.
i want that "partition", because in that partition users will be able to upload (using web app) some files, and I would like to limit size of that space/partition for example to 12 GB, so it never take more than 12 GB.
Update 2:
After running fallocate -l 7G dummy (to create big dummy file) inside mounted device and df -h:
Filesystem Size Used Avail Use% Mounted on
udev 485M 0 485M 0% /dev
tmpfs 100M 6.8M 93M 7% /run
/dev/mapper/vg-lv_root 19G 1.2G 17G 7% /
tmpfs 496M 0 496M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 496M 0 496M 0% /sys/fs/cgroup
/dev/sda1 236M 37M 187M 17% /boot
/dev/loop0 12G 7.1G 3.9G 65% /srv/data
tmpfs 100M 0 100M 0% /run/user/0
You can see, that it is mounted and it shows used space in /srv/data, but I wonder why it doesn't show used space on root partition (I have 20 GB SSD from provider, but df -h shows that I have 32 GB (20 GB root and 12 GB mounted device). How can I see "real" used space in root partition? Because in root directory I have that data.img which has size of 12 GB, but it doesn't count as used space, df -h showed used space, but after running mkfs.ext4 it doesn't show anymore, do you understand me? :)
Another question: Should I run dd if=/dev/zero of=data.img bs=1M count=12000 command?
|
Here's how to create a 12GB ext4 disk image which you can then mount automatically upon boot:
Create the image file: fallocate -l 12G /path/to/image.img
Create the filesystem in the file: mkfs.ext4 /path/to/image.img
Mount the filesystem automatically: echo "/path/to/image.img /srv/data ext4 defaults,auto,loop 0 0" >>/etc/fstab
| How to set up virtual volume (parition/disk) [closed] |
1,398,533,984,000 |
The rhel-8.10-x86_64-dvd.iso to install from which is 14GB in size.
For a usb device (i.e. disk) that would show up in Linux as /dev/sdb for example, doing a cp rhel-8.10-x86_64-dvd.iso /dev/sdb results in an msdos partition scheme on that usb device which is bootable and allows you to install Linux.
I suspect they use the msdos partition scheme to maintain functionality with older hardware that pre-dates EFI
The msdos partition scheme has a 2TB limit, and poses an inconvenience when I have a 4+ TB usb disk that I want to use simultaneously for being able to install Linux from (which needs < 15GB of space on the device) and also make use of the remaining 4+ TB of the device and not be limited to a 2TB msdos partition.
So the solution seems to be to format the 4+ TB usb device with a GUID partition table i.e. GPT, where I can make one 4+ TB XFS partition on it but also convert or transfer the contents from the unpacked rhel-8.10-x86_64-dvd.iso to the GPT formatted device... and then marking that one (iso9660?) partition containing the Linux install content from the iso as bootable?
The contents of the unpacked rhel-8.10-x86_64-dvd.iso is
<folder> [BOOT]
<folder> AppStream
<folder> BaseOS
<folder> EFI
<folder> images
<folder> isolinux
.discinfo
.treeinfo
EULA
extra_files.json
GPL
media.repo
RPM-GPG-KEY-redhat-beta
RPM-GPG-KEY-redhat-release
TRANS.TBL
is there a way for what I have described to manually do this Linux to make a usb device bootable (using parted or fdisk or some other) ? If so how? Or is there a way with some free software under microsoft windows?
|
Instead of trying to extract the ISO image’s contents and manually build a working USB key, I would use Ventoy. This allows you to create a generic bootable key; then you add ISO images to it (as files stored on the key), and booting with the key gives you a menu to choose the image you actually want to boot from.
You can store any files you want alongside the boot images, or in directories.
Ventoy is available for Windows as well as Linux.
| creating a bootable usb with GPT partition scheme to make use of linux .iso |
1,398,533,984,000 |
I'm on Solaris 11, disk using EFI and GPT but with classical bios
0 BIOS_boot wm 256 260.00MB 532735
1 usr wm 532736 5.46TB 11721028750
2 unassigned wm 0 0 0
3 unassigned wm 0 0 0
4 unassigned wm 0 0 0
5 unassigned wm 0 0 0
6 unassigned wm 0 0 0
8 reserved wm 11721028751 8.00MB 11721045134
Are 532735 11721028750 and 11721045134 extents or cylinders?
When I change the numbers solaris ask to choose between b (blocks?) dimensions (gb,tb,mb..) and e(?).
Why are the called e and not c?
Thanks
|
If you use prtvtoc you will see the header of the table (for reference here):
example# prtvtoc /dev/rdsk/c0t3d0s2
* /dev/rdsk/c0t3d0s2 partition map
*
* Dimension:
* 512 bytes/sector
* 80 sectors/track
* 9 tracks/cylinder
* 720 sectors/cylinder
* 2500 cylinders
* 1151 accessible cylinders
*
* Flags:
* 1: unmountable
* 10: read-only
* * First Sector Last
* Partition Tag Flags Sector Count Sector Mount Directory
0 2 00 0 76320 76319 /
1 3 01 76320 132480 208799
2 5 00 0 828720 828719
5 6 00 208800 131760 340559 /opt
6 4 00 340560 447120 787679 /usr
7 8 00 787680 41040 828719 /export/home
So you see these are start and end sector.
For the record the block size in Solaris is 512 bytes so the command df will give you the size in blocks, not like in Linux.
| What are b and e in Solaris paritioning? |
1,398,533,984,000 |
I found many related questions and answers like this or guides like this but most of them didn't want to do exactly what I want and I am feeling quite insecure and am afraid of doing something wrong.
This is my setup (running lsblk):
sdb 8:16 0 111.8G 0 disk
├─sdb1 8:17 0 300M 0 part /boot
└─sdb2 8:18 0 111.5G 0 part
└─main 254:0 0 111.5G 0 crypt
├─main-root 254:1 0 25G 0 lvm /
├─main-swap 254:2 0 6G 0 lvm [SWAP]
└─main-home 254:3 0 80.5G 0 lvm /home
What I want to achieve: I want to reduce the main-home partition by 15GB and enlarge the main-root partition by these 15GB. So I don't need to change the size of the crypt main. I just want to change the two underlying root and home partitions.
Can anyone give tell me what steps I need to do, to achieve this?
Additional Info: I don't think that it is relevant, but I got two other HDD's that get encrypted on boot. fdisk says about them:
Disk /dev/sda: 931.53 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: ST31000333AS
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 94BFBB4A-0DC9-4D29-8EB4-E0F5FB6E3CF5
Disk /dev/mapper/data: 931.52 GiB, 1000200994816 bytes, 1953517568 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/sdd: 1.84 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: WDC WD20EZRZ-00Z
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/mapper/data2: 1.84 TiB, 2000382156800 bytes, 3906996400 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
|
Assuming you're using a filesytem which can be reduced in size (such as ext4), you can take space from /home and reallocate it to / as follows:
Unmount /home. This means you'll need to log out all users and log in as root: umount /home
Resize /home: lvreduce -L -50G -r main/home
Resize /: lvresize -L +50G -r main/root
Re-mount /home: mount /home
| How to resize LVM |
1,398,533,984,000 |
I have a server with two disks (each with a single ext4 partition):
lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 223.6G 0 disk
└─sda1 8:1 0 223.6G 0 part /
sdb 8:16 0 223.6G 0 disk
└─sdb1 8:17 0 223.6G 0 part /data
sda disk's partition has bootable Linux (Fedora).
I used WoeUSB to write a Windows Server 2016 ISO on sdb, as NTFS filesystem. I'm able to boot from it, run the Windows setup, remove & format the sda partition during the setup, and install Windows on sda.
But after the installation, booting from the sda disk (now with Windows) doesn't work. It shows an error:
error: ../../grub-core/kern/fs.c:120:unknown filesystem.
Entering rescue mode...
grub rescue > _
My guess is that the sda disk still has the old Linux MBR, due to which it doesn't boot.
How can I fix this so that Windows can boot from sda, and even better, replace grub altogether with Windows bootloader (which I assumed the Windows setup would do when I deleted its partition and formatted it)?
|
Your guess about Linux MBR (or technically GRUB) on sda appears correct.
Boot from the Windows installation media, and press Shift+F10 to get a Command Prompt, or select your language/keyboard preferences in the first screen, click Next, and then click Repair your Computer. From there you should gain access to a Command Prompt.
In Command Prompt, you can use bootrec /fixmbr.
Alternatively, find the drive letter associated with sda (I assume it will be C: here) and use:
bootsect /nt60 C: /mbr
| Fix MBR after installing Windows on Linux partition |
1,398,533,984,000 |
I have recently installed Kali Linux along with my Windows installation, but I found out I messed up on the amount of storage space I have allocated. As you can see in this image, I still have 230 GB of unallocated space left, and I would like to allocate half of this to Kali, and the other half to Windows.
My question is, how do I allocate more storage to Kali without reinstalling?
|
There is no need to modify the partitioning you already have.
Use Gparted to create a new ext4 partition from the unallocated space (probably /dev/sda11 judging from your picture)
Create a mount point (directory)
mkdir /media/youruserame/whateveryouwant
Insert a new item in /etc/fstab so that this mounts at all future boots
/dev/sda11 /media/youruserame/whateveryouwant ext4 defaults 0 2
Then just mount with
sudo mount -a
All of the unallocated space is now available to you.
Since /dev/sda4 is your Windows installation, if you format the partition as ntfs rather than ext4 (and make the change in fstab too) then all the data on this partition will be available to you in Linux and Windows.
| How to allocate more storage space to kali linux? |
1,398,533,984,000 |
The USB partitions were deleted, only sdb remained. sdb1 does not exist. How do I partition the USB again? Now it shows up in the lsblk output, but I can't mount it.
[xx@x ~]$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 465.8G 0 disk
├─sda1 8:1 0 500M 0 part /boot
├─sda2 8:2 0 8G 0 part [SWAP]
└─sda3 8:3 0 457.3G 0 part /
sdb 8:16 1 7.2G 0 disk
sr0 11:0 1 1024M 0 rom
[xx@x ~]$ sudo fdisk /dev/sdb
Welcome to fdisk (util-linux 2.39).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
When I plug in the normal working usb sudo fdisk /dev/sdb
When I run the command, the commands I can use appear. For example the m command works.
The n command is not used. When fdisk /dev/sdb runs, it gives an input/output error after a certain time.
fdisk: cannot open /dev/sdb: Input/Output error
dmesg:
[10846.218694] I/O error, dev sdb, sector 60864 op 0x1:(WRITE) flags 0x104000 phys_seg 30 prio class 2
[10846.218706] buffer_io_error: 7 callbacks suppressed
[10846.218710] Buffer I/O error on dev sdb, logical block 7608, lost async page write
[10846.218726] Buffer I/O error on dev sdb, logical block 7609, lost async page write
[10846.218733] Buffer I/O error on dev sdb, logical block 7610, lost async page write
[10846.218739] Buffer I/O error on dev sdb, logical block 7611, lost async page write
[10846.218744] Buffer I/O error on dev sdb, logical block 7612, lost async page write
[10846.218750] Buffer I/O error on dev sdb, logical block 7613, lost async page write
[10846.218754] Buffer I/O error on dev sdb, logical block 7614, lost async page write
[10846.218760] Buffer I/O error on dev sdb, logical block 7615, lost async page write
[10846.218765] Buffer I/O error on dev sdb, logical block 7616, lost async page write
[10846.218769] Buffer I/O error on dev sdb, logical block 7617, lost async page write
[10852.869745] usb 3-2: reset high-speed USB device number 2 using xhci_hcd
[10859.734626] usb 3-2: reset high-speed USB device number 2 using xhci_hcd
when first hooked up:
[12538.293232] usb 3-2: New USB device found, idVendor=0930, idProduct=6544, bcdDevice= 1.00
[12538.293246] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[12538.293250] usb 3-2: Product: TransMemory
[12538.293253] usb 3-2: Manufacturer: TOSHIBA
[12538.293256] usb 3-2: SerialNumber: 307135823CDACE709B1D1E25
[12538.294235] usb-storage 3-2:1.0: USB Mass Storage device detected
[12538.294463] scsi host6: usb-storage 3-2:1.0
[12539.489418] scsi 6:0:0:0: Direct-Access TOSHIBA TransMemory 1.00 PQ: 0 ANSI: 4
[12539.490125] sd 6:0:0:0: [sdb] 15148608 512-byte logical blocks: (7.76 GB/7.22 GiB)
[12539.490389] sd 6:0:0:0: [sdb] Write Protect is off
[12539.490398] sd 6:0:0:0: [sdb] Mode Sense: 45 00 00 00
[12539.490643] sd 6:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
|
As seen in your dmesg output:
[10846.218694] I/O error, dev sdb, sector 60864 op 0x1:(WRITE) flags 0x104000 phys_seg 30 prio class 2
[10846.218706] buffer_io_error: 7 callbacks suppressed
[10846.218710] Buffer I/O error on dev sdb, logical block 7608, lost async page write
...
There is something physically wrong with this USB disk. No way around it.
If you need recovery, you would have to ask for some professional service around.
| USB disk partitions disappeared, cannot mount |
1,398,533,984,000 |
I am looking for a way to backup one filesystem by borg and I do
not want it to following mount points to another partitions.
A mechanism like the flag -x in rsync.
I feel that I missed something from the documentation
--udi
|
borg create supports an -x flag which limits the backup to a single file system.
| How to avoid borg to cross filesystem boundaries |
1,398,533,984,000 |
I am running a debian server on Windows in Hyper-V, I have expanded the Hyper-V partition to 2T, now I would like to expand the Debian partition to use that new space. The new space will be for videos, so I am thinking the easiest thing to do is simply create a new partition and mount that and save the video in the partition. I am running from the cmd line, so I need some assistence in creating the partition. I have both fdisk and parted install. Here is the current state of things:
Disk /dev/sda: 2 TiB, 2199023255552 bytes, 4294967296 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x8427e4f2
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 499711 497664 243M 83 Linux
/dev/sda2 501758 266336255 265834498 126.8G 5 Extended
/dev/sda5 501760 266336255 265834496 126.8G 8e Linux LVM
Partition 2 does not start on physical sector boundary.
Disk /dev/mapper/UniFiServer--vg-root: 124.8 GiB, 133957681152 bytes, 261636096 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/mapper/UniFiServer--vg-swap_1: 2 GiB, 2147483648 bytes, 4194304 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
I have made some progress, it appears that I succeeded in using parted to actually extend /dev/sda2 & /dev/sda5 and with the help of Romeo, used pvresize to extend them to show 2T, now I just need some help on actually creating something I can use, the lvcreate command isn't working:
Disk /dev/sda: 2 TiB, 2199023255552 bytes, 4294967296 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x8427e4f2
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 499711 497664 243M 83 Linux
/dev/sda2 501758 4294921875 4294420118 2T 5 Extended
/dev/sda5 501760 4294921875 4294420116 2T 8e Linux LVM
Partition 2 does not start on physical sector boundary.
Disk /dev/mapper/UniFiServer--vg-root: 124.8 GiB, 133957681152 bytes, 261636096 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/mapper/UniFiServer--vg-swap_1: 2 GiB, 2147483648 bytes, 4194304 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
$ sudo vgs
VG #PV #LV #SN Attr VSize VFree
UniFiServer-vg 1 2 0 wz--n- 2.00t 1.88t
$ sudo lvcreate -L 1.88t --name videodata UniFiServer--vg
Volume group "UniFiServer--vg" not found
Cannot process volume group UniFiServer--vg
|
You should run pvresize to extend the PV
pvresize /dev/sda5
Then you can check the new size of VG
vgs
Then you can create new LV
lvcreate -L <size of the new volume> --name <name of volume> UniFiServer-vg
Then you should format and mount this new volume. And do not forget to edit /etcfstab to mount it on every boot
| creating space for data with fdisk |
1,467,746,567,000 |
I'm curious if it's possible to store disk partition tables on different device and load it from grub
Edit:
Lets say i have disk formated like this:
normally post load mbr (disk 1) and starting up,
system sees only 3 partition and unallocated space
but im wonder if its possible to make different scenario.
Lets say I have data tables of this disk which look like this:
and what i wants to do here is load this alternative partition tables from another drive (this drive will also had grub installed on it)
instead of those which are on disk (without replacing them) and start os from it.
|
So you're trying to hide a second OS into what looks like unpartitioned space? Not a very secure method, as e.g. running testdisk on the disk will detect the partitions and offer to add them to the real partition table. I would expect any forensic tools to also quickly detect that the "unallocated space" seems to have some structured content within it.
But sure, it might pass a casual examination.
I don't think GRUB could do this easily, but if the external boot drive can also have the kernel and the initramfs file on it, then you could do it pretty easily within initramfs: create a table of mappings (basically a name + starting block number + length) for the hidden partitions, use dmsetup create to load the mappings, then have the initramfs mount e.g. /dev/mapper/hidden_root as a root filesystem, then let the boot proceed essentially normally, but mounting /dev/mapper/hidden_other and using /dev/mapper/hidden_swap as a swap partition if needed.
To load the mapping for each hidden partition, you would run a command like this:
dmsetup create <name> --table "0 <length in blocks> linear <disk major:minor> <first block #>"
<disk major:minor> would be the major and minor numbers of the disk device that contains the hidden partitions, e.g. 8:0 for /dev/sda.
If your first hidden partition was named hidden_root, the command for mapping it it would look something like this:
dmsetup create hidden_root --table "0 4236248 linear 8:0 952190894"
Essentially this means: "map a linear stretch of disk /dev/sda starting from block# 952190894 onwards, and present it as blocks 0..4236248 of /dev/mapper/hidden_root."
Even if you could have GRUB read an alternate partition table, you would have to do the above in initramfs anyway, because the Linux kernel won't rely on what the firmware tells it, but instead will read the partition table on its own to find any partitions.
| Partition table on nother device |
1,467,746,567,000 |
I have a problem with my root partition. I use Ubuntu distribution with Parrot Distro. I dual boot Kali on top of Windows 10. My storage is 250gb. I manually partitioned at first installing the OS. 240gb for is ext4 mounted on root, and 10gb left is for swap area.
And now is the real problem. I didn't install any software. But after running several command, my root partition available size is decreasing. It happens every time. I have tried many ways but it can't solve my problem.
Please I need help. And thank you before.
|
Oh, this been a while. So the problem is in my Wireless Wi-Fi adapter using TP-Link TL-WN881ND that isn't compatible. So the kernel keeps printing a log message. So that's the cause of root partition is full.
| Root partition available size decreasing after running several command in terminal |
1,467,746,567,000 |
So I have a Kubuntu installation on my USB but the problem was that I formatted/split the disk space wrongly. This caused my Linux installation to have almost no disk space to use while my leftover disk space is wasted to my "USB storage" partition that I don't really use.
So I was wondering what is the best way to reformat the sdb1 partition so that I can use as extra space for my sdb2 partition.
|
Moving the partitions is going to be a substantial pain in the nether regions. The problem here is how does boot happen. I suspect that is the SDB5 512 meg area's doing. There is also probably some boot code that tells the system to start from sdb5.
But this means that something in that boot block "knows" that the Linux install is in sdb6, so you don't dare change that.
Easiest way out (two USB devices)
Get a new USB key and plug both. Boot from Linux. Format the new USB key the same way but with "better" partitions. Then copy your data from the old key to the new key. Verify that it works. You're done!
What you can do (with only one USB device)
Linux has, as you probably know, mount points! You can mix and match those! So:
MAKE A BACKUP OF ANYTHING IMPORTANT
boot in Linux and log in as root in single ("recovery") mode
destroy the content of sdb1 partition by reformatting it as ext4:
mkfs.ext4 /dev/sdb1
now inspect your Linux installation and see what is taking up space:
du -sk /* 2>/dev/null | sort -n
On my test system I have for example (after several seconds of disk scanning):
...smaller fry removed...
12220 /run
13320 /sbin
18992 /etc
125244 /boot
873108 /home
873324 /lib
1154900 /opt
1537488 /root
4648100 /usr
15088048 /var
So I mostly use my system for /var. Perfect. I'll move /var.
mount the newly formatted sdb1 onto /mnt
mount /dev/sdb1 /mnt
copy "/var" onto "/mnt" (so, check that you have rsync installed before even starting)
rsync -a /var /mnt
now (this is what should be done in "single mode", text mode boot, with all service stopped; chances are that you won't even be able to do it otherwise)
mv /var /oldvar # So you can go back if needed, restoring oldvar to var
recreate a new /var
mkdir /var
Check permission on oldvar and replicate them on the new /var
add a line with sdb1 to the mount point list in /etc/fstab:
echo "/dev/sdb1 /var ext4 auto 0 2" >> /etc/fstab
Now every time you boot, the sdb1 partition will be linked to /var, and you will be able to store up to 17 GiB of data on that.
If you now reboot, everything should work as before, you'll see a full /var, and no free space at all on sdb6 since it's being taken up by oldvar. Check thoroughly that everything works. When you're sure, delete the oldvar directory and all its subdirectories.
NOTE: my example used /var. You might see you need to move /home instead. Same thing. Or you can go deeper than one level and see what is taking up space inside /var:
du -sk /var/* 2> /dev/null | sort -n
and in my case I see that it's /var/www that takes up 90% of the space. So I don't need to relocate the whole of /var, I can do the steps above using "/var/www" and still reap 90% of the benefits. Also now I don't need logging in into single mode or to reboot because on my system /var/www is surely only used by the Apache HTTP server, which I can stop and restart without rebooting (while /var/log, /var/run, /var/mail etc. might be in use and require single mode):
apache2ctl stop
rsync -a /var/www /mnt
mv /var/www /var/oldwww
mkdir /var/www
# Set up the same ownership and permissions of the old /var/www
chown www-data:users /var/www
chmod 775 /var/www
# Compare the two ls lines
ls -la /var | grep www
# If ownership and pemissions are OK go on
echo "/dev/sdb1 /var/www ext4 auto 0 2" >> /etc/fstab
# Free up sdb1 from mnt
umount /mnt
# Check whether the automount from fstab works
mount /var/www
# Now everything is as before, www is there and useable, it's just on sdb1.
apache2ctl start
# Now verify everything works again. IF it works, oldwww is useless.
rm -rf /var/oldwww # kill the original www
(I could also have created straight on the new /var/www, mounted it, and rsynced oldww to www, without involving /mnt at all).
| Merge two partitions from different dev/sdb on USB |
1,467,746,567,000 |
After trying to execute the command apt upgrade from the terminal, I received the following error:
E: You don't have enough free space in /var/cache/apt/archives/.
Not quite sure what to do about it. I also checked my disk storage to be safe, and everything is normal except my boot drive and loop0 directory, shown below:
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sdb1 0 0 0 - /lib/live/mount/persistence/sdb1
/dev/loop0 350450 350450 0 100% /lib/live/mount/rootfs/filesystem.sq
Currently trying to use cfdisk command to resize disk drives to compensate.
|
This should be because of unused packages.
sudo apt-get autoclean
This will delete all packages not currently installed. If that doesn't free up enough space, then use
sudo apt-get clean
This will clear out all .debs downloaded and/or installed.
Or you can increase the size limit.
| Disk management issue [duplicate] |
1,467,746,567,000 |
So I recently moved around the Linux swap partition and resized the root partition of my Parrot installation on my hard disk to increase available space. After applying the edits with GParted I haven't been able to boot with a graphical interface. Instead after initializing the screen turns black with a blinking cursor in the top left corner. From what I presume, this is associated with an error in GRUB. For the past two weeks, I've looked at various options over how to deal with the problem, but have found no solution. After getting a shell with Ctrl+Alt+F1, I've ran update scripts with apt-get, grub, and initramfs. There is also a possible error having to do with the segmentation of arrays. Long story short I was also experiencing failure in one of my SATA cables connecting to my CDROM drive. After replacing it, the ata1: error: messages no longer appeared, along with the mdadm: No arrays found in config file or automatically, however after running the bootinfoscript as suggested by various sources, the issue still persists. I'm at a loss here as I've tried various ideas yet have seen no results.
Here are some resources for the issue:
bootinfoscript:
Boot Info Script 0.76 [13 April 2017]
Identifying MBRs...
Computing Partition Table of /dev/sda...
Searching sda1 for information...
Searching sda2 for information...
Searching sda4 for information...
Boot Info Script 0.76 [13 April 2017]
============================= Boot Info Summary: ===============================
=> Grub2 (v2.00) is installed in the MBR of /dev/sda and looks at sector 1 of
the same hard drive for core.img. core.img is at this location and looks
for (,msdos1)/boot/grub. It also embeds following components:
modules
---------------------------------------------------------------------------
fshelp ext2 part_msdos biosdisk
---------------------------------------------------------------------------
sda1: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Parrot GNU/Linux 4.0
Boot files: /boot/grub/grub.cfg /etc/fstab
/boot/grub/i386-pc/core.img
sda2: __________________________________________________________________________
File system: swap
Boot sector type: -
Boot sector info:
sda4: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System:
Boot files:
============================ Drive/Partition Info: =============================
Drive: sda _____________________________________________________________________
Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Partition Boot Start Sector End Sector # of Sectors Id System
/dev/sda1 * 2,048 697,952,255 697,950,208 83 Linux
/dev/sda2 697,952,256 697,972,735 20,480 82 Linux swap / Solaris
/dev/sda4 1,748,725,760 1,953,525,167 204,799,408 83 Linux
"blkid" output: ________________________________________________________________
Device UUID TYPE LABEL
/dev/sda1 b7ff9eea-13c4-4b30-8104-b41cc3258364 ext4
/dev/sda2 bff285cd-4db4-4ad7-8656-e86cf811808e swap
/dev/sda4 8583fa2e-35fe-4064-a277-201e72982afc ext4
========================= "ls -l /dev/disk/by-id" output: ======================
total 0
lrwxrwxrwx 1 root root 9 Jun 3 01:37 ata-ASUS_DRW-24F1ST_a_S10K68EF300420 -> ../../sr0
lrwxrwxrwx 1 root root 9 Jun 3 01:37 ata-TOSHIBA_DT01ACA100_Y3GYH74NS -> ../../sda
lrwxrwxrwx 1 root root 10 Jun 3 01:37 ata-TOSHIBA_DT01ACA100_Y3GYH74NS-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Jun 3 01:37 ata-TOSHIBA_DT01ACA100_Y3GYH74NS-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Jun 3 01:37 ata-TOSHIBA_DT01ACA100_Y3GYH74NS-part4 -> ../../sda4
lrwxrwxrwx 1 root root 9 Jun 3 01:37 wwn-0x5000039ff7cd67ef -> ../../sda
lrwxrwxrwx 1 root root 10 Jun 3 01:37 wwn-0x5000039ff7cd67ef-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Jun 3 01:37 wwn-0x5000039ff7cd67ef-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Jun 3 01:37 wwn-0x5000039ff7cd67ef-part4 -> ../../sda4
================================ Mount points: =================================
Device Mount_Point Type Options
/dev/sda1 / ext4 (rw,relatime,errors=remount-ro,data=ordered)
/dev/sda1 /var/lib/docker/overlay2 ext4 (rw,relatime,errors=remount-ro,data=ordered)
/dev/sda1 /var/lib/docker/plugins ext4 (rw,relatime,errors=remount-ro,data=ordered)
=========================== sda1/boot/grub/grub.cfg: ===========================
--------------------------------------------------------------------------------
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
if [ "${next_entry}" ] ; then
set default="${next_entry}"
set next_entry=
save_env next_entry
set boot_once=true
else
set default="0"
fi
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi
export menuentry_id_option
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}
function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}
if [ x$feature_default_font_path = xy ] ; then
font=unicode
else
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 b7ff9eea-13c4-4b30-8104-b41cc3258364
else
search --no-floppy --fs-uuid --set=root b7ff9eea-13c4-4b30-8104-b41cc3258364
fi
font="/usr/share/grub/unicode.pf2"
fi
if loadfont $font ; then
set gfxmode=auto
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=C
insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
set timeout=30
else
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=menu
set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
set timeout=5
fi
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 b7ff9eea-13c4-4b30-8104-b41cc3258364
else
search --no-floppy --fs-uuid --set=root b7ff9eea-13c4-4b30-8104-b41cc3258364
fi
insmod png
if background_image /usr/share/desktop-base/parrot-theme/grub/grub-4x3.png; then
true
else
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
fi
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
set gfxpayload="${1}"
}
set linux_gfx_mode=
export linux_gfx_mode
menuentry 'Parrot GNU/Linux' --class parrot --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-b7ff9eea-13c4-4b30-8104-b41cc3258364' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 b7ff9eea-13c4-4b30-8104-b41cc3258364
else
search --no-floppy --fs-uuid --set=root b7ff9eea-13c4-4b30-8104-b41cc3258364
fi
echo 'Loading Linux 4.16.0-parrot12-amd64 ...'
linux /boot/vmlinuz-4.16.0-parrot12-amd64 root=UUID=b7ff9eea-13c4-4b30-8104-b41cc3258364 ro noautomount quiet
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.16.0-parrot12-amd64
}
submenu 'Advanced options for Parrot GNU/Linux' $menuentry_id_option 'gnulinux-advanced-b7ff9eea-13c4-4b30-8104-b41cc3258364' {
menuentry 'Parrot GNU/Linux, with Linux 4.16.0-parrot12-amd64' --class parrot --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.16.0-parrot12-amd64-advanced-b7ff9eea-13c4-4b30-8104-b41cc3258364' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 b7ff9eea-13c4-4b30-8104-b41cc3258364
else
search --no-floppy --fs-uuid --set=root b7ff9eea-13c4-4b30-8104-b41cc3258364
fi
echo 'Loading Linux 4.16.0-parrot12-amd64 ...'
linux /boot/vmlinuz-4.16.0-parrot12-amd64 root=UUID=b7ff9eea-13c4-4b30-8104-b41cc3258364 ro noautomount quiet
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.16.0-parrot12-amd64
}
menuentry 'Parrot GNU/Linux, with Linux 4.16.0-parrot12-amd64 (recovery mode)' --class parrot --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.16.0-parrot12-amd64-recovery-b7ff9eea-13c4-4b30-8104-b41cc3258364' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 b7ff9eea-13c4-4b30-8104-b41cc3258364
else
search --no-floppy --fs-uuid --set=root b7ff9eea-13c4-4b30-8104-b41cc3258364
fi
echo 'Loading Linux 4.16.0-parrot12-amd64 ...'
linux /boot/vmlinuz-4.16.0-parrot12-amd64 root=UUID=b7ff9eea-13c4-4b30-8104-b41cc3258364 ro single noautomount
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.16.0-parrot12-amd64
}
menuentry 'Parrot GNU/Linux, with Linux 4.16.0-parrot5-amd64' --class parrot --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.16.0-parrot5-amd64-advanced-b7ff9eea-13c4-4b30-8104-b41cc3258364' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 b7ff9eea-13c4-4b30-8104-b41cc3258364
else
search --no-floppy --fs-uuid --set=root b7ff9eea-13c4-4b30-8104-b41cc3258364
fi
echo 'Loading Linux 4.16.0-parrot5-amd64 ...'
linux /boot/vmlinuz-4.16.0-parrot5-amd64 root=UUID=b7ff9eea-13c4-4b30-8104-b41cc3258364 ro noautomount quiet
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.16.0-parrot5-amd64
}
menuentry 'Parrot GNU/Linux, with Linux 4.16.0-parrot5-amd64 (recovery mode)' --class parrot --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.16.0-parrot5-amd64-recovery-b7ff9eea-13c4-4b30-8104-b41cc3258364' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 b7ff9eea-13c4-4b30-8104-b41cc3258364
else
search --no-floppy --fs-uuid --set=root b7ff9eea-13c4-4b30-8104-b41cc3258364
fi
echo 'Loading Linux 4.16.0-parrot5-amd64 ...'
linux /boot/vmlinuz-4.16.0-parrot5-amd64 root=UUID=b7ff9eea-13c4-4b30-8104-b41cc3258364 ro single noautomount
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.16.0-parrot5-amd64
}
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/30_uefi-firmware ###
### END /etc/grub.d/30_uefi-firmware ###
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
### BEGIN /etc/grub.d/41_custom ###
if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
--------------------------------------------------------------------------------
=============================== sda1/etc/fstab: ================================
--------------------------------------------------------------------------------
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda1 during installation
/dev/sda1 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
/dev/sda2 none swap sw 0 0
/dev/sr0 /media/cdrom0 udf,iso9660 user,noauto 0 0
--------------------------------------------------------------------------------
=================== sda1: Location of files loaded by Grub: ====================
GiB - GB File Fragment(s)
187.522518158 = 201.350770688 boot/grub/grub.cfg 3
4.466430664 = 4.795793408 boot/grub/i386-pc/core.img 1
190.794677734 = 204.864225280 boot/vmlinuz-4.16.0-parrot12-amd64 1
116.404052734 = 124.987899904 boot/vmlinuz-4.16.0-parrot5-amd64 1
190.794677734 = 204.864225280 vmlinuz 1
116.404052734 = 124.987899904 vmlinuz.old 1
7.262573242 = 7.798128640 boot/initrd.img-4.12.0-parrot6-amd64.old-dkms 3
131.342136383 = 141.027545088 boot/initrd.img-4.13.0-parrot4-amd64.dpkg-bak 2
185.904907227 = 199.613874176 boot/initrd.img-4.13.0-parrot4-amd64.old-dkms 1
19.698547363 = 21.151154176 boot/initrd.img-4.14.0-parrot13-amd64.old-dkms 5
55.503704071 = 59.596648448 boot/initrd.img-4.15.0-parrot17-amd64.old-dkms 1
91.322883606 = 98.057199616 boot/initrd.img-4.16.0-parrot12-amd64 2
85.414760590 = 91.713400832 boot/initrd.img-4.16.0-parrot5-amd64 4
91.322883606 = 98.057199616 initrd.img 2
85.414760590 = 91.713400832 initrd.img.old 4
=============================== StdErr Messages: ===============================
mdadm: No arrays found in config file or automatically
|
** After applying the edits with GParted I haven't been able to boot with a graphical interface. Instead after initializing the screen turns black with a blinking cursor in the top left corner. **
I have similar issue, not identical, You may wanna try this:
[Fixing the black screen after grub boot-up (screen/video settings mismatch)]
| Parrot Linux boots to black screen with blinking underscore: Can get shell with ctrl + alt + F1 |
1,467,746,567,000 |
Here is what happend in the last week:
I created a Suse12 virtual machine in VMWare on my Windows 10.
I exported the VM as an OVF file and gave it to someone else to deploy it on some remote server; and "someone" has given it a 1TB disk space.
I ssh-connected to the remote VM, and found the root partition is only 19G, which comes from my VMWare configuration apparently and is far from enough for the related work, while there are like 980GB of disk out there free of use.
So my question is, how can I extend the root volume to 700GB when I can only connect to the server by ssh?
Edit: I have solved the problem following instructions here -> https://www.suse.com/support/kb/doc/?id=7018329
It turns out the file system btrfs matters a lot. I'd been following wrong instructions not realizing the difference between file systems.
|
Give this a try - https://www.suse.com/support/kb/doc/?id=7018329
Hopefully this works out for you.
Also, make sure you're using SLES 12 SP3, SP2 and prior are already on LTSS.
| How to extend root partition on remote virtual machines? |
1,467,746,567,000 |
I have the following disk setup:
200 GB SSD with windows 10 on it
1 TB HDD with two 460 GB NTFS data partitions.
I want to format the 1st data partition to install linux on 100 GB of freed space and the remaining 360 GB dedicate back to NTFS. So on the HDD I need to have Linux and 2 NTFS partitions, all while 2nd NTFS partition stays in place at the end of the HDD.
How do I properly do it as I can only have 4 primary partitions? Should I just install linux on one partition without dedicated efi, swap, root and home partitions (if it is even possible)?
|
The 4 primary partition limit applies only to disks partitioned with MBR. GPT, does not have this limitation. I strongly recommend you to change the partitioning scheme of your data partition from MBR to GPT if you need more that 4 partitions. Warning: backup your data before trying the conversion (there are multiple articles on how to accomplish this either using Windows 10 - diskpart - or Linux). Check this: http://www.thewindowsclub.com/convert-mbr-to-gpt-disk
If you go ahead and stay with MBR, you'll have to limit yourself to 4 primary partitions in your data disk or 3 primary + 1 extended. Since all Linux partitions will be on the same disk (no performance benefits), I would go with this very simple partitioning layout: 1 partition for / (and everything else), and 1 partition for swap. This would leave you with exactly 4 primary partitions (2 for Linux, and 2 for NTFS). Or you may take a look on how to create extended partitions in MBR with Linux fdisk.
| How to properly install linux on a hdd with 2 ntfs primary partitions? |
1,467,746,567,000 |
in the last days I heard of Wine 3.0. Also I heard of PCI passthrough and so on.
Because of some reasons I want go away from Windows.
I'm using linux (Ubuntu/Debian) at work for four years now.
Now I want to build an Arch-Linux setup at home.
Some background to me:
I'm a Softwaredeveloper (mainlanguages: Java, JavaScript)
I don't play so much anymore, I want to play Overwatch mainly
I'm german native speaker (sry when my english isn't so well)
Current Setup
Windows 10
SSD 256GB
450MB Recovery
100MB EFI
213GB Windows (C:)
871MB Another recovery (Don't know were this comes from ^^')
24GB SSD Fallback
500GB HDD
Home 465GB (D:)
2TB HDD
Programms 1863GB (E:)
1TB HDD
Files 931GB (F:)
2TB HDD
Steam 1862GB (S:)
Planned Setup
Arch-Linux
(size, label, dir, drive/partition)
SSD 256GB /dev/sda
512MB BOOT /boot /dev/sda1
255GB ROOT / /dev/sda2
500GB HDD /dev/sdb
449GB HOME /home /dev/sdb1
16GB SWAP /dev/sdb2
2TB HDD /dev/sdc
1863GB PROGRAMS /opt & /var /dev/sdc1
Question to that: can I make one partition and put /opt and /var into this?
Also maybe /usr? systemd separate-usr-is-broken
1TB HDD /dev/sde
931GB FILES /dev/sde1 or NTFS and let it as it is
Not really a plan with this
I used it for recorded video material
2TB HDD /dev/sdd
1862GB STEAM /steam /dev/sdd1
Can I make a directory on /steam? otherwise is it possible to do /opt/steam on this drive?
Further Questions
/data
What is it? Should I put this into another drive than SSD?
did I forgot something?
|
You can put /opt and /var into the same volume by making it a btrfs volume and creating subvolumes for both. You can also chose just any file system and use bind mounts.
But the probably best solution is to use LVM and not use all the available space. LVM logical volumes and aeveral file systems (at least ext4 and btrfs) can be enlarged online i.e. a mounted file system can grow.
I like to have a second, small linux partition where I install a maintenance Linux (text mode only). That way you do not need a separate boot medium for many problems.
| Partitioning an Arch-Linux over multiple drives [closed] |
1,467,746,567,000 |
Here is GParted. The 4 partitions on the left are for windows 10, and the 3 on right are linux mint. The large green one is C: for windows, and I believe the large blue one is root for linux. I do not know how the root partition got over 82 GB, I want to shrink it down to maybe 12 and use all of the remaining for C: in windows. I am aware I will probably need to boot into a live session. Is this possible? will windows accept the addition to C:? Thanks!
|
Yes, it is possible.
If you only shrink the ext4 partition, Windows will not see any changes to C:, you will have to increase the size of sda4 too, which may be more troublesome.
Make sure to backup your data before resizing partitions.
| How to shrink root partition and extend another |
1,467,746,567,000 |
I would like to set up my raspberry pi model B and my 2TB hard drive as a backup server for both my windows pc and my mac. I would like to partition my hard drive such that 300GB is for mac time machine backups, 300GB is for windows backup image and the remaining space is a partition to be used for file sharing.
Pi is running Raspbian OS
Can anyone guide me on how to go about partitioning my drive with my Pi?
Thanks!
Been following this guide (but it doesnt fit my needs anymore): https://raymii.org/s/articles/Build_a_35_dollar_Time_Capsule_-_Raspberry_Pi_Time_Machine.html
|
This guide presumes that the disk is located at /dev/sda (Normal location if you only have 1 disk connected). It does use "fdisk" instead "parted"
Open a terminal prompt and type the commands below:
First step is to get root activated (This saves you from having to type "sudo" before each command:
su -
And type your root password to login as the root user.
If the disk is mounted, you will need to unmount the disk by running:
ummount /dev/sda
Now once it's unmounted, you can run the command:
fdisk /dev/sda
Which opens the partition table of the disk for editing.
Enter m to get the help information.
You will need to delete any existing partitions. To see if there are any, enter p. This will print a list of the partitions on the device.
To delete the partition, enter d and the number of the partition. You will need to repeat this command until all the partitions are deleted.
Next enter n which is the command for creating a new partition. Enter p for a Primary Partition which is the default.
It will ask you for the sector information. For the first partition enter the default start sector (Just leave it blank to use default I believe) and then for the end sector enter +300G which creates a 300gb partition.
Repeat the n command again for the windows backup disk, then again for the file sharing partition but this time, use the default end sector to max out the disk space.
Write the new partition table to the disk by entering w.
To create a ext4 filesystems on these new partitions run:
mkfs.ext4 /dev/sda1
mkfs.ext4 /dev/sda2
mkfs.ext4 /dev/sda3
These commands assume that you numbered the partitions 1-3 and want to use the ext4 format which is what most linux distributions use.
To mount these file systems, you need to create a folder to mount each partition in. I will use /mnt as an example but you can use any location.
mkdir /mnt/timemachine
mkdir /mnt/windowsbackup
mkdir /mnt/filesharing
Then run the following to mount the partitions:
mount -t ext4 /dev/sda1 /mnt/timemachine
mount -t ext4 /dev/sda2 /mnt/windowsbackup
mount -t ext4 /dev/sda3 /mnt/filesharing
These should now be ready to use for your purposes.
| Raspberry Pi backup server (Mac & Windows) [closed] |
1,467,746,567,000 |
Going to format some free space in ext4 file system, but currently in doubt about its size.
Aren't there a maximum recommended size for it?
Something like a good manner, for example: "home partitions shouldn't be larger than 400gb`.
|
Considering that a file system is and electronic fragile structure, it may be wiser to do not keep all files in only one partition, in case of file system error.
Having conditions, it should be better to divide in smaller ones, if possible.
| Aren't There a Maximum Recommended Size Of Given Home Partition? [closed] |
1,467,746,567,000 |
From We can make a disk a PV by `pvcreate`, if and only if the disk has only one partition?
You can't make the whole disk a PV if there is at least one partition on it (because pvcreate won't let you).
When considering disks and partitions as concepts in operating systems, is it correct that a disk without being partitioned is a partition by itself?
If no, what is the difference between a disk without being partitioned and a disk with only one partition?
Can pvcreate mark a disk with only one partition as a PV?
|
A disk without being partitioned is a disk with no partitions or partition table; it’s not a partition (a partition separates something into parts, even if it’s only one; a whole disk isn’t separated into parts).
A disk with one partition is a disk with a partition table of some sort (there are several partitioning schemes), with one entry in the table defining a partition.
pvcreate can create a physical volume using an entire disk or a partition. By default it will refuse to create a physical volume using an entire disk if it already contains a partition table.
(Note that pvcreate doesn’t “mark” an existing feature — disk or partition —, it creates a physical volume, which involves writing metadata.)
| Is a disk without being partitioned a partition by itself? |
1,467,746,567,000 |
Lets assume my system has the root ( / ) partition located on "/dev/sda1" and the /home partition is located on "/dev/sda2", Why does "/home" have " / " at the beginning since " / " is on a different partition?
|
All pathnames in Unix-like operating systems exist in a single hierachical file system structure inspired by the organization of secondary storage in the Multics operating system.
The hierachical file system is an abstraction that hides away details about the physical storage, such as disk partitions.
The / denotes the start of the abstract tree structure files and directories inhabit. This start point is also called the root directory, which by convention is the mount point of the root partition, which in turn provides the physical storage for the file system. In case a separate partition is used for the user home directories, that partition is mounted at /home/, a directory existing on the root partition. When referring to /home, we are really referring to the mount point relative to the root directory (/), not the home partition per se.
In Unix-like operating systems. Different processes may have different views of the the filesystem, for instance if they're are running in separate chroot environments, in which case / refers to the boundary of the file system hierarchy visible to them.
Compare this other operating systems, such as Windows, where drive letters (such as C:\) denoting the physical partitions are visible in all absolute pathnames. This doesn't abstract away the details about the physical storage, making moving files from one partition to another more difficult, as they partition the file exist on is visible in the way we refer to the file.
| "Why does "/home" have " / " at the beginning if for example the " / " is on a different partition? [duplicate] |
1,467,746,567,000 |
I have rented a dedicated server with two 500gb hardisks running Centos 6.
On this server there are 4 partitions:
1.boot
2.root 50gb
3.swap 50gb4.
4.empty 400gb
Now I want to create a logical volume group spanning the empty 400gb on the first disk and merge it with the empty 400gb on the second disk.
I've read tutorial after tutorial but I cannot understand how to accomplish this task. I just want to merge the empty partition with the empty disk.
Can someone please outline the steps to accomplish this, or please tell me if it is at all possible?
|
Note: As a fair warning, you need to be careful when having logical volumes span across multiple disks. If one fails, you lose your entire volume group. I cannot stress this enough, there is a huge possibility of you losing your data if a drive fails or you delete a partition that's part of the volume group.
You need to create a partition on both disks for the free space you have. You can use fdisk or parted. I personally use fdisk.
# fdisk -cu /dev/sda
You will want to create a new partition by pressing n, and let it select all the defaults.
Press t, select partition 4, and set it to 8e, which is LVM.
Press w to save.
You will need to do the same for your other disk, this is more than likely /dev/sdb. Create a new partition, let it be the defaults so it takes the whole disk.
You will need to reboot after you make changes to your primary disk!
Afterwards, you need to create a "physical volume".
# pvcreate /dev/sda4
Do this for the two partitions you created. Now create a Volume Group. Replace your device names and numbers according to what you have in your setup.
# vgcreate VolGroup01 /dev/sda4 /dev/sdb4
This will create a volume group that spans those two partitions, across those two disks. Now, you can create a logical volume.
# lvcreate VolGroup01 -n LogVolOpt -L200G
(I decided to format mine with ext4)
# mkfs.ext4 /dev/VolGroup01/LogVolOpt
| How can I create an LVM volume group spanning 2 hard drives? [closed] |
1,467,746,567,000 |
New Linux (Debian) installation. Two hard disks, A and B.
On A I have the whole system, on B I just have the lost+found directory.
Only root has read/write access to B.
How can I create a directory in B from the command line (with root privileges)?
With: mkdir /newDir
The directory is created in A.
The directory /mnt is empty.
The directory /media contains: cdrom0
This is the output of mount:
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=8251934,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,relatime,size=13206492k,mode=755)
/dev/sda2 on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=23,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
/dev/sda1 on /boot/efi type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=utf8,shortname=mixed,errors=remount-ro)
rpc_pipefs on /run/rpc_pipefs type rpc_pipefs (rw,relatime)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=6603248k,mode=700,uid=1000,gid=1000)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
/dev/sdb1 on /media/pietrom/2ffc680f-08e5-4a14-bbb7-f8c01fdff532 type ext4 (rw,nosuid,nodev,relatime,data=ordered,uhelper=udisks2)
|
I understand that your hard disk B is mounted on /media/pietrom/2ffc680f-08e5-4a14-bbb7-f8c01fdff532, so in order to create a new folder on it, do:
mkdir /media/pietrom/2ffc680f-08e5-4a14-bbb7-f8c01fdff532/newDir
| How to write on a second hard disk? |
1,533,026,883,000 |
I have a new build which I have set up as dual boot with Windows10 alongside ubuntu 18.04. The Ubuntu installation has a root/home and swap partitions.
As part of the set up process I was trying to install GPU drivers but that seems to have seriously screwed things up.
Now when I try to log in the screen fades to black only to reemerge as the login screen I know there is a workaround using ctrl + Alt + F3 but for that you need to know your login (and I don't).
There is also a workaround to find your user name by going in through recovery mode but unfortunately my mouse and keyboard won't work in recovery mode.
It really is a catch 22!
The only thing left I can think of is to reinstall (unless someone here has a better idea) to:
get rid of the dodgy drivers
start over with a new login
When I boot from the installation DVD, there is an option to delete and reinstall 18.04 but this process only deletes the root drive. Would this be sufficient to get rid of the dodgy drivers/forgotten login or should I also delete the home and swap partitions manually?
|
Pass init=/bin/sh rw parameter after your kernel in grub, then you'll get an instant rootshell.
| How to remove faulty GPU drivers Ubuntu 18.04 |
1,533,026,883,000 |
I tried to extend my partition with LVM, but not having much success. These are my HDD's in my server. The 2000GB is the new HDD. I would like to add it for my first HDD.
root@webstar:~# fdisk -l
Disk /dev/sda: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0xe116fa32
Device Boot Start End Blocks Id System
/dev/sda1 1 243201 1953512001 8e Linux LVM
Partition 1 does not start on physical sector boundary.
Disk /dev/sdb: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0002eb1e
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 29787 239256576 83 Linux
/dev/sdb2 29787 30402 4939777 5 Extended
/dev/sdb5 29787 30402 4939776 82 Linux swap / Solaris
Disk /dev/dm-0: 1932.7 GB, 1932735283200 bytes
255 heads, 63 sectors/track, 234975 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000
Disk /dev/dm-0 doesn't contain a valid partition table
I have downloaded and installed LVM. I have a group and maybe did something good with that 2TB HDD.
root@webstar:~# pvdisplay
--- Physical volume ---
PV Name /dev/sda1
VG Name vgpool
PV Size 1.82 TiB / not usable 2.56 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 476931
Free PE 16131
Allocated PE 460800
PV UUID m9rO1H-1OeC-0W38-gRUg-p9aQ-xEBZ-ZDxRvi
I used this command: lvcreate -L 1800G -n lvstuff vgpool and after that mkfs -t ext3 /dev/vgpool/lvstuff and after I tried to mount it for my first HDD : mount -t ext3 /dev/vgpool/lvstuff /, but it doesn't work for me. It looks like It just copied my first HDD or what? On my cpanel I see this:
Device Type Mount point % free used size
/dev/mapper/vgpool-lvstuff ext3 / 93% 16.39 GB 196.79 GB 224.59 GB
/dev/sdb1 ext3 / 93% 16.39 GB 196.79 GB 224.59 GB
|
You cannot extend a partition with one that is under LVM as such. What you can do is combine multiple partitions that are managed with LVM to be combined into one virtual partition.
The first thing obvious from your post is that the result of fdisk -l shows only one LVM partition. If you want to combine things you need at least two.
The other thing that I find strange is that you mount /dev/vgpool/lvstuff on /, would that work, you would no longer have access to your running OS. Normally you mount something in a subdirectory X. Most often that directory will be empty, because you cannot access any file/sudirectories available under X before the mount by name.
(It would be nice to know which instructions you are following so we don't have to guess what you want to do, where things went wrong, what you should have been doing and how to fix it given where you are now (if possible).)
Edit:
My first recommendation is as per this. If you absolutely need to have the combined space of the 250Gb drive and the 2Tb drive as one volume then:
You have to check whether you can boot from an LVM partition (I am not sure and although I use LVM, it is only for data partitions, not for those with the OS).
If you find you can boot from a system under LVM, then the easiest thing to do is mount /dev/mapper/vgpool-lvstuff to /mnt/tmp and copy everything from / to that directory. Then make sure you can boot from /dev/sda1, wipe /dev/sdb1 and use vgextend on that /dev/sda1
If you find you cannot boot from a partition under LVM (which is more likely unless grub knows about how LVM rearranges blocks), then you will somewhere have a non-LVM partition with at least /boot. There are various ways to go about that, but you need to make some room somewhere to have this partition and its data (280Mb on my Ubuntu 12.04 server). Then copy your /boot contents there, change /etc/fstab and the grub configuration so that you can boot from this new partition. Then, for the rest of / the same steps would need to be done as for when LVM is bootable.
It might be a tricky process and will take time (copying files, rebooting etc), I have moved data around this way but only without LVM.
Once more: you should really consider whether it is worth having just 10% more contiguous disc space space compared to a simple mount of /dev/sda1 as a normal partition. If that contiguous space is so important I would have bought a 3TB drive and save a few hours of work.
| LVM to extend a partition? [duplicate] |
1,533,026,883,000 |
So, I was messing up the Windows paging value and accidentally set it to 30Gb and made my PC blue screen. Then I can no longer boot into Windows or GNU/Linux (I have dual boot setup). Luckily I still have the USB bootable for Parrot OS so I use live mode to help me recover but until now I haven't got anything successful.
What I have done:
Download Windows iso for repair PC options but can't access my C drive because it keeps saying I/O error.
Check for bad blocks using badblocks command in the terminal and most sectors/blocks are broken.
What I'm going to do:
Use S.M.A.R.T or ddrescue to check my drive.
I can't access my main drive and sometimes the partition just disappears on the list from fdisk -l. I can boot into Windows installation but I can't chkdsk the drive because I/O error. So, I need a way to fix or at least can get my important files back.
|
Alright, I bought a new hard drive for now and I will send the old one to data recovery specialist. Thanks for the help everyone :)
| I wanted to fix my hard drive bad sectors but it keep saying I/O error inreturn |
1,533,026,883,000 |
I want to install Kali Linux on a 64 GB USB drive and want to take it just anywhere and plug it in any PC and have my setup up and running. IOW I just want a HDD like complete Kali Linux portable installation on a USB.
I don't want Live boot or persistence or anything, I clearly want to install it on that USB just like we normally install Kali Linux on HDDs.
I would like to give some information about my internal HDD -
root@Kali:~# fdisk -l
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Disk model: ST500DM009-2F110
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 0BBC9B99-EE7E-11E8-8BD6-843C86F9DFC6
Device Start End Sectors Size Type
/dev/sda1 2048 1126399 1124352 549M Microsoft basic data
/dev/sda2 1126400 210561023 209434624 99.9G Microsoft basic data
/dev/sda3 210561024 210765823 204800 100M EFI System
/dev/sda4 210765824 315623423 104857600 50G Linux filesystem
/dev/sda5 315623424 328206335 12582912 6G Linux swap
/dev/sda6 328206336 537921535 209715200 100G Linux filesystem
/dev/sda7 537921536 976773134 438851599 209.3G Microsoft basic data
Disk /dev/sdb: 57.9 GiB, 62109253632 bytes, 121307136 sectors
Disk model: Ultra
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: BC1A35EC-FF80-4CCB-BD61-30F7FF3CDA4A
Device Start End Sectors Size Type
/dev/sdb1 2048 206847 204800 100M EFI System
/dev/sdb2 206848 68567039 68360192 32.6G Linux filesystem
/dev/sdb3 68567040 76380159 7813120 3.7G Linux swap
/dev/sdb4 76380160 121305087 44924928 21.4G Linux filesystem
The /dev/sda is my internal HDD with Windows 10 + Manjaro installed on it in dual boot in UEFI mode.
The /dev/sdb is the target 64 GB USB drive on which I want to install Kali Linux. What you are seeing here in /dev/sdb is the current installation of my Kali Linux (my 3rd try).
I downloaded the Kali Linux KDE 2019 ISO from the official Kali Linux Downloads page, used Rufus to make a Live boot in DD mode in another spare 16 GB USB. I deleted all the partitions on the target USB and made it unallocated. Booted from the Live USB, selected Graphical installer, went through all the process until Partitioning.
I chose Manual partitioning method, then partitioned my target USB (shown as /dev/sdc in the installer) as follows -
SCSIl (0,0,0) (sdc) - 62.1 GB
> 1.0 MB FREE SPACE
> #1 /dev/sdc1 104.9 MB B K ESP EFI system partition
> #2 /dev/sdc2 35.0 GB f ext4 /
> #3 /dev/sdc3 4.0 GB f swap swap
> #4 /dev/sdc4 23.1 GB f ext4 /home
> 1.0 MB FREE SPACE
I checked everything especially the bootable flag "on" in EFI partition. After making sure everything was right I proceeded with the installation. One unusual thing I did notice after clicking Continue was I only created 4 partitions on my /dev/sdc, but there were 5 partitions listed under "partitions to be formatted", I examined and found that along with the 4 newly created partitions on /dev/sdc , the swap partition on /dev/sda was also listed to be formatted there. I thought that is strange as I didn't even touch /dev/sda while partitioning, but I ignored it and clicked Continue. The system got installed successfully, finished the installation and rebooted. Also took out the Live USB stick.
So far so good.
Got the grub screen, selected Kali and boom! The first thing I encountered was a black screen with (initramfs) as the grub failed to find root partition on /dev/sdc (NOTE: While installation the target USB was /dev/sdc , but after removing Live USB stick it became /dev/sdb ). So I went back to grub by rebooting and pressed "e" and changed the device path for root from /dev/sdc2 to /dev/sdb2. Pressed F10 and that booted me into my Kali Linux desktop, YAY!
Well, not so yay. I just fired up GParted to check whether all my partitions are intact, and to my surprise I saw that instead of the EFI partition that I created on /dev/sdb, the EFI partition of /dev/sda was mounted, the root, swap & home partitions on /dev/sdb were mounted and the swap partition on /dev/sda was mounted too! WTF!
Also the EFI partition on /dev/sdb which was expected to be mounted at /boot/efi was not mounted!
This just got my head spinning, I tried the above step one more time but got the same result. Then I read somewhere that the EFI partition must already be present on the target USB drive, so I tried that too but no result.
So I shutdown the system and plugged the USB in a different laptop to see whether it works, but as soon as I fire up the boot menu there is no option to boot from USB. I tried disabling Legacy support & Secure Boot. Also tried to Add a boot option but there is no EFI file available in the file system of the USB. The EFI file for Kali is available with Manjaro and Windows in the file system of my internal HDD which clearly shows that the EFI files got installed on the EFI partition of /dev/sda.
I need to find out what's happening here, what's going wrong, how can I fix this, and how can I fulfill my aim mentioned above.
|
I finally solved this issue!
Using this wiki - https://wiki.debian.org/GrubEFIReinstall
| Kali Linux installation on USB drive |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.