linux-raw-filesystem-management

JSON

rev 6  |  foxhop  |  1361187593000  |  JSON

rev 5
rev 6
7878
7979
nn80Remount read-only or read-write
81===================================
8082
tt83Sometimes live disks and rescue modes mount your partitions for you.  I'm my cas
 >e the rescue was mounting root partition as read-only, and I needed to remove an
 > entry in /etc/fstab.  This command will remount a partition with rw:
84 
85.. code-block:: bash
86 
87 mount -o remount,rw /dev/mapper/VolGroup00-LogVol0 /
88 
89This allowed me to edit /etc/fstab, remove the bad entry and reboot.  The server
 > came back online.  We still need to figure out what happened to the disk, try t
 >o recover it.
90 
91 
92 
rev 5  |  foxhop  |  1360531861000  |  JSON

rev 4
rev 5
tt1Linux Raw File system Management
2###########################################
3 
1Pretend we have added a new disk to our computer.4Pretend we have added a new disk to our computer.
25
rev 4  |  foxhop  |  1360531833000  |  JSON

rev 3
rev 4
n1I have added a new disk /dev/xvdf n1Pretend we have added a new disk to our computer.
22
t3we need to run the following commands on this device to get it ready for a file t3The operating system has detected this new disk as device /dev/xvdf.
>system. 
4 
5The following documents the steps we need to take to use this new space.
46
5Partition the device7Partition the device
rev 3  |  foxhop  |  1360531688000  |  JSON

rev 2
rev 3
61 sudo mount /dev/xvdf1 /mnt61 sudo mount /dev/xvdf1 /mnt
6262
tt63 
64Automatically mount partition at system boot
65=================================================
66 
67Add an entry into /etc/fstab for new partition.
68 
69.. code-block:: text
70 
71 /dev/xvdf1   /mnt        ext4   defaults        0 0
72 
73 
74 
75 
rev 2  |  foxhop  |  1360531352000  |  JSON

rev 1
rev 2
4848
4949
nn50Mount and test the new filesystem
51=======================================
5052
tt53 
54.. code-block:: bash
55 
56 sudo mount /dev/xvdf1 /mnt
57 touch /mnt/testfile
58 ls /mnt
59 sudo umount /mnt
60 ls /mnt
61 sudo mount /dev/xvdf1 /mnt
62 
rev 1  |  foxhop  |  1360531103000  |  JSON

empty
rev 1
tt1I have added a new disk /dev/xvdf 
2 
3we need to run the following commands on this device to get it ready for a file 
 >system.
4 
5Partition the device
6========================
7 
8You may cut the device into separate logical disks.
9 
10In my case I want to use the whole disk
11 
12.. code-block:: bash
13 
14 sudo fdisk /dev/xvdf 
15 # choose needed settings
16 
17Format the partition with a filesystem
18========================================
19 
20We want to use ext4 so we do
21 
22.. code-block:: bash
23 
24 sudo mkfs.ext4 /dev/xvdf
25 
26  mke2fs 1.42 (29-Nov-2011)
27  Filesystem label=
28  OS type: Linux
29  Block size=4096 (log=2)
30  Fragment size=4096 (log=2)
31  Stride=0 blocks, Stripe width=0 blocks
32  6553600 inodes, 26214400 blocks
33  1310720 blocks (5.00%) reserved for the super user
34  First data block=0
35  Maximum filesystem blocks=4294967296
36  800 block groups
37  32768 blocks per group, 32768 fragments per group
38  8192 inodes per group
39  Superblock backups stored on blocks: 
40         32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
 > 
41         4096000, 7962624, 11239424, 20480000, 23887872  
42 
43  Allocating group tables: done                            
44  Writing inode tables: done                            
45  Creating journal (32768 blocks): done
46  Writing superblocks and filesystem accounting information: done   
47 
48 
49 
50